... | ... |
@@ -1,10 +1,10 @@ |
1 |
-<p align="center"><a href="https://mcopenplatform.org" target="_blank" rel="noopener noreferrer"><img src="https://demo.mcopenplatform.org/gitlist/mcop/MCOP-MCPTT-Client.git/raw/master/images/logoMCOP_MD_w400px.png" alt="MCOP logo"></a></p> |
|
1 |
+<p align="center"><a href="https://mcopenplatform.org" target="_blank" rel="noopener noreferrer"><img src="images/logoMCOP_MD_w400px.png" alt="MCOP logo"></a></p> |
|
2 | 2 |
|
3 |
-# MCOP MCPTT Client The **MCOP MCPTT Client** comprises different elements connected by Android’s binder mechanism including the **MCPTT Client GUI**, the **MCOP SDK** (responsible of MCPTT protocols) and **low level plugins** to access SIM card, eMBMS, connectivity and configuration-oam to be deployed to get access to Mission Critical capabilities. |
|
3 |
+# MCOP MCPTT Client v2.0 The **MCOP MCPTT Client v2.0** comprises different elements connected by Android’s binder mechanism including the **MCPTT Client GUI**, the **MCOP SDK** (responsible of MCPTT protocols) and **low level plugins** to access SIM card, eMBMS, connectivity and configuration-oam to be deployed to get access to Mission Critical capabilities. |
|
4 | 4 |
|
5 |
-Check [**MCOP MCPTT Client Installation**](https://demo.mcopenplatform.org/gitlist/mcop/MCOP-MCPTT-Client.git/blob/master/docs/MCOP_MCPTT_Client_Installation.md) for instructions. |
|
5 |
+Check [**MCOP MCPTT Client Installation**](docs/MCOP_MCPTT_Client_Installation.md) for instructions. |
|
6 | 6 |
|
7 |
-License terms are defined in the [Licensing](https://demo.mcopenplatform.org/gitlist/mcop/MCOP-MCPTT-Client.git/blob/master/docs/Licensing.md) and [Doubango](https://demo.mcopenplatform.org/gitlist/mcop/MCOP-MCPTT-Client.git/blob/master/docs/Licensing_Doubango.md) files. * For testing purposes, the [**MCOP Demo Platform**](https://demo.mcopenplatform.org/) is also available. Check the [**profiles**](https://demo.mcopenplatform.org/gitlist/mcop/MCOP-MCPTT-Client.git/blob/master/docs/Profiles.md) documentation for information on how to request access to our platform and configure the application. |
|
7 |
+License terms are defined in the [Licensing](docs/Licensing.md) and [Doubango](docs/Licensing_Doubango.md) files. * For testing purposes, the [**MCOP Demo Platform**](https://demo.mcopenplatform.org/) is also available. Check the **demo.mcopenplatform.org** section on the [**Provisioning Tool documentation**](docs/ProvisioningTool.md) page for more information on how to request access to our platform and configure the application. |
|
8 | 8 |
|
9 |
-* Refer to [**MCOP SDK** Installation](https://demo.mcopenplatform.org/gitlist/mcop/MCOP-SDK.git/blob/master/docs/MCOP_SDK_Installation.md) for detailed **MCOP SDK** installation and testing steps. The [MCOP MCPTT App Development](https://demo.mcopenplatform.org/gitlist/mcop/MCOP-MCPTT-Client.git/blob/master/docs/MCOP_App_developing_steps.md) guide provides more info on app development using the MCOP SDK. This application uses [Doubango Framework](https://www.doubango.org/). Refer to [Doubango IMSDroid README](https://demo.mcopenplatform.org/gitlist/mcop/MCOP-MCPTT-Client.git/blob/master/docs/imsdroid_README.md) for additional IMS/SIP compatibility statements. |
|
10 |
- **Copyright (C) 2018, University of the Basque Country (UPV/EHU)** For more information, please visit [MCOP - Resources](https://www.mcopenplatform.org/mcop_resources/) or [MCOP webpage](https://www.mcopenplatform.org). |
|
9 |
+* Refer to [**MCOP SDK** Installation](https://demo.mcopenplatform.org/gitlist/mcop/MCOP-SDK.git/blob/master/docs/MCOP_SDK_Installation.md) for detailed **MCOP SDK** installation and testing steps. The [MCOP MCPTT App Development](docs/MCOP_App_developing_steps.md) guide provides more info on app development using the MCOP SDK. This application uses [Doubango Framework](https://www.doubango.org/). Refer to [Doubango IMSDroid README](docs/imsdroid_README.md) for additional IMS/SIP compatibility statements. |
|
10 |
+ **Copyright (C) 2019, University of the Basque Country (UPV/EHU)** For more information, please visit [MCOP - Resources](https://www.mcopenplatform.org/mcop_resources/) or [MCOP webpage](https://www.mcopenplatform.org). |
|
11 | 11 |
\ No newline at end of file |
... | ... |
@@ -1,13 +1,13 @@ |
1 | 1 |
apply plugin: 'com.android.application' |
2 | 2 |
|
3 | 3 |
android { |
4 |
- compileSdkVersion 26 |
|
4 |
+ compileSdkVersion 28 |
|
5 | 5 |
defaultConfig { |
6 | 6 |
applicationId "org.test.client.mcopclient" |
7 | 7 |
minSdkVersion 22 |
8 |
- targetSdkVersion 26 |
|
9 |
- versionCode 1 |
|
10 |
- versionName "1.0" |
|
8 |
+ targetSdkVersion 28 |
|
9 |
+ versionCode 2 |
|
10 |
+ versionName "2.0" |
|
11 | 11 |
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
12 | 12 |
} |
13 | 13 |
/** |
... | ... |
@@ -38,11 +38,11 @@ dependencies { |
38 | 38 |
testImplementation 'junit:junit:4.12' |
39 | 39 |
androidTestImplementation 'com.android.support.test:runner:1.0.1' |
40 | 40 |
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' |
41 |
- compile 'com.android.support.constraint:constraint-layout:1.0.2' |
|
42 |
- compile 'com.android.support:support-annotations:' + rootProject.supportLibVersion |
|
43 |
- compile 'com.android.support:appcompat-v7:' + rootProject.supportLibVersion |
|
44 |
- compile 'com.android.support:design:' + rootProject.supportLibVersion |
|
45 |
- compile 'com.android.support:cardview-v7:' + rootProject.supportLibVersion |
|
46 |
- compile 'com.android.support:support-v4:' + rootProject.supportLibVersion |
|
47 |
- compile 'com.android.support:recyclerview-v7:' + rootProject.supportLibVersion |
|
41 |
+ api 'com.android.support.constraint:constraint-layout:1.0.2' |
|
42 |
+ api 'com.android.support:support-annotations:' + rootProject.supportLibVersion |
|
43 |
+ api 'com.android.support:appcompat-v7:' + rootProject.supportLibVersion |
|
44 |
+ api 'com.android.support:design:' + rootProject.supportLibVersion |
|
45 |
+ api 'com.android.support:cardview-v7:' + rootProject.supportLibVersion |
|
46 |
+ api 'com.android.support:support-v4:' + rootProject.supportLibVersion |
|
47 |
+ api 'com.android.support:recyclerview-v7:' + rootProject.supportLibVersion |
|
48 | 48 |
} |
... | ... |
@@ -34,13 +34,24 @@ |
34 | 34 |
android:supportsRtl="true" |
35 | 35 |
android:theme="@style/AppTheme" > |
36 | 36 |
<activity android:name=".MainActivity" |
37 |
- android:screenOrientation="portrait"> |
|
37 |
+ android:screenOrientation="portrait" |
|
38 |
+ android:theme="@style/AppTheme.NoActionBar" > |
|
38 | 39 |
<intent-filter> |
39 | 40 |
<action android:name="android.intent.action.MAIN" /> |
40 | 41 |
|
41 | 42 |
<category android:name="android.intent.category.LAUNCHER" /> |
42 | 43 |
</intent-filter> |
43 | 44 |
</activity> |
45 |
+ <activity |
|
46 |
+ android:name=".ScreenAuthenticationWebView" |
|
47 |
+ android:screenOrientation="portrait" |
|
48 |
+ android:theme="@style/AppTheme"> |
|
49 |
+ <intent-filter> |
|
50 |
+ <action android:name="com.google.codelabs.appauth.HANDLE_AUTHORIZATION_RESPONSE" /> |
|
51 |
+ |
|
52 |
+ <category android:name="android.intent.category.DEFAULT" /> |
|
53 |
+ </intent-filter> |
|
54 |
+ </activity> |
|
44 | 55 |
</application> |
45 | 56 |
|
46 | 57 |
</manifest> |
... | ... |
@@ -1,31 +1,28 @@ |
1 | 1 |
/* |
2 |
-* Copyright (C) 2018 Eduardo Zarate Lasurtegui |
|
3 |
-* Copyright (C) 2018, University of the Basque Country (UPV/EHU) |
|
4 |
-* |
|
5 |
-* Contact for licensing options: <licensing-mcpttclient(at)mcopenplatform(dot)com> |
|
6 |
-* |
|
7 |
-* This file is part of MCOP MCPTT Client |
|
8 |
-* |
|
9 |
-* This is free software: you can redistribute it and/or modify it under the terms of |
|
10 |
-* the GNU General Public License as published by the Free Software Foundation, either version 3 |
|
11 |
-* of the License, or (at your option) any later version. |
|
12 |
-* |
|
13 |
-* This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
14 |
-* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
15 |
-* See the GNU General Public License for more details. |
|
16 |
-* |
|
17 |
-* You should have received a copy of the GNU General Public License along |
|
18 |
-* with this program; if not, write to the Free Software Foundation, Inc., |
|
19 |
-* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
2 |
+ Copyright (C) 2019, University of the Basque Country (UPV/EHU) |
|
3 |
+ |
|
4 |
+Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
+you may not use this file except in compliance with the License. |
|
6 |
+You may obtain a copy of the License at |
|
7 |
+ |
|
8 |
+ http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
+ |
|
10 |
+Unless required by applicable law or agreed to in writing, software |
|
11 |
+distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
+See the License for the specific language governing permissions and |
|
14 |
+limitations under the License. |
|
20 | 15 |
*/ |
21 | 16 |
package org.mcopenplatform.muoapi; |
17 |
+import android.os.ParcelFileDescriptor; |
|
18 |
+ |
|
19 |
+ |
|
22 | 20 |
|
23 | 21 |
/** |
24 |
-* AIDL definition {@link https://developer.android.com/guide/components/aidl.html} |
|
25 |
-* Used as a callback for MCOP SDK server-client communication, and for MCPTT (Mission Critical Push to Talk) Services. |
|
26 |
-* @author Eduardo Zarate Lasurtegui |
|
27 |
-* @version 0.1 |
|
28 |
-*/ |
|
22 |
+ * AIDL definition {@link https://developer.android.com/guide/components/aidl.html} |
|
23 |
+ * Used as a callback for MCOP SDK server-client communication, and for MCPTT (Mission Critical Push to Talk) Services. |
|
24 |
+ * @version 0.1 |
|
25 |
+ */ |
|
29 | 26 |
interface IMCOPCallback { |
30 | 27 |
/** |
31 | 28 |
* |
... | ... |
@@ -35,6 +32,8 @@ interface IMCOPCallback { |
35 | 35 |
* @return |
36 | 36 |
* @see org.mcopenplatform.muoapi.ConstantsMCOP.ActionsCallBack org.mcopenplatform.muoapi.ConstantsMCOP.ActionsCallBack (Types of actions that each of the callback events can have) |
37 | 37 |
* @param actionList Intent list. Each component in the list contains an event. |
38 |
- */ |
|
38 |
+ */ |
|
39 | 39 |
void handleOnEvent(in List<Intent> actionList); |
40 |
+ |
|
41 |
+ |
|
40 | 42 |
} |
41 | 43 |
\ No newline at end of file |
... | ... |
@@ -1,23 +1,18 @@ |
1 | 1 |
/* |
2 |
- * Copyright (C) 2018 Eduardo Zarate Lasurtegui |
|
3 |
- * Copyright (C) 2018, University of the Basque Country (UPV/EHU) |
|
4 |
- * |
|
5 |
- * Contact for licensing options: <licensing-mcpttclient(at)mcopenplatform(dot)com> |
|
6 |
- * |
|
7 |
- * This file is part of MCOP MCPTT Client |
|
8 |
- * |
|
9 |
- * This is free software: you can redistribute it and/or modify it under the terms of |
|
10 |
- * the GNU General Public License as published by the Free Software Foundation, either version 3 |
|
11 |
- * of the License, or (at your option) any later version. |
|
12 |
- * |
|
13 |
- * This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
14 |
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
15 |
- * See the GNU General Public License for more details. |
|
16 |
- * |
|
17 |
- * You should have received a copy of the GNU General Public License along |
|
18 |
- * with this program; if not, write to the Free Software Foundation, Inc., |
|
19 |
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
- */ |
|
2 |
+ Copyright (C) 2019, University of the Basque Country (UPV/EHU) |
|
3 |
+ |
|
4 |
+Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
+you may not use this file except in compliance with the License. |
|
6 |
+You may obtain a copy of the License at |
|
7 |
+ |
|
8 |
+ http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
+ |
|
10 |
+Unless required by applicable law or agreed to in writing, software |
|
11 |
+distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
+See the License for the specific language governing permissions and |
|
14 |
+limitations under the License. |
|
15 |
+*/ |
|
21 | 16 |
package org.mcopenplatform.muoapi; |
22 | 17 |
|
23 | 18 |
import org.mcopenplatform.muoapi.IMCOPCallback; |
... | ... |
@@ -25,7 +20,6 @@ import org.mcopenplatform.muoapi.IMCOPCallback; |
25 | 25 |
/** |
26 | 26 |
* AIDL definition {@link https://developer.android.com/guide/components/aidl.html} |
27 | 27 |
* Used as a callback for MCOP SDK server-client communication, and for MCPTT (Mission Critical Push to Talk) Services. |
28 |
- * @author Eduardo Zarate Lasurtegui |
|
29 | 28 |
* @version 0.1 |
30 | 29 |
*/ |
31 | 30 |
interface IMCOPsdk { |
... | ... |
@@ -37,6 +31,17 @@ interface IMCOPsdk { |
37 | 37 |
String getMCOPCapabilities(); |
38 | 38 |
|
39 | 39 |
|
40 |
+ |
|
41 |
+ /** |
|
42 |
+ * This method starts the MCPTT System Login procedure. |
|
43 |
+ * No input parameters. |
|
44 |
+ * In case of re-execution it restarts the login procedure. |
|
45 |
+ * |
|
46 |
+ * @return Indicates if the Login procedure can be started. |
|
47 |
+ * @see org.mcopenplatform.muoapi.ConstantsMCOP.AuthorizationRequestExtras org.mcopenplatform.muoapi.ConstantsMCOP.AuthorizationRequestExtras (Definition of all the asynchronous response values of this method) |
|
48 |
+ * @see org.mcopenplatform.muoapi.ConstantsMCOP.AuthorizationRequestExtras org.mcopenplatform.muoapi.ConstantsMCOP.LoginEventExtras (Definition of all the asynchronous response values of this method and the errors) |
|
49 |
+ * |
|
50 |
+ */ |
|
40 | 51 |
boolean loginMCOP(); |
41 | 52 |
|
42 | 53 |
/** |
... | ... |
@@ -159,4 +164,3 @@ interface IMCOPsdk { |
159 | 159 |
*/ |
160 | 160 |
boolean registerCallback(IMCOPCallback mcopCallBack); |
161 | 161 |
} |
162 |
- |
163 | 162 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,57 @@ |
0 |
+package org.test.client.mcopclient; |
|
1 |
+ |
|
2 |
+import org.test.client.mcopclient.ConstantsMCOP.CallEventExtras.CallTypeEnum; |
|
3 |
+ |
|
4 |
+public class CallEvent{ |
|
5 |
+ public enum CallTypeValidEnum { |
|
6 |
+ NONE(0), |
|
7 |
+ AudioWithoutFloorCtrlPrivate(CallTypeEnum.Audio.getValue() | CallTypeEnum.WithoutFloorCtrl.getValue()| CallTypeEnum.Private.getValue()), |
|
8 |
+ AudioWithFloorCtrlPrivate(CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.Private.getValue()), |
|
9 |
+ AudioWithFloorCtrlPrivateEmergency (CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.Private.getValue()| CallTypeEnum.Emergency.getValue()), |
|
10 |
+ AudioWithFloorCtrlPrearrangedGroupEmergency (CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.PrearrangedGroup.getValue()| CallTypeEnum.Emergency.getValue()), |
|
11 |
+ AudioWithFloorCtrlPrearrangedGroupImminentPeril (CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.PrearrangedGroup.getValue()| CallTypeEnum.ImminentPeril.getValue()), |
|
12 |
+ AudioWithFloorCtrlPrearrangedGroup(CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.PrearrangedGroup.getValue()), |
|
13 |
+ AudioWithFloorCtrlChatGroupEmergency (CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.ChatGroup.getValue()| CallTypeEnum.Emergency.getValue()), |
|
14 |
+ AudioWithFloorCtrlChatGroupImminentPeril (CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.ChatGroup.getValue()| CallTypeEnum.ImminentPeril.getValue()), |
|
15 |
+ AudioWithFloorCtrlChatGroup(CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.ChatGroup.getValue()), |
|
16 |
+ AudioWithFloorCtrlBroadcastpEmergency (CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.Broadcast.getValue()| CallTypeEnum.Emergency.getValue()), |
|
17 |
+ AudioWithFloorCtrlBroadcastImminentPeril (CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.Broadcast.getValue()| CallTypeEnum.ImminentPeril.getValue()), |
|
18 |
+ AudioWithFloorCtrlBroadcast(CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.Broadcast.getValue()), |
|
19 |
+ AudioWithFloorCtrlFirstToAnswer(CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.FirstToAnswer.getValue()), |
|
20 |
+ AudioWithFloorCtrlPrivateCallCallback(CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.PrivateCallCallback.getValue()), |
|
21 |
+ AudioWithFloorCtrlRemoteAmbientListening(CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.RemoteAmbientListening.getValue()), |
|
22 |
+ AudioWithFloorCtrlLocalAmbientListening(CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.LocalAmbientListening.getValue()), |
|
23 |
+ VideoAudioWithFloorCtrlPrivate(CallTypeEnum.Video.getValue() | CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.Private.getValue()), |
|
24 |
+ VideoAudioWithFloorCtrlPrivateEmergency (CallTypeEnum.Video.getValue() |CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.Private.getValue()| CallTypeEnum.Emergency.getValue()), |
|
25 |
+ VideoAudioWithFloorCtrlPrearrangedGroupEmergency (CallTypeEnum.Video.getValue() |CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.PrearrangedGroup.getValue()| CallTypeEnum.Emergency.getValue()), |
|
26 |
+ VideoAudioWithFloorCtrlPrearrangedGroupImminentPeril (CallTypeEnum.Video.getValue() |CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.PrearrangedGroup.getValue()| CallTypeEnum.ImminentPeril.getValue()), |
|
27 |
+ VideoAudioWithFloorCtrlPrearrangedGroup(CallTypeEnum.Video.getValue() |CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.PrearrangedGroup.getValue()), |
|
28 |
+ VideoAudioWithFloorCtrlChatGroupEmergency (CallTypeEnum.Video.getValue() |CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.ChatGroup.getValue()| CallTypeEnum.Emergency.getValue()), |
|
29 |
+ VideoAudioWithFloorCtrlChatGroupImminentPeril (CallTypeEnum.Video.getValue() |CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.ChatGroup.getValue()| CallTypeEnum.ImminentPeril.getValue()), |
|
30 |
+ VideoAudioWithFloorCtrlChatGroup(CallTypeEnum.Video.getValue() |CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.ChatGroup.getValue()), |
|
31 |
+ VideoAudioWithFloorCtrlBroadcastpEmergency (CallTypeEnum.Video.getValue() |CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.Broadcast.getValue()| CallTypeEnum.Emergency.getValue()), |
|
32 |
+ VideoAudioWithFloorCtrlBroadcastImminentPeril (CallTypeEnum.Video.getValue() |CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.Broadcast.getValue()| CallTypeEnum.ImminentPeril.getValue()), |
|
33 |
+ VideoAudioWithFloorCtrlBroadcast(CallTypeEnum.Video.getValue() |CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.Broadcast.getValue()), |
|
34 |
+ VideoAudioWithFloorCtrlFirstToAnswer(CallTypeEnum.Video.getValue() |CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.FirstToAnswer.getValue()), |
|
35 |
+ VideoAudioWithFloorCtrlPrivateCallCallback(CallTypeEnum.Video.getValue() |CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.PrivateCallCallback.getValue()), |
|
36 |
+ VideoAudioWithFloorCtrlRemoteAmbientListening(CallTypeEnum.Video.getValue() |CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.RemoteAmbientListening.getValue()), |
|
37 |
+ VideoAudioWithFloorCtrlLocalAmbientListening(CallTypeEnum.Video.getValue() | CallTypeEnum.Audio.getValue() | CallTypeEnum.WithFloorCtrl.getValue()| CallTypeEnum.LocalAmbientListening.getValue()); |
|
38 |
+ private int code; |
|
39 |
+ CallTypeValidEnum(int code) { |
|
40 |
+ this.code = code; |
|
41 |
+ } |
|
42 |
+ public int getValue() { |
|
43 |
+ return code; |
|
44 |
+ } |
|
45 |
+ } |
|
46 |
+ |
|
47 |
+ public static CallEvent.CallTypeValidEnum validationCallType(int type){ |
|
48 |
+ if(type<=0)return null; |
|
49 |
+ for(CallEvent.CallTypeValidEnum data:CallEvent.CallTypeValidEnum.values()){ |
|
50 |
+ if(data.getValue()==type) { |
|
51 |
+ return data; |
|
52 |
+ } |
|
53 |
+ } |
|
54 |
+ return null; |
|
55 |
+ } |
|
56 |
+} |
|
0 | 57 |
\ No newline at end of file |
... | ... |
@@ -1,24 +1,18 @@ |
1 | 1 |
/* |
2 |
- * |
|
3 |
- * Copyright (C) 2018 Eduardo Zarate Lasurtegui |
|
4 |
- * Copyright (C) 2018, University of the Basque Country (UPV/EHU) |
|
5 |
- * |
|
6 |
- * Contact for licensing options: <licensing-mcpttclient(at)mcopenplatform(dot)com> |
|
7 |
- * |
|
8 |
- * This file is part of MCOP MCPTT Client |
|
9 |
- * |
|
10 |
- * This is free software: you can redistribute it and/or modify it under the terms of |
|
11 |
- * the GNU General Public License as published by the Free Software Foundation, either version 3 |
|
12 |
- * of the License, or (at your option) any later version. |
|
13 |
- * |
|
14 |
- * This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
15 |
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
16 |
- * See the GNU General Public License for more details. |
|
17 |
- * |
|
18 |
- * You should have received a copy of the GNU General Public License along |
|
19 |
- * with this program; if not, write to the Free Software Foundation, Inc., |
|
20 |
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
21 |
- */ |
|
2 |
+ Copyright (C) 2019, University of the Basque Country (UPV/EHU) |
|
3 |
+ |
|
4 |
+Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
+you may not use this file except in compliance with the License. |
|
6 |
+You may obtain a copy of the License at |
|
7 |
+ |
|
8 |
+ http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
+ |
|
10 |
+Unless required by applicable law or agreed to in writing, software |
|
11 |
+distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
+See the License for the specific language governing permissions and |
|
14 |
+limitations under the License. |
|
15 |
+*/ |
|
22 | 16 |
|
23 | 17 |
package org.test.client.mcopclient; |
24 | 18 |
|
... | ... |
@@ -31,7 +25,6 @@ import java.util.Map; |
31 | 31 |
/** |
32 | 32 |
* MCOP MCPTT SDK |
33 | 33 |
* Constants used on AIDLs |
34 |
- * @author Eduardo Zarate Lasurtegui |
|
35 | 34 |
* @version 0.1 |
36 | 35 |
*/ |
37 | 36 |
public class ConstantsMCOP { |
... | ... |
@@ -41,20 +34,34 @@ public class ConstantsMCOP { |
41 | 41 |
|
42 | 42 |
|
43 | 43 |
/** |
44 |
+ * Key Access to the values of the packet names of Iapi plugins |
|
45 |
+ * <p>This values are passed as Strings in SDK binding intent</p> |
|
46 |
+ */ |
|
47 |
+ public static final String CONNECTIVITY_PLUGIN_PACKAGE_ID = "org.mcopenplatform.muoapi.ConstantsMCOP"+".CONNECTIVITY_PLUGIN_PACKAGE_ID"; |
|
48 |
+ public static final String CONNECTIVITY_PLUGIN_SERVICE_ID = "org.mcopenplatform.muoapi.ConstantsMCOP"+".CONNECTIVITY_PLUGIN_SERVICE_ID"; |
|
49 |
+ public static final String SIM_PLUGIN_PACKAGE_ID = "org.mcopenplatform.muoapi.ConstantsMCOP"+".SIM_PLUGIN_PACKAGE_ID"; |
|
50 |
+ public static final String SIM_PLUGIN_SERVICE_ID = "org.mcopenplatform.muoapi.ConstantsMCOP"+".SIM_PLUGIN_SERVICE_ID"; |
|
51 |
+ public static final String CONFIGURATION_PLUGIN_PACKAGE_ID = "org.mcopenplatform.muoapi.ConstantsMCOP"+".CONFIGURATION_PLUGIN_PACKAGE_ID"; |
|
52 |
+ public static final String CONFIGURATION_PLUGIN_SERVICE_ID = "org.mcopenplatform.muoapi.ConstantsMCOP"+".CONFIGURATION_PLUGIN_SERVICE_ID"; |
|
53 |
+ public static final String MBMS_PLUGIN_PACKAGE_ID = "org.mcopenplatform.muoapi.ConstantsMCOP"+".MBMS_PLUGIN_PACKAGE_ID"; |
|
54 |
+ public static final String MBMS_PLUGIN_SERVICE_ID = "org.mcopenplatform.muoapi.ConstantsMCOP"+".MBMS_PLUGIN_SERVICE_ID"; |
|
55 |
+ |
|
56 |
+ |
|
57 |
+ /** |
|
44 | 58 |
* |
45 |
- * Access keys to the values of event types {@link org.mcopenplatform.muoapi.ConstantsMCOP.ActionsCallBack#unLoginEvent} |
|
46 |
- * <p>This class contains all the answers to the actions of methods {@link IMCOPsdk#unLoginMCOP()} </p> |
|
59 |
+ * Key Access to the values of event types {@link ConstantsMCOP.ActionsCallBack#unLoginEvent} |
|
60 |
+ * <p>This class contains all the answers to the actions of methods {@link org.mcopenplatform.muoapi.IMCOPsdk#unLoginMCOP()} </p> |
|
47 | 61 |
* |
48 | 62 |
*/ |
49 | 63 |
public static class UnLoginEventExtras{ |
50 | 64 |
/** |
51 |
- * <h2>Access key to the response to method {@link IMCOPsdk#unLoginMCOP()}}:</h2> |
|
65 |
+ * <h2>Key Access to the response to method {@link org.mcopenplatform.muoapi.IMCOPsdk#unLoginMCOP()}}:</h2> |
|
52 | 66 |
* <p>Response: boolean, indicates whether the unlogin procedure was successful or not.</p> |
53 | 67 |
*/ |
54 | 68 |
public static final String SUCCESS="org.mcopenplatform.muoapi.ConstantsMCOP.UnLoginEventExtras"+".SUCCESS"; |
55 | 69 |
|
56 | 70 |
/** |
57 |
- * <h2>Access key to the error codes of the login and authentication methods.</h2> |
|
71 |
+ * <h2>Key Access to the error codes of the login and authentication methods.</h2> |
|
58 | 72 |
* <p>Response: Integer indicating the error code.</p> |
59 | 73 |
* <p>Values:</p> |
60 | 74 |
* <p> 205 It is not possible to unregister because the customer is not registered right now</p> |
... | ... |
@@ -64,36 +71,36 @@ public class ConstantsMCOP { |
64 | 64 |
*/ |
65 | 65 |
public static final String ERROR_CODE="org.mcopenplatform.muoapi.ConstantsMCOP.UnLoginEventExtras"+".ERROR_CODE"; |
66 | 66 |
/** |
67 |
- * <h2>Access key to error string for the login and authentication methods.</h2> |
|
68 |
- * <p>Resputa: String describing the error.</p> |
|
67 |
+ * <h2>Key Access to error string for the login and authentication methods.</h2> |
|
68 |
+ * <p>Response: String describing the error.</p> |
|
69 | 69 |
*/ |
70 | 70 |
public static final String ERROR_STRING="org.mcopenplatform.muoapi.ConstantsMCOP.UnLoginEventExtras"+".ERROR_STRING"; |
71 | 71 |
} |
72 | 72 |
|
73 | 73 |
/** |
74 | 74 |
* |
75 |
- * Access keys to the values of event types {@link org.mcopenplatform.muoapi.ConstantsMCOP.ActionsCallBack#loginEvent} |
|
76 |
- * <p>This class contains all the answers to the actions of methods {@link IMCOPsdk#loginMCOP()} and {@link IMCOPsdk#authorizeUser(String)} ()}</p> |
|
75 |
+ * Key Access to the values of event types {@link ConstantsMCOP.ActionsCallBack#loginEvent} |
|
76 |
+ * <p>This class contains all the answers to the actions of methods {@link org.mcopenplatform.muoapi.IMCOPsdk#loginMCOP()} and {@link org.mcopenplatform.muoapi.IMCOPsdk#authorizeUser(String)} ()}</p> |
|
77 | 77 |
* |
78 | 78 |
*/ |
79 | 79 |
public static class LoginEventExtras{ |
80 | 80 |
/** |
81 |
- * <h2>Access key to the response to method {@link IMCOPsdk#authorizeUser(String)}:</h2> |
|
81 |
+ * <h2>Key Access to the response to method {@link org.mcopenplatform.muoapi.IMCOPsdk#authorizeUser(String)}:</h2> |
|
82 | 82 |
* <p>Response: boolean, indicates whether the login procedure was successful or not.</p> |
83 | 83 |
*/ |
84 | 84 |
public static final String SUCCESS="org.mcopenplatform.muoapi.ConstantsMCOP.LoginEventExtras"+".SUCCESS"; |
85 | 85 |
/** |
86 |
- * <h2>Access key to the MCPTT ID of the client once authenticated.</h2> |
|
86 |
+ * <h2>Key Access to the MCPTT ID of the client once authenticated.</h2> |
|
87 | 87 |
* <p>Response: String with URI format that unequivocally identifies the user in the MCPTT system.</p> |
88 | 88 |
*/ |
89 | 89 |
public static final String MCPTT_ID="org.mcopenplatform.muoapi.ConstantsMCOP.LoginEventExtras"+".MCPTT_ID"; |
90 | 90 |
/** |
91 |
- * <h2>Access key to the DISPLAY NAME of the client once authenticated.</h2> |
|
91 |
+ * <h2>Key Access to the DISPLAY NAME of the client once authenticated.</h2> |
|
92 | 92 |
* <p>Response: String that identifies the user with a human-readable alias, more pleasant than a MCPTT identifier.</p> |
93 | 93 |
*/ |
94 | 94 |
public static final String DISPLAY_NAME="org.mcopenplatform.muoapi.ConstantsMCOP.LoginEventExtras"+".DISPLAY_NAME"; |
95 | 95 |
/** |
96 |
- * <h2>Access key to the error codes of the login and authentication methods.</h2> |
|
96 |
+ * <h2>Key Access to the error codes of the login and authentication methods.</h2> |
|
97 | 97 |
* <p>Response: Integer indicating the error code.</p> |
98 | 98 |
* <p>Values:</p> |
99 | 99 |
* <p>0 means no errors.</p> |
... | ... |
@@ -118,7 +125,7 @@ public class ConstantsMCOP { |
118 | 118 |
*/ |
119 | 119 |
public static final String ERROR_CODE="org.mcopenplatform.muoapi.ConstantsMCOP.LoginEventExtras"+".ERROR_CODE"; |
120 | 120 |
/** |
121 |
- * <h2>Access key to error string for the login and authentication methods.</h2> |
|
121 |
+ * <h2>Key Access to error string for the login and authentication methods.</h2> |
|
122 | 122 |
* <p>Resputa: String describing the error.</p> |
123 | 123 |
*/ |
124 | 124 |
public static final String ERROR_STRING="org.mcopenplatform.muoapi.ConstantsMCOP.LoginEventExtras"+".ERROR_STRING"; |
... | ... |
@@ -127,25 +134,25 @@ public class ConstantsMCOP { |
127 | 127 |
/** |
128 | 128 |
* |
129 | 129 |
* <h1>Keys to access the values of authentication events by methods:</h1> |
130 |
- * <h2> {@link IMCOPsdk#loginMCOP()}</h2> |
|
131 |
- * <h2> {@link IMCOPsdk#authorizeUser(String)}</h2> |
|
130 |
+ * <h2> {@link org.mcopenplatform.muoapi.IMCOPsdk#loginMCOP()}</h2> |
|
131 |
+ * <h2> {@link org.mcopenplatform.muoapi.IMCOPsdk#authorizeUser(String)}</h2> |
|
132 | 132 |
*/ |
133 | 133 |
public static class AuthorizationRequestExtras{ |
134 | 134 |
/** |
135 |
- * <h2>Access key to the uri to request the user authentication to a third party.</h2> |
|
136 |
- * <p>This data is received once the call to the method {@link IMCOPsdk#loginMCOP()} is made.</p> |
|
135 |
+ * <h2>Key Access to the uri to request the user authentication to a third party.</h2> |
|
136 |
+ * <p>This data is received once the call to the method {@link org.mcopenplatform.muoapi.IMCOPsdk#loginMCOP()} is made.</p> |
|
137 | 137 |
* <p>Response: URI format string</p> |
138 | 138 |
*/ |
139 | 139 |
public static final String REQUEST_URI="org.mcopenplatform.muoapi.ConstantsMCOP.AuthorizationRequestActions"+".REQUEST_URI"; |
140 | 140 |
/** |
141 |
- * <h2>Access key to the uri answered by the third party authentication agent.</h2> |
|
142 |
- * <h3>Indicates when the third party authentication ends, and the method {@link IMCOPsdk#authorizeUser(String)} can be called with the authentication response.</h3> |
|
143 |
- * <p>This data is received once the call to the method {@link IMCOPsdk#loginMCOP()} is made.</p> |
|
141 |
+ * <h2>Key Access to the uri answered by the third party authentication agent.</h2> |
|
142 |
+ * <h3>Indicates when the third party authentication ends, and the method {@link org.mcopenplatform.muoapi.IMCOPsdk#authorizeUser(String)} can be called with the authentication response.</h3> |
|
143 |
+ * <p>This data is received once the call to the method {@link org.mcopenplatform.muoapi.IMCOPsdk#loginMCOP()} is made.</p> |
|
144 | 144 |
* <p>Response: URI format string</p> |
145 | 145 |
*/ |
146 | 146 |
public static final String REDIRECT_URI="org.mcopenplatform.muoapi.ConstantsMCOP.AuthorizationRequestActions"+".REDIRECT_URI"; |
147 | 147 |
/** |
148 |
- * <h2>Access key to authentication error codes.</h2> |
|
148 |
+ * <h2>Key Access to authentication error codes.</h2> |
|
149 | 149 |
* <p>Response: Integer indicating the error code.</p> |
150 | 150 |
* <p>Values:</p> |
151 | 151 |
* <p></p> |
... | ... |
@@ -153,7 +160,7 @@ public class ConstantsMCOP { |
153 | 153 |
*/ |
154 | 154 |
public static final String ERROR_CODE="org.mcopenplatform.muoapi.ConstantsMCOP.AuthorizationRequestActions"+".ERROR_CODE"; |
155 | 155 |
/** |
156 |
- * <h2>Access key to error codes string.</h2> |
|
156 |
+ * <h2>Key Access to error codes string.</h2> |
|
157 | 157 |
*/ |
158 | 158 |
public static final String ERROR_STRING="org.mcopenplatform.muoapi.ConstantsMCOP.AuthorizationRequestActions"+".ERROR_STRING"; |
159 | 159 |
} |
... | ... |
@@ -161,34 +168,34 @@ public class ConstantsMCOP { |
161 | 161 |
|
162 | 162 |
/** |
163 | 163 |
* |
164 |
- * <h1>Access key to the values of all the configuration events of all the MCPTT services.</h1> |
|
164 |
+ * <h1>Key Access to the values of all the configuration events of all the MCPTT services.</h1> |
|
165 | 165 |
* |
166 | 166 |
*/ |
167 | 167 |
public static class ConfigurationUpdateEventExtras{ |
168 | 168 |
|
169 | 169 |
/** |
170 |
- * <h2>Access key to the organization that the user belongs to.</h2> |
|
170 |
+ * <h2>Key Access to the organization that the user belongs to.</h2> |
|
171 | 171 |
* <p>This data will be received once logged into the system.</p> |
172 | 172 |
* <p>Response: String.</p> |
173 | 173 |
*/ |
174 | 174 |
public static final String ORGANIZATION="org.mcopenplatform.muoapi.ConstantsMCOP.LoginSuccessExtras"+".ORGANIZATION"; |
175 | 175 |
|
176 | 176 |
/** |
177 |
- * <h2>Access key to default emergency contact identifier that must be called in case of an emergency call with no destination specified.</h2> |
|
178 |
- * <p>This data will be received once logged in and each time the system changes the value or the user manually changes it with the method {@link IMCOPsdk#changeSelectedContact}</p> |
|
177 |
+ * <h2>Key Access to default emergency contact identifier that must be called in case of an emergency call with no destination specified.</h2> |
|
178 |
+ * <p>This data will be received once logged in and each time the system changes the value or the user manually changes it with the method {@link org.mcopenplatform.muoapi.IMCOPsdk#changeSelectedContact}</p> |
|
179 | 179 |
* <p>Response: String with UserID format</p> |
180 | 180 |
*/ |
181 | 181 |
public static final String DEFAULT_EMERGERCY_CONTACT="org.mcopenplatform.muoapi.ConstantsMCOP.LoginSuccessExtras"+".DEFAULT_EMERGERCY_CONTACT"; |
182 | 182 |
|
183 | 183 |
/** |
184 |
- * <h2>Access key to ParticipantType, indicating the position of the user in the organization. Not defined in the 3GPP.</h2> |
|
184 |
+ * <h2>Key Access to ParticipantType, indicating the position of the user in the organization. Not defined in the 3GPP.</h2> |
|
185 | 185 |
* <p>This data will be received once logged into the system or whenever the user receives a new configuration.</p> |
186 | 186 |
* <p>Response: String.</p> |
187 | 187 |
*/ |
188 | 188 |
public static final String PARTICIPANT_TYPE="org.mcopenplatform.muoapi.ConstantsMCOP.LoginSuccessExtras"+".PARTICIPANT_TYPE"; |
189 | 189 |
|
190 | 190 |
/** |
191 |
- * <h2>Access key to the list of user granted permissions.</h2> |
|
191 |
+ * <h2>Key Access to the list of user granted permissions.</h2> |
|
192 | 192 |
* <p>This data will be received once logged into the system or whenever the user receives a new configuration.</p> |
193 | 193 |
* <p>Response: Integer with values of all the FLAGs that identify user allowed services</p> |
194 | 194 |
* <p>Values: Sum of {@link AllowTypeEnum}</p> |
... | ... |
@@ -204,7 +211,26 @@ public class ConstantsMCOP { |
204 | 204 |
|
205 | 205 |
|
206 | 206 |
/** |
207 |
- * <h2>Access key to configuration error codes.</h2> |
|
207 |
+ * <h2>Access Key to the Private contacts available for the user</h2> |
|
208 |
+ * * <p>This data will be received once logged into the system or whenever the user receives a new configuration.</p> |
|
209 |
+ * <p>Response: Array of strings with Sips URI of the available contacts</p> |
|
210 |
+ * <p>Values: List<String> </p> |
|
211 |
+ */ |
|
212 |
+ |
|
213 |
+ public static final String PRIVATE_CONTACT_LIST="org.mcopenplatform.muoapi.ConstantsMCOP.ConfigurationUpdateEventExtras"+".PRIVATE_CONTACT_LIST"; |
|
214 |
+ |
|
215 |
+ /** |
|
216 |
+ * <h2>Access Key to the display name of private contacts available for the user</h2> |
|
217 |
+ * * <p>This data will be received once logged into the system or whenever the user receives a new configuration.</p> |
|
218 |
+ * <p>Response: Array of strings with the display name of the available contacts</p> |
|
219 |
+ * <p>Values: List<String> </p> |
|
220 |
+ */ |
|
221 |
+ |
|
222 |
+ public static final String PRIVATE_CONTACT_DISPLAY_NAME_LIST="org.mcopenplatform.muoapi.ConstantsMCOP.ConfigurationUpdateEventExtras"+".PRIVATE_CONTACT_DISPLAY_NAME_LIST"; |
|
223 |
+ |
|
224 |
+ |
|
225 |
+ /** |
|
226 |
+ * <h2>Key Access to configuration error codes.</h2> |
|
208 | 227 |
* <p>Response: Integer indicating the error code.</p> |
209 | 228 |
* <p>Values:</p> |
210 | 229 |
*<p>Code Explanatory text Description</p> |
... | ... |
@@ -213,7 +239,7 @@ public class ConstantsMCOP { |
213 | 213 |
*/ |
214 | 214 |
public static final String ERROR_CODE="org.mcopenplatform.muoapi.ConstantsMCOP.ConfigurationUpdateEventExtras"+".ERROR_CODE"; |
215 | 215 |
/** |
216 |
- * <h2>Access key to the string of error codes</h2> |
|
216 |
+ * <h2>Key Access to the string of error codes</h2> |
|
217 | 217 |
*/ |
218 | 218 |
public static final String ERROR_STRING="org.mcopenplatform.muoapi.ConstantsMCOP.ConfigurationUpdateEventExtras"+".ERROR_STRING"; |
219 | 219 |
|
... | ... |
@@ -263,46 +289,54 @@ public class ConstantsMCOP { |
263 | 263 |
|
264 | 264 |
/** |
265 | 265 |
* |
266 |
- * Access keys to the values of type {@link org.mcopenplatform.muoapi.ConstantsMCOP.ActionsCallBack#callEvent} events. |
|
266 |
+ * Key Access to the values of type {@link ConstantsMCOP.ActionsCallBack#callEvent} events. |
|
267 | 267 |
* |
268 | 268 |
*/ |
269 | 269 |
public static class CallEventExtras{ |
270 | 270 |
|
271 | 271 |
/** |
272 |
- * <h2>Access key to event type:</h2> |
|
272 |
+ * <h2>Key Access to event type:</h2> |
|
273 | 273 |
* <p>Integer type values</p> |
274 | 274 |
* <p>Possible event types:</p> |
275 |
- * <p> INCOMING (Incoming call of any MCPTT type) {@link org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#INCOMING}</p> |
|
276 |
- * <p> RINGING (Destination of the call is ringing) {@link org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#RINGING}</p> |
|
277 |
- * <p> INPROGRESS (MCPTT call in progress) {@link org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#INPROGRESS}</p> |
|
278 |
- * <p> CONNECTED (Established call) {@link org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#CONNECTED}</p> |
|
279 |
- * <p> ERROR (Any error in MCPTT calls) {@link org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#ERROR}</p> |
|
280 |
- * <p> UPDATE (Any Change in Call) {@link org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#UPDATE}</p> |
|
275 |
+ * <p> INCOMING (Incoming call of any MCPTT type) {@link ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#INCOMING}</p> |
|
276 |
+ * <p> RINGING (Destination of the call is ringing) {@link ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#RINGING}</p> |
|
277 |
+ * <p> INPROGRESS (MCPTT call in progress) {@link ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#INPROGRESS}</p> |
|
278 |
+ * <p> CONNECTED (Established call) {@link ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#CONNECTED}</p> |
|
279 |
+ * <p> ERROR (Any error in MCPTT calls) {@link ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#ERROR}</p> |
|
280 |
+ * <p> UPDATE (Any Change in Call) {@link ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#UPDATE}</p> |
|
281 | 281 |
*/ |
282 | 282 |
public static final String EVENT_TYPE="org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras"+".EVENT_TYPE"; |
283 | 283 |
|
284 | 284 |
|
285 | 285 |
/** |
286 |
- * <h2>Access key to MCPTT call session ID. This identifier is unique for each call.</h2> |
|
287 |
- * <p>Present in all types of events {@link org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum}</p> |
|
286 |
+ * <h2>Key Access to MCPTT call session ID. This identifier is unique for each call.</h2> |
|
287 |
+ * <p>Present in all types of events {@link ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum}</p> |
|
288 | 288 |
*/ |
289 | 289 |
public static final String SESSION_ID="org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras"+".SESSION_ID"; |
290 | 290 |
|
291 | 291 |
/** |
292 |
- * <h2>Access key to MCPTT call type.</h2> |
|
293 |
- * <p>Present in event type {@link org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#INCOMING} and {@link org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#UPDATE}</p> |
|
292 |
+ * <h2>Key Access to MCPTT call type.</h2> |
|
293 |
+ * <p>Present in event type {@link ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#INCOMING} and {@link ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#UPDATE}</p> |
|
294 | 294 |
*/ |
295 | 295 |
public static final String CALL_TYPE="org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras"+".CALL_TYPE"; |
296 | 296 |
|
297 | 297 |
|
298 | 298 |
/** |
299 |
- * Access key to the caller UserID |
|
300 |
- * Present in event type {@link org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#INCOMING} |
|
299 |
+ * Key Access to the caller UserID |
|
300 |
+ * Present in event type {@link ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#INCOMING} |
|
301 | 301 |
*/ |
302 | 302 |
public static final String CALLER_USERID="org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras"+".CALLER_USERID"; |
303 | 303 |
|
304 |
+ |
|
305 |
+ /** |
|
306 |
+ * Key Access to the caller GroupID |
|
307 |
+ * Present in event type {@link ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#INCOMING} |
|
308 |
+ */ |
|
309 |
+ public static final String CALLER_GROUPID="org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras"+".CALLER_GROUPID"; |
|
310 |
+ |
|
311 |
+ |
|
304 | 312 |
/** |
305 |
- *<p> Access key to Error Codes</p> |
|
313 |
+ *<p> Key Access to Error Codes</p> |
|
306 | 314 |
*<p> All error codes are integers:</p> |
307 | 315 |
*<p>Code Explanatory text Description</p> |
308 | 316 |
*<p>103 maximum simultaneous MCPTT group calls reached The number of maximum simultaneous MCPTT group calls supported for the MCPTT user has been exceeded.</p> |
... | ... |
@@ -348,7 +382,7 @@ public class ConstantsMCOP { |
348 | 348 |
*/ |
349 | 349 |
public static final String ERROR_CODE="org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras"+".ERROR_CODE"; |
350 | 350 |
/** |
351 |
- * Access key to Error Codes string. |
|
351 |
+ * Key Access to Error Codes string. |
|
352 | 352 |
*/ |
353 | 353 |
public static final String ERROR_STRING="org.mcopenplatform.muoapi.ConstantsMCOP.CallEventExtras"+".ERROR_STRING"; |
354 | 354 |
|
... | ... |
@@ -374,7 +408,6 @@ public class ConstantsMCOP { |
374 | 374 |
return code; |
375 | 375 |
} |
376 | 376 |
|
377 |
- |
|
378 | 377 |
private static Map map = new HashMap<>(); |
379 | 378 |
|
380 | 379 |
|
... | ... |
@@ -390,7 +423,7 @@ public class ConstantsMCOP { |
390 | 390 |
|
391 | 391 |
} |
392 | 392 |
/** |
393 |
- * <h2>Individual call types than can be combined and used in {@link IMCOPsdk#makeCall(String, int)} or received in type {@link ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#INCOMING} events</h2> |
|
393 |
+ * <h2>Individual call types than can be combined and used in {@link org.mcopenplatform.muoapi.IMCOPsdk#makeCall(String, int)} or received in type {@link ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum#INCOMING} events</h2> |
|
394 | 394 |
*/ |
395 | 395 |
public enum CallTypeEnum { |
396 | 396 |
|
... | ... |
@@ -468,84 +501,86 @@ public class ConstantsMCOP { |
468 | 468 |
|
469 | 469 |
/** |
470 | 470 |
* |
471 |
- * <h1>Access keys to the values of the floor control events in any MCPTT session.</h1> |
|
471 |
+ * <h1>Key Access to the values of the floor control events in any MCPTT session.</h1> |
|
472 | 472 |
* |
473 | 473 |
*/ |
474 | 474 |
public static class FloorControlEventExtras{ |
475 | 475 |
|
476 | 476 |
/** |
477 |
- * <h2>Access key to the list of floor control events.</h2> |
|
477 |
+ * <h2>Key Access to the list of floor control events.</h2> |
|
478 | 478 |
* <p>This event is received every time an action is generated on any floor control of any MCPTT session.</p> |
479 | 479 |
* <p>Response: String</p> |
480 | 480 |
* <p>Values: |
481 |
- * <p> granted (Session control granted) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#granted}</p> |
|
482 |
- * <p> idle (Nobody has control of the session) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#idle}</p> |
|
483 |
- * <p> taken (Other session participant has control) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#taken}</p> |
|
484 |
- * <p> request_sent (Session control request sent) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#request_sent}</p> |
|
485 |
- * <p> release_sent (Session control release sent) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#idle}</p> |
|
486 |
- * <p> denied (Session control denied) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#denied}</p> |
|
487 |
- * <p> revoked (Session control revoked) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#revoked}</p> |
|
488 |
- * <p> queued (Session control request queued) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#queued}</p> |
|
489 |
- * <p> queued_timeout (Queued request timed out) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#queued_timeout}</p> |
|
490 |
- * <p> transmission_granted (Transmission granted) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_granted}</p> |
|
491 |
- * <p> reception_granted (Reception granted) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_granted}</p> |
|
492 |
- * <p> transmission_rejection (Transmission rejected) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_rejection}</p> |
|
493 |
- * <p> reception_rejection (Reception rejected) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_rejection}</p> |
|
494 |
- * <p> transmission_revoke (Transmission revoked) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_revoke}</p> |
|
495 |
- * <p> reception_revoke (Reception revoked) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_revoke}</p> |
|
496 |
- * <p> transmission_notification (Transmission notification) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_notification}</p> |
|
497 |
- * <p> transmission_end_notification (Transmission notification end) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_end_notification}</p> |
|
498 |
- * <p> transmission_end_response (Transmission end response) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_end_response}</p> |
|
499 |
- * <p> reception_end_response (Reception end response) {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_end_response}</p> |
|
481 |
+ * <p> granted (Session control granted) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#granted}</p> |
|
482 |
+ * <p> idle (Nobody has control of the session) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#idle}</p> |
|
483 |
+ * <p> taken (Other session participant has control) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#taken}</p> |
|
484 |
+ * <p> request_sent (Session control request sent) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#request_sent}</p> |
|
485 |
+ * <p> release_sent (Session control release sent) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#idle}</p> |
|
486 |
+ * <p> denied (Session control denied) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#denied}</p> |
|
487 |
+ * <p> revoked (Session control revoked) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#revoked}</p> |
|
488 |
+ * <p> queued (Session control request queued) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#queued}</p> |
|
489 |
+ * <p> queued_timeout (Queued request timed out) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#queued_timeout}</p> |
|
490 |
+ * <p> transmission_granted (Transmission granted) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_granted}</p> |
|
491 |
+ * <p> reception_granted (Reception granted) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_granted}</p> |
|
492 |
+ * <p> transmission_rejection (Transmission rejected) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_rejection}</p> |
|
493 |
+ * <p> reception_rejection (Reception rejected) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_rejection}</p> |
|
494 |
+ * <p> transmission_revoke (Transmission revoked) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_revoke}</p> |
|
495 |
+ * <p> reception_revoke (Reception revoked) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_revoke}</p> |
|
496 |
+ * <p> transmission_notification (Transmission notification) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_notification}</p> |
|
497 |
+ * <p> transmission_end_notification (Transmission notification end) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_end_notification}</p> |
|
498 |
+ * <p> transmission_end_response (Transmission end response) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_end_response}</p> |
|
499 |
+ * <p> reception_end_response (Reception end response) {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_end_response}</p> |
|
500 | 500 |
*/ |
501 | 501 |
public static final String FLOOR_CONTROL_EVENT="org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras"+".FLOOR_CONTROL_EVENT"; |
502 | 502 |
|
503 | 503 |
|
504 | 504 |
/** |
505 |
- * <h2>Access key to DISPLAY NAME of the client linked to one of the events in {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum}</h2> |
|
506 |
- * <p>It is usually used with the event {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#taken} to know who is talking at each moment.</p> |
|
505 |
+ * <h2>Key Access to DISPLAY NAME of the client linked to one of the events in {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum}</h2> |
|
506 |
+ * <p>It is usually used with the event {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#taken} to know who is talking at each moment.</p> |
|
507 | 507 |
* <p>Response: String that identifies the user with a human-readable alias, more pleasant than a MCPTT identifier.</p> |
508 | 508 |
*/ |
509 | 509 |
public static final String DISPLAY_NAME="org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras"+".DISPLAY_NAME"; |
510 | 510 |
|
511 | 511 |
/** |
512 |
- * <h2>Access key to DURATION TOKEN of Number of seconds that a client can speak {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum}</h2> |
|
513 |
- * <p>It is usually used with the event {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#granted} to know who is talking at each moment.</p> |
|
512 |
+ * <h2>Key Access to DURATION TOKEN of Number of seconds that a client can speak {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum}</h2> |
|
513 |
+ * <p>It is usually used with the event {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#granted} to know who is talking at each moment.</p> |
|
514 | 514 |
* <p>Response: Number of seconds that a client can speak.</p> |
515 | 515 |
*/ |
516 | 516 |
public static final String DURATION_TOKEN="org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras"+".DURATION_TOKEN"; |
517 | 517 |
|
518 | 518 |
/** |
519 |
- * <h2>Access key to User ID that univocally distinguishes the MCPTT user causing the event {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum}</h2> |
|
519 |
+ * <h2>Key Access to User ID that univocally distinguishes the MCPTT user causing the event {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum}</h2> |
|
520 | 520 |
* <p>Usually used with events:</p> |
521 |
- * <p> {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#taken} to know who is talking at each moment.</p> |
|
522 |
- * <p> {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_granted}</p> |
|
523 |
- * <p> {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_end_response}</p> |
|
524 |
- * <p> {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_end_response}</p> |
|
521 |
+ * <p> {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#taken} to know who is talking at each moment.</p> |
|
522 |
+ * <p> {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_granted}</p> |
|
523 |
+ * <p> {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_end_response}</p> |
|
524 |
+ * <p> {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_end_response}</p> |
|
525 | 525 |
* <p>Response: String with URI format that identifies the MCPTT user.</p> |
526 | 526 |
*/ |
527 | 527 |
public static final String USER_ID="org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras"+".USER_ID"; |
528 | 528 |
|
529 | 529 |
|
530 |
+ |
|
531 |
+ |
|
530 | 532 |
/** |
531 |
- * <h2>Access key to ALLOW REQUEST that indicates whether a call can be made to {@link org.mcopenplatform.muoapi.IMCOPsdk#floorControlOperation(String, int, String)} to request the token despite being in a {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#taken} state</h2> |
|
532 |
- * <p>This data will be obtained every time a {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#taken} event is received.</p> |
|
533 |
+ * <h2>Key Access to ALLOW REQUEST that indicates whether a call can be made to {@link org.mcopenplatform.muoapi.IMCOPsdk#floorControlOperation(String, int, String)} to request the token despite being in a {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#taken} state</h2> |
|
534 |
+ * <p>This data will be obtained every time a {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#taken} event is received.</p> |
|
533 | 535 |
* <p>Response: boolean</p> |
534 | 536 |
*/ |
535 | 537 |
public static final String ALLOW_REQUEST="org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras"+".ALLOW_REQUEST"; |
536 | 538 |
|
537 | 539 |
/** |
538 |
- * Access key to MCPTT calls Session ID. This identifier is unique for each call. |
|
539 |
- * It occurs in all types of {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum} events. |
|
540 |
+ * Key Access to MCPTT calls Session ID. This identifier is unique for each call. |
|
541 |
+ * It occurs in all types of {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum} events. |
|
540 | 542 |
*/ |
541 | 543 |
public static final String SESSION_ID="org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras"+".SESSION_ID"; |
542 | 544 |
|
543 | 545 |
|
544 | 546 |
/** |
545 |
- * <h2>Access key to the numbering of a specific MCPTT session control denial or revocation event.</h2> |
|
547 |
+ * <h2>Key Access to the numbering of a specific MCPTT session control denial or revocation event.</h2> |
|
546 | 548 |
* <p>Response: Integer indicating the code of the cause.</p> |
547 | 549 |
* <p>Values:</p> |
548 |
- * <p> Event {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#denied}:</p> |
|
550 |
+ * <p> Event {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#denied}:</p> |
|
549 | 551 |
* <p> 101 Cause #1 - Another MCPTT client has permission The <Reject cause> value set to '1' indicates that another MCPTT user has permission to send a media.</p> |
550 | 552 |
* <p> 102 Cause #2 - Internal floor control server error The <Reject cause> value set to '2' indicates that the floor control server cannot grant the floor request due to an internal error.</p> |
551 | 553 |
* <p> 103 Cause #3 - Only one participant The <Reject cause> value set to '3' indicates that the floor control server cannot grant the floor request, because the requesting party is the only participant in the MCPTT session.</p> |
... | ... |
@@ -554,14 +589,14 @@ public class ConstantsMCOP { |
554 | 554 |
* <p> 106 Cause #6 - No resources available The <Reject cause> value set to '6' indicates that the floor control server cannot grant the floor request due to congestion.</p> |
555 | 555 |
* <p> 107 Cause #7 – Queue full The <Reject cause> value set to 7 indicates that the floor control server cannot queue the floor request, because the queue is full.</p> |
556 | 556 |
* <p> 108 Cause #255 - Other reason The <Reject cause> value set to '255' indicates that the floor control server does not grant the floor request due to the floor control server local policy.</p> |
557 |
- * <p> Event {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#revoked}:</p> |
|
557 |
+ * <p> Event {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#revoked}:</p> |
|
558 | 558 |
* <p> 201 Cause #1 – Only one MCPTT client The <Reject Cause> value set to '1' indicates that the MCPTT client is the only MCPTT client in the MCPTT session or the only participant connected to a floor control server. No additional information included.</p> |
559 | 559 |
* <p> 202 Cause #2 – Media burst too long The <Reject Cause> value set to '2' indicates that the MCPTT User has talked too long (e.g., the stop-talking timer has expired). No additional information included.</p> |
560 | 560 |
* <p> 203 Cause #3 - No permission to send a Media Burst The <Reject Cause> value set to '3' indicates that the MCPTT client does not have permission to send media. No additional information is included.</p> |
561 | 561 |
* <p> 204 Cause #4 - Media Burst pre-empted The <Reject Cause> value set to '4' indicates that the MCPTT client 's permission to send a media is being pre-empted. No additional information is included.</p> |
562 | 562 |
* <p> 205 Cause #6 - No resources available The <Reject Cause> value set to '6' indicates that the floor control server can no longer grant MCPTT client to send media due to congestion. No additional information is included.</p> |
563 | 563 |
* <p> 206 Cause #255 – Other reason The <Reject Cause> value set to '255' indicates that the floor control server can no longer grant MCPTT client to send media due to the floor control server local policy. No additional information is included.</p> |
564 |
- * <p> Event {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_rejection}:</p> |
|
564 |
+ * <p> Event {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_rejection}:</p> |
|
565 | 565 |
* <p> 301 Cause #1 - Transmission limit reached The <Reject cause> value set to '1' indicates that the number of transmitters have reached maximum.</p> |
566 | 566 |
* <p> 302 Cause #2 - Internal transmission control server error The <Reject cause> value set to '2' indicates that the transmission control server cannot grant the transmission request due to an internal error.</p> |
567 | 567 |
* <p> 303 Cause #3 - Only one participant The <Reject cause> value set to '3' indicates that the transmission control server cannot grant the transmission request, because the requesting party is the only participant in the MCVideo session.</p> |
... | ... |
@@ -569,14 +604,14 @@ public class ConstantsMCOP { |
569 | 569 |
* <p> 305 Cause #5 - Receive only The <Reject cause> value set to '5' indicates that the transmission control server cannot grant the transmission request, because the requesting party only has receive privilege.</p> |
570 | 570 |
* <p> 306 Cause #6 - No resources available The <Reject cause> value set to '6' indicates that the transmission control server cannot grant the transmission request due to congestion.</p> |
571 | 571 |
* <p> 307 Cause #255 - Other reason The <Reject cause> value set to '255' indicates that the transmission control server does not grant the transmission request due to the transmission control server local policy.</p> |
572 |
- * <p> Event {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_revoke}:</p> |
|
572 |
+ * <p> Event {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#transmission_revoke}:</p> |
|
573 | 573 |
* <p> 401 Cause #1 – Only one MCVideo client The <Reject Cause> value set to '1' indicates that the MCVideo client is the only MCVideo client in the MCVideo session or the only participant connected to a transmission control server. No additional information included.</p> |
574 | 574 |
* <p> 402 Cause #2 – Media burst too long The <Reject Cause> value set to '2' indicates that the MCVideo User has transmitted too long (e.g., the stop-transmission timer has expired). No additional information included.</p> |
575 | 575 |
* <p> 403 Cause #3 - No permission to send a Media Burst The <Reject Cause> value set to '3' indicates that the MCVideo client does not have permission to send media. No additional information is included.</p> |
576 | 576 |
* <p> 404 Cause #4 - Media Burst pre-empted The <Reject Cause> value set to '4' indicates that the MCVideo client's permission to send a media is being pre-empted. No additional information is included.</p> |
577 | 577 |
* <p> 405 Cause #6 - No resources available The <Reject Cause> value set to '6' indicates that the transmission control server can no longer grant MCVideo client to send media due to congestion. No additional information is included.</p> |
578 | 578 |
* <p> 406 Cause #255 – Other reason The <Reject Cause> value set to '255' indicates that the transmission control server can no longer grant MCVideo client to send media due to the transmission control server local policy. No additional information is included.</p> |
579 |
- * <p> Event {@link org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_rejection}:</p> |
|
579 |
+ * <p> Event {@link ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum#reception_rejection}:</p> |
|
580 | 580 |
* <p> 501 Cause #2 - Internal transmission control server error The <Reject cause> value set to '2' indicates that the transmission control server cannot grant the receive media request due to an internal error.</p> |
581 | 581 |
* <p> 502 Cause #4 - Retry-after timer has not expired The <Reject cause> value set to '4' indicates that the transmission control server cannot grant the receive media request, because timer T9 (Retry-after) has not expired after permission to send media has been revoked.</p> |
582 | 582 |
* <p> 503 Cause #5 - Send only The <Reject cause> value set to '5' indicates that the transmission control server cannot grant the receive media request, because the requesting party only has send privilege.</p> |
... | ... |
@@ -585,11 +620,11 @@ public class ConstantsMCOP { |
585 | 585 |
*/ |
586 | 586 |
public static final String CAUSE_CODE="org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras"+".CAUSE_CODE"; |
587 | 587 |
/** |
588 |
- * <h2>Access key to the string of the cause codes.</h2> |
|
588 |
+ * <h2>Key Access to the string of the cause codes.</h2> |
|
589 | 589 |
*/ |
590 | 590 |
public static final String CAUSE_STRING="org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras"+".CAUSE_STRING"; |
591 | 591 |
/** |
592 |
- *<p> Access key to Error Codes</p> |
|
592 |
+ *<p> Key Access to Error Codes</p> |
|
593 | 593 |
*<p> All error codes are integers:</p> |
594 | 594 |
*<p>Code Explanatory text Description</p> |
595 | 595 |
*<p>103 maximum simultaneous MCPTT group calls reached The number of maximum simultaneous MCPTT group calls supported for the MCPTT user has been exceeded.</p> |
... | ... |
@@ -597,7 +632,7 @@ public class ConstantsMCOP { |
597 | 597 |
|
598 | 598 |
|
599 | 599 |
/** |
600 |
- * <h2>Access key to the floor control error codes.</h2> |
|
600 |
+ * <h2>Key Access to the floor control error codes.</h2> |
|
601 | 601 |
* <p>Response: Integer indicating the error code.</p> |
602 | 602 |
* <p>Values:</p> |
603 | 603 |
* <p>0 means no error.</p> |
... | ... |
@@ -607,13 +642,13 @@ public class ConstantsMCOP { |
607 | 607 |
*/ |
608 | 608 |
public static final String ERROR_CODE="org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras"+".ERROR_CODE"; |
609 | 609 |
/** |
610 |
- * <h2>Access key to the Error codes string.</h2> |
|
610 |
+ * <h2>Key Access to the Error codes string.</h2> |
|
611 | 611 |
*/ |
612 | 612 |
public static final String ERROR_STRING="org.mcopenplatform.muoapi.ConstantsMCOP.FloorControlEventExtras"+".ERROR_STRING"; |
613 | 613 |
|
614 | 614 |
|
615 | 615 |
/** |
616 |
- * <h2>Operation types performed in method {@link IMCOPsdk#floorControlOperation(String, int, String)} for MCPTT session control management.</h2> |
|
616 |
+ * <h2>Operation types performed in method {@link org.mcopenplatform.muoapi.IMCOPsdk#floorControlOperation(String, int, String)} for MCPTT session control management.</h2> |
|
617 | 617 |
*/ |
618 | 618 |
public enum FloorControlOperationTypeEnum{ |
619 | 619 |
none(0x00), |
... | ... |
@@ -703,7 +738,7 @@ public class ConstantsMCOP { |
703 | 703 |
|
704 | 704 |
/** |
705 | 705 |
* |
706 |
- * <h1>Access key to event {@link ActionsCallBack#groupInfoEvent} values.</h1> |
|
706 |
+ * <h1>Key Access to event {@link ActionsCallBack#groupInfoEvent} values.</h1> |
|
707 | 707 |
* <h2>For each group the user belongs to, an event with the different data that defines the group will be sent.</h2> |
708 | 708 |
* |
709 | 709 |
*/ |
... | ... |
@@ -712,20 +747,20 @@ public class ConstantsMCOP { |
712 | 712 |
|
713 | 713 |
|
714 | 714 |
/** |
715 |
- * <h2>Access key to the Group ID that allows to univocally distinguish the MCPTT group causing the event.</h2> |
|
715 |
+ * <h2>Key Access to the Group ID that allows to univocally distinguish the MCPTT group causing the event.</h2> |
|
716 | 716 |
* <p>Response: String with URI format that identifies the MCPTT group.</p> |
717 | 717 |
*/ |
718 | 718 |
public static final String GROUP_ID="org.mcopenplatform.muoapi.ConstantsMCOP.GroupInfoEventExtras"+".GROUP_ID"; |
719 | 719 |
|
720 | 720 |
|
721 | 721 |
/** |
722 |
- * <h2>Access key to the Display Name that allows to distinguish the MCPTT group causing the event.</h2> |
|
722 |
+ * <h2>Key Access to the Display Name that allows to distinguish the MCPTT group causing the event.</h2> |
|
723 | 723 |
* <p>Response: String that identifies the MCPTT group in a human-readable format.</p> |
724 | 724 |
*/ |
725 | 725 |
public static final String DISPLAY_NAME="org.mcopenplatform.muoapi.ConstantsMCOP.GroupInfoEventExtras"+".DISPLAY_NAME"; |
726 | 726 |
|
727 | 727 |
/** |
728 |
- * <h2>Access key to the permissions of the MCPTT group.</h2> |
|
728 |
+ * <h2>Key Access to the permissions of the MCPTT group.</h2> |
|
729 | 729 |
* <p>Response: Integer containing the different FLAGs of the user's permissions on the group.</p> |
730 | 730 |
* <p>Values:</p> |
731 | 731 |
* <p>0 means no permission.</p> |
... | ... |
@@ -749,14 +784,14 @@ public class ConstantsMCOP { |
749 | 749 |
|
750 | 750 |
|
751 | 751 |
/** |
752 |
- * <h2>Access key to maximum allowed size for SDS data transmission.</h2> |
|
752 |
+ * <h2>Key Access to maximum allowed size for SDS data transmission.</h2> |
|
753 | 753 |
* <p>Indicates the maximum size of data (in bytes) that the originating MCData client is allowed to send to the MCData server for on-network SDS communications.</p> |
754 | 754 |
* <p>Response: Integer (in bytes)</p> |
755 | 755 |
*/ |
756 | 756 |
public static final String MAX_DATA_SIZE_FOR_SDS="org.mcopenplatform.muoapi.ConstantsMCOP.GroupInfoEventExtras"+".MAX_DATA_SIZE_FOR_SDS"; |
757 | 757 |
|
758 | 758 |
/** |
759 |
- * <h2>Access key to maximum allowed file size for FD data transmission.</h2> |
|
759 |
+ * <h2>Key Access to maximum allowed file size for FD data transmission.</h2> |
|
760 | 760 |
* <p>Indicates the maximum size of data (in bytes) that the originating MCData client is allowed to send to the MCData server for on-network FD communications.</p> |
761 | 761 |
* <p>Response: Integer (in bytes)</p> |
762 | 762 |
*/ |
... | ... |
@@ -764,14 +799,14 @@ public class ConstantsMCOP { |
764 | 764 |
|
765 | 765 |
|
766 | 766 |
/** |
767 |
- * <h2>Access key to maximum allowed file size for FD data transmission using HTTP.</h2> |
|
767 |
+ * <h2>Key Access to maximum allowed file size for FD data transmission using HTTP.</h2> |
|
768 | 768 |
* <p>Indicates the maximum size of data (in bytes) which the MCData server always requests the terminating MCData client to automatically download for on-network FD communications using HTTP.</p> |
769 | 769 |
* <p>Response: Integer (in bytes)</p> |
770 | 770 |
*/ |
771 | 771 |
public static final String MAX_DATA_SIZE_AUTO_RECV="org.mcopenplatform.muoapi.ConstantsMCOP.GroupInfoEventExtras"+".MAX_DATA_SIZE_AUTO_RECV"; |
772 | 772 |
|
773 | 773 |
/** |
774 |
- * <h2>Access key to real-time video mode.</h2> |
|
774 |
+ * <h2>Key Access to real-time video mode.</h2> |
|
775 | 775 |
* <p>Response: String</p> |
776 | 776 |
* <p>Values {@link ActionRealTimeVideoType}:</p> |
777 | 777 |
* <p> urgent_real_time () {@link ActionRealTimeVideoType#urgent_real_time}</p> |
... | ... |
@@ -811,16 +846,29 @@ public class ConstantsMCOP { |
811 | 811 |
} |
812 | 812 |
|
813 | 813 |
/** |
814 |
- * <h2>Access key to the group participants list.</h2> |
|
815 |
- * <p>Response: Array with 3 Strings:.</p> |
|
816 |
- * <p> Component 0: UserID unequivocally identifies the user.</p> |
|
817 |
- * <p> Component 1: ParticipantType indicates the user position in the organization. Not defined by 3GPP.</p> |
|
818 |
- * <p> Component 2: DisplayName identifies the user.</p> |
|
814 |
+ * <h2>Key Access to the group participants data</h2> |
|
815 |
+ * <p> UserID unequivocally identifies the user.</p> |
|
819 | 816 |
*/ |
820 | 817 |
public static final String PARTICIPANTS_LIST="org.mcopenplatform.muoapi.ConstantsMCOP.GroupInfoEventExtras"+".PARTICIPANTS_LIST"; |
821 | 818 |
|
819 |
+ |
|
820 |
+ /** |
|
821 |
+ * <h2>Key Access to the group participants data.</h2> |
|
822 |
+ * <p>Response: Array with 3 Strings:.</p> |
|
823 |
+ * <p> DisplayName identifies the user.</p> |
|
824 |
+ */ |
|
825 |
+ public static final String PARTICIPANTS_LIST_DISPLAY_NAME="org.mcopenplatform.muoapi.ConstantsMCOP.GroupInfoEventExtras"+".PARTICIPANTS_LIST_DISPLAY_NAME"; |
|
826 |
+ |
|
827 |
+ /** |
|
828 |
+ * <h2>Key Access to the group participants data.</h2> |
|
829 |
+ * <p> ParticipantType indicates the user position in the organization. Not defined by 3GPP.</p> |
|
830 |
+ */ |
|
831 |
+ public static final String PARTICIPANTS_LIST_TYPE="org.mcopenplatform.muoapi.ConstantsMCOP.GroupInfoEventExtras"+".PARTICIPANTS_LIST_TYPE"; |
|
832 |
+ |
|
833 |
+ |
|
834 |
+ |
|
822 | 835 |
/** |
823 |
- * <h2>Access key to group info error codes.</h2> |
|
836 |
+ * <h2>Key Access to group info error codes.</h2> |
|
824 | 837 |
* <p>Response: Integer indicating error codes.</p> |
825 | 838 |
* <p>Values:</p> |
826 | 839 |
* <p>0 means no errors.</p> |
... | ... |
@@ -828,7 +876,7 @@ public class ConstantsMCOP { |
828 | 828 |
*/ |
829 | 829 |
public static final String ERROR_CODE="org.mcopenplatform.muoapi.ConstantsMCOP.GroupInfoEventExtras"+".ERROR_CODE"; |
830 | 830 |
/** |
831 |
- * <h2>Access key to the Error codes string.</h2> |
|
831 |
+ * <h2>Key Access to the Error codes string.</h2> |
|
832 | 832 |
*/ |
833 | 833 |
public static final String ERROR_STRING="org.mcopenplatform.muoapi.ConstantsMCOP.GroupInfoEventExtras"+".ERROR_STRING"; |
834 | 834 |
|
... | ... |
@@ -895,14 +943,14 @@ public class ConstantsMCOP { |
895 | 895 |
|
896 | 896 |
/** |
897 | 897 |
* |
898 |
- * <h1>Access key to values of {@link ActionsCallBack#groupAffiliationEvent} event.</h1> |
|
898 |
+ * <h1>Key Access to values of {@link ActionsCallBack#groupAffiliationEvent} event.</h1> |
|
899 | 899 |
* |
900 | 900 |
*/ |
901 | 901 |
public static class GroupAffiliationEventExtras{ |
902 | 902 |
|
903 | 903 |
/** |
904 |
- * <h2>Access key to MAP<String, Integer> of groups and the current group state.</h2> |
|
905 |
- * <p>This data is given in state {@link org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#GROUP_AFFILIATION_UPDATE}</p> |
|
904 |
+ * <h2>Key Access to MAP<String, Integer> of groups and the current group state.</h2> |
|
905 |
+ * <p>This data is given in state {@link ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#GROUP_AFFILIATION_UPDATE}</p> |
|
906 | 906 |
* <p>Response: MAP<String,Integer> being Group ID the key, and the type of affiliation status the value.</p> |
907 | 907 |
* <p> notaffiliated (Not affiliated, and therefore no action that requires being affiliated can be taken.) {@link GroupAffiliationEventExtras.GroupAffiliationStateEnum#notaffiliated}</p> |
908 | 908 |
* <p> affiliating (Affiliation procedure initiated.) {@link GroupAffiliationEventExtras.GroupAffiliationStateEnum#affiliating}</p> |
... | ... |
@@ -912,42 +960,42 @@ public class ConstantsMCOP { |
912 | 912 |
public static final String GROUPS_LIST="org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras"+".GROUPS_LIST"; |
913 | 913 |
|
914 | 914 |
/** |
915 |
- * <h2>Access key to event type:</h2> |
|
915 |
+ * <h2>Key Access to event type:</h2> |
|
916 | 916 |
* <p>Value: Integer.</p> |
917 | 917 |
* <p>Possible event types:</p> |
918 |
- * <p> GROUP_AFFILIATION_UPDATE (Event to update the status of the groups and user's affiliation to them.) {@link org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#GROUP_AFFILIATION_UPDATE}</p> |
|
919 |
- * <p> GROUP_AFFILIATION_ERROR (Error event in some affiliation procedure.) {@link org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#GROUP_AFFILIATION_ERROR}</p> |
|
920 |
- * <p> REMOTE_AFFILIATION (Remote affiliation request by another privileged user. It is mandatory to present the user the option to join or not. In case the user wants to be affiliated, the operation {@link IMCOPsdk#groupAffiliationOperation(String, String, int)} must be executed to affiliate the user to the group.) {@link org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#REMOTE_AFFILIATION}</p> |
|
918 |
+ * <p> GROUP_AFFILIATION_UPDATE (Event to update the status of the groups and user's affiliation to them.) {@link ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#GROUP_AFFILIATION_UPDATE}</p> |
|
919 |
+ * <p> GROUP_AFFILIATION_ERROR (Error event in some affiliation procedure.) {@link ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#GROUP_AFFILIATION_ERROR}</p> |
|
920 |
+ * <p> REMOTE_AFFILIATION (Remote affiliation request by another privileged user. It is mandatory to present the user the option to join or not. In case the user wants to be affiliated, the operation {@link org.mcopenplatform.muoapi.IMCOPsdk#groupAffiliationOperation(String, String, int)} must be executed to affiliate the user to the group.) {@link org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#REMOTE_AFFILIATION}</p> |
|
921 | 921 |
*/ |
922 | 922 |
public static final String EVENT_TYPE="org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras"+".EVENT_TYPE"; |
923 | 923 |
|
924 | 924 |
/** |
925 |
- * <h2>Access key to the Group ID that univocally distinguishes the MCPTT group causing the event.</h2> |
|
925 |
+ * <h2>Key Access to the Group ID that univocally distinguishes the MCPTT group causing the event.</h2> |
|
926 | 926 |
* <p>Response: String with URI format that identifies the MCPTT group.</p> |
927 |
- * <p>Event {@link org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#REMOTE_AFFILIATION} is used to request the group.</p> |
|
927 |
+ * <p>Event {@link ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#REMOTE_AFFILIATION} is used to request the group.</p> |
|
928 | 928 |
*/ |
929 | 929 |
public static final String REMOTE_GROUP_ID="org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras"+".REMOTE_GROUP_ID"; |
930 | 930 |
|
931 | 931 |
|
932 | 932 |
/** |
933 |
- * <h2>Access key to Group ID to know the group where the error occurred.</h2> |
|
933 |
+ * <h2>Key Access to Group ID to know the group where the error occurred.</h2> |
|
934 | 934 |
* <p>Response: String with URI format that identifies the MCPTT group.</p> |
935 |
- * <p>Event {@link org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#GROUP_AFFILIATION_ERROR} is used.</p> |
|
935 |
+ * <p>Event {@link ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#GROUP_AFFILIATION_ERROR} is used.</p> |
|
936 | 936 |
*/ |
937 | 937 |
public static final String GROUP_ID="org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras"+".GROUP_ID"; |
938 | 938 |
|
939 | 939 |
/** |
940 |
- * <h2>Access key to the User ID that univocally distinguishes the privileged MCPTT user making the explicit affiliation.</h2> |
|
940 |
+ * <h2>Key Access to the User ID that univocally distinguishes the privileged MCPTT user making the explicit affiliation.</h2> |
|
941 | 941 |
* <p>Response: String with URI format that identifies the MCPTT user.</p> |
942 |
- * <p>Event {@link org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#REMOTE_AFFILIATION} is used to know the remote user requesting the explicit affiliation.</p> |
|
942 |
+ * <p>Event {@link ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#REMOTE_AFFILIATION} is used to know the remote user requesting the explicit affiliation.</p> |
|
943 | 943 |
* |
944 | 944 |
*/ |
945 | 945 |
public static final String REMOTE_USER_ID="org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras"+".REMOTE_USER_ID"; |
946 | 946 |
|
947 | 947 |
/** |
948 |
- * <h2>Access key to the type of action that is remotely requested to be performed.</h2> |
|
948 |
+ * <h2>Key Access to the type of action that is remotely requested to be performed.</h2> |
|
949 | 949 |
* <p>Response: {@link GroupAffiliationStateEnum}.</p> |
950 |
- * <p>Event {@link org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#REMOTE_AFFILIATION} is used to know the remote user requesting the explicit affiliation.</p> |
|
950 |
+ * <p>Event {@link ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum#REMOTE_AFFILIATION} is used to know the remote user requesting the explicit affiliation.</p> |
|
951 | 951 |
* <p> affiliating (It must be asked whether the user accepts the affiliation or not.) {@link GroupAffiliationEventExtras.GroupAffiliationStateEnum#affiliating}</p> |
952 | 952 |
* <p> deaffiliating (It must be asked whether the user accepts the de-affiliation or not.) {@link GroupAffiliationEventExtras.GroupAffiliationStateEnum#deaffiliating}</p> |
953 | 953 |
*/ |
... | ... |
@@ -955,7 +1003,7 @@ public class ConstantsMCOP { |
955 | 955 |
|
956 | 956 |
|
957 | 957 |
/** |
958 |
- * <h2>Access key to the affiliation error codes.</h2> |
|
958 |
+ * <h2>Key Access to the affiliation error codes.</h2> |
|
959 | 959 |
* <p>Response: Integer indicating the error code.</p> |
960 | 960 |
* <p>Values:</p> |
961 | 961 |
* <p>0 means no errors.</p> |
... | ... |
@@ -972,7 +1020,7 @@ public class ConstantsMCOP { |
972 | 972 |
*/ |
973 | 973 |
public static final String ERROR_CODE="org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras"+".ERROR_CODE"; |
974 | 974 |
/** |
975 |
- * <h2>Access key to the error string of the affiliation methods.</h2> |
|
975 |
+ * <h2>Key Access to the error string of the affiliation methods.</h2> |
|
976 | 976 |
* <p>Response: String describing the error.</p> |
977 | 977 |
*/ |
978 | 978 |
public static final String ERROR_STRING="org.mcopenplatform.muoapi.ConstantsMCOP.GroupAffiliationEventExtras"+".ERROR_STRING"; |
... | ... |
@@ -1043,7 +1091,7 @@ public class ConstantsMCOP { |
1043 | 1043 |
|
1044 | 1044 |
/** |
1045 | 1045 |
* |
1046 |
- * <h1>Event used to indicate the affiliation action that must be used in method {@link IMCOPsdk#groupAffiliationOperation(String, String, int)}.</h1> |
|
1046 |
+ * <h1>Event used to indicate the affiliation action that must be used in method {@link org.mcopenplatform.muoapi.IMCOPsdk#groupAffiliationOperation(String, String, int)}.</h1> |
|
1047 | 1047 |
* <p>Values:</p> |
1048 | 1048 |
* <p>Error Code 0 is not correct, and it will answer with an error.</p> |
1049 | 1049 |
* <p> Affiliate (Affiliation action over a groupID) {@link AffiliationOperationTypeEnum#Affiliate}</p> |
... | ... |
@@ -1078,20 +1126,20 @@ public class ConstantsMCOP { |
1078 | 1078 |
|
1079 | 1079 |
/** |
1080 | 1080 |
* |
1081 |
- * <h1>Access key to the values of event {@link ActionsCallBack#selectedContactChangeEvent}.</h1> |
|
1081 |
+ * <h1>Key Access to the values of event {@link ActionsCallBack#selectedContactChangeEvent}.</h1> |
|
1082 | 1082 |
* |
1083 | 1083 |
*/ |
1084 | 1084 |
public static class SelectedContactChangeEventExtras{ |
1085 | 1085 |
|
1086 | 1086 |
/** |
1087 |
- * <h2>Access key to Group ID to define the default call group.</h2> |
|
1087 |
+ * <h2>Key Access to Group ID to define the default call group.</h2> |
|
1088 | 1088 |
* <p>Response: String with URI format that identifies the MCPTT group.</p> |
1089 | 1089 |
* @See IMCOPsdk#makeCall |
1090 | 1090 |
*/ |
1091 | 1091 |
public static final String GROUP_ID="org.mcopenplatform.muoapi.ConstantsMCOP.SelectedContactChangeEventExtras"+".GROUP_ID"; |
1092 | 1092 |
|
1093 | 1093 |
/** |
1094 |
- * <h2>Access key to the error codes of default group selection.</h2> |
|
1094 |
+ * <h2>Key Access to the error codes of default group selection.</h2> |
|
1095 | 1095 |
* <p>Response: Integer indicating the error code.</p> |
1096 | 1096 |
* <p>Values:</p> |
1097 | 1097 |
* <p>0 means no errors.</p> |
... | ... |
@@ -1102,7 +1150,7 @@ public class ConstantsMCOP { |
1102 | 1102 |
*/ |
1103 | 1103 |
public static final String ERROR_CODE="org.mcopenplatform.muoapi.ConstantsMCOP.SelectedContactChangeEventExtras"+".ERROR_CODE"; |
1104 | 1104 |
/** |
1105 |
- * <h2>Access key to the error strings.</h2> |
|
1105 |
+ * <h2>Key Access to the error strings.</h2> |
|
1106 | 1106 |
* <p>Response: String describing the error.</p> |
1107 | 1107 |
*/ |
1108 | 1108 |
public static final String ERROR_STRING="org.mcopenplatform.muoapi.ConstantsMCOP.SelectedContactChangeEventExtras"+".ERROR_STRING"; |
... | ... |
@@ -1112,13 +1160,13 @@ public class ConstantsMCOP { |
1112 | 1112 |
|
1113 | 1113 |
/** |
1114 | 1114 |
* |
1115 |
- * <h1>Access key to the values of event {@link ActionsCallBack#eMBMSNotificationEvent}.</h1> |
|
1115 |
+ * <h1>Key Access to the values of event {@link ActionsCallBack#eMBMSNotificationEvent}.</h1> |
|
1116 | 1116 |
* |
1117 | 1117 |
*/ |
1118 | 1118 |
public static class EMBMSNotificationEventExtras{ |
1119 | 1119 |
|
1120 | 1120 |
/** |
1121 |
- * <h2>Access key to the Temporary Mobile Group Identity (TMGI) identifying the eMBMS bearer.</h2> |
|
1121 |
+ * <h2>Key Access to the Temporary Mobile Group Identity (TMGI) identifying the eMBMS bearer.</h2> |
|
1122 | 1122 |
* <p>Response: String</p> |
1123 | 1123 |
* <p>Used in events:</p> |
1124 | 1124 |
* <p> {@link EMBMSNotificationEventEventTypeEnum#UndereMBMSCoverage}</p> |
... | ... |
@@ -1130,7 +1178,7 @@ public class ConstantsMCOP { |
1130 | 1130 |
|
1131 | 1131 |
|
1132 | 1132 |
/** |
1133 |
- * <h2>Access key to the MCPTT session ID. This identifier is unique for each call.</h2> |
|
1133 |
+ * <h2>Key Access to the MCPTT session ID. This identifier is unique for each call.</h2> |
|
1134 | 1134 |
* <p>Response: String</p> |
1135 | 1135 |
* <p>Used in events:</p> |
1136 | 1136 |
* <p> {@link EMBMSNotificationEventEventTypeEnum#UndereMBMSCoverage}</p> |
... | ... |
@@ -1141,7 +1189,7 @@ public class ConstantsMCOP { |
1141 | 1141 |
public static final String SESSION_ID="org.mcopenplatform.muoapi.ConstantsMCOP.EMBMSNotificationEventExtras"+".SESSION_ID"; |
1142 | 1142 |
|
1143 | 1143 |
/** |
1144 |
- * <h2>Access key to the list of eMBMS service areas.</h2> |
|
1144 |
+ * <h2>Key Access to the list of eMBMS service areas.</h2> |
|
1145 | 1145 |
* <p>Response: String containing all the eMBMS service area identifiers consecutively.</p> |
1146 | 1146 |
* <p>Used in events:</p> |
1147 | 1147 |
* <p> {@link EMBMSNotificationEventEventTypeEnum#UndereMBMSCoverage}</p> |
... | ... |
@@ -1153,28 +1201,28 @@ public class ConstantsMCOP { |
1153 | 1153 |
|
1154 | 1154 |
|
1155 | 1155 |
/** |
1156 |
- * Access key to event type: |
|
1156 |
+ * Key Access to event type: |
|
1157 | 1157 |
* Value: Integer. |
1158 | 1158 |
* <p>Possible event types:</p> |
1159 |
- * <p> eMBMSAvailable (eMBMS available) {@link org.mcopenplatform.muoapi.ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum#eMBMSAvailable}</p> |
|
1160 |
- * <p> UndereMBMSCoverage (Under eMBMS coverage for a specific TMGI) {@link org.mcopenplatform.muoapi.ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum#UndereMBMSCoverage}</p> |
|
1161 |
- * <p> eMBMSBearerInUse (Particular eMBMS bearer in use) {@link org.mcopenplatform.muoapi.ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum#eMBMSBearerInUse}</p> |
|
1162 |
- * <p> eMBMSBearerNotInUse (Particular eMBMS bearer not in use) {@link org.mcopenplatform.muoapi.ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum#eMBMSBearerNotInUse}</p> |
|
1163 |
- * <p> NoeMBMSCoverage (Not under eMBMS coverage for a specific TMGI) org.mcopenplatform.muoapi.ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum#NoeMBMSCoverage}</p> |
|
1164 |
- * <p> eMBMSNotAvailable (eMBMS not available) {@link org.mcopenplatform.muoapi.ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum#eMBMSNotAvailable}</p> |
|
1159 |
+ * <p> eMBMSAvailable (eMBMS available) {@link ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum#eMBMSAvailable}</p> |
|
1160 |
+ * <p> UndereMBMSCoverage (Under eMBMS coverage for a specific TMGI) {@link ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum#UndereMBMSCoverage}</p> |
|
1161 |
+ * <p> eMBMSBearerInUse (Particular eMBMS bearer in use) {@link ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum#eMBMSBearerInUse}</p> |
|
1162 |
+ * <p> eMBMSBearerNotInUse (Particular eMBMS bearer not in use) {@link ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum#eMBMSBearerNotInUse}</p> |
|
1163 |
+ * <p> NoeMBMSCoverage (Not under eMBMS coverage for a specific TMGI) {@link ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum#NoeMBMSCoverage}</p> |
|
1164 |
+ * <p> eMBMSNotAvailable (eMBMS not available) {@link ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum#eMBMSNotAvailable}</p> |
|
1165 | 1165 |
*/ |
1166 | 1166 |
public static final String EVENT_TYPE="org.mcopenplatform.muoapi.ConstantsMCOP.EMBMSNotificationEventExtras"+".EVENT_TYPE"; |
1167 | 1167 |
|
1168 | 1168 |
|
1169 | 1169 |
/** |
1170 |
- * <h2>Access key to eMBMS error codes.</h2> |
|
1170 |
+ * <h2>Key Access to eMBMS error codes.</h2> |
|
1171 | 1171 |
* <p>Response: Integer indicating the error code.</p> |
1172 | 1172 |
* <p>Values:</p> |
1173 | 1173 |
* <p>0 means no errors.</p> |
1174 | 1174 |
*/ |
1175 |
- public static final String ERROR_CODE="org.mcopenplatform.muoapi.ConstantsMCOP.EMBMSNotificationEventExtras"+".ERROR_CODE"; |
|
1175 |
+ public static final String ERROR_CODE="ConstantsMCOP.EMBMSNotificationEventExtras"+".ERROR_CODE"; |
|
1176 | 1176 |
/** |
1177 |
- * <h2>Access key to error string.</h2> |
|
1177 |
+ * <h2>Key Access to error string.</h2> |
|
1178 | 1178 |
* <p>Response: String describing the error.</p> |
1179 | 1179 |
*/ |
1180 | 1180 |
public static final String ERROR_STRING="org.mcopenplatform.muoapi.ConstantsMCOP.EMBMSNotificationEventExtras"+".ERROR_STRING"; |
... | ... |
@@ -1197,10 +1245,25 @@ public class ConstantsMCOP { |
1197 | 1197 |
public int getValue() { |
1198 | 1198 |
return code; |
1199 | 1199 |
} |
1200 |
+ |
|
1201 |
+ |
|
1202 |
+ private static Map map = new HashMap<>(); |
|
1203 |
+ |
|
1204 |
+ |
|
1205 |
+ static { |
|
1206 |
+ for (EMBMSNotificationEventEventTypeEnum pageType : EMBMSNotificationEventEventTypeEnum.values()) { |
|
1207 |
+ map.put(pageType.code, pageType); |
|
1208 |
+ } |
|
1209 |
+ } |
|
1210 |
+ |
|
1211 |
+ public static EMBMSNotificationEventEventTypeEnum fromInt(int pageType) { |
|
1212 |
+ return (EMBMSNotificationEventEventTypeEnum) map.get(pageType); |
|
1213 |
+ } |
|
1200 | 1214 |
} |
1201 | 1215 |
} |
1202 | 1216 |
|
1203 | 1217 |
|
1218 |
+ |
|
1204 | 1219 |
/** |
1205 | 1220 |
* <h2>Different MCOP SDK event types for MCPTT services.</h2> |
1206 | 1221 |
*/ |
... | ... |
@@ -1247,7 +1310,7 @@ public class ConstantsMCOP { |
1247 | 1247 |
} |
1248 | 1248 |
|
1249 | 1249 |
/** |
1250 |
- * <h1>Event types for method {@link IMCOPsdk#updateEmergencyState(String, int)}.</h1> |
|
1250 |
+ * <h1>Event types for method {@link org.mcopenplatform.muoapi.IMCOPsdk#updateEmergencyState(String, int)}.</h1> |
|
1251 | 1251 |
*/ |
1252 | 1252 |
public enum EmergencyTypeEnum{ |
1253 | 1253 |
NONE (0x00), |
1254 | 1254 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,166 @@ |
0 |
+/* |
|
1 |
+ * |
|
2 |
+ * Copyright (C) 2018, University of the Basque Country (UPV/EHU) |
|
3 |
+ * |
|
4 |
+ * Contact for licensing options: <licensing-mcpttclient(at)mcopenplatform(dot)com> |
|
5 |
+ * |
|
6 |
+ * This file is part of MCOP MCPTT Client |
|
7 |
+ * |
|
8 |
+ * This is free software: you can redistribute it and/or modify it under the terms of |
|
9 |
+ * the GNU General Public License as published by the Free Software Foundation, either version 3 |
|
10 |
+ * of the License, or (at your option) any later version. |
|
11 |
+ * |
|
12 |
+ * This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
13 |
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
14 |
+ * See the GNU General Public License for more details. |
|
15 |
+ * |
|
16 |
+ * You should have received a copy of the GNU General Public License along |
|
17 |
+ * with this program; if not, write to the Free Software Foundation, Inc., |
|
18 |
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
19 |
+ */ |
|
20 |
+ |
|
21 |
+package org.test.client.mcopclient; |
|
22 |
+ |
|
23 |
+import android.app.Dialog; |
|
24 |
+import android.content.DialogInterface; |
|
25 |
+import android.os.Bundle; |
|
26 |
+import android.support.annotation.NonNull; |
|
27 |
+import android.support.v4.app.DialogFragment; |
|
28 |
+import android.support.v4.app.FragmentManager; |
|
29 |
+import android.support.v7.app.AlertDialog; |
|
30 |
+import android.util.Log; |
|
31 |
+ |
|
32 |
+import java.util.ArrayList; |
|
33 |
+ |
|
34 |
+ |
|
35 |
+public class DialogAlert extends DialogFragment { |
|
36 |
+ private final static String TAG = Utils.getTAG(DialogAlert.class.getCanonicalName()); |
|
37 |
+ |
|
38 |
+ private static final String PARAMETER_TITLE=TAG+".PARAMETER_TITLE"; |
|
39 |
+ private static final String PARAMETER_DATA=TAG+".PARAMETER_DATA"; |
|
40 |
+ private static final String PARAMETER_BUTTON_OK=TAG+".PARAMETER_BUTTON_OK"; |
|
41 |
+ private static final String PARAMETER_BUTTON_CANCEL=TAG+".PARAMETER_BUTTON_CANCEL"; |
|
42 |
+ private static final String PARAMETER_IS_BUTTON_CANCEL=TAG+".PARAMETER_IS_BUTTON_CANCEL"; |
|
43 |
+ |
|
44 |
+ |
|
45 |
+ private String data; |
|
46 |
+ private String buttonOk; |
|
47 |
+ private String buttonCancel; |
|
48 |
+ private String[] groups; |
|
49 |
+ private OnClickOkButtonListener onClickOkButtonListener; |
|
50 |
+ private String title; |
|
51 |
+ private ArrayList<String> groupsSelect; |
|
52 |
+ private boolean isButtonCancel; |
|
53 |
+ |
|
54 |
+ |
|
55 |
+ public DialogAlert() { |
|
56 |
+ |
|
57 |
+ } |
|
58 |
+ |
|
59 |
+ @Override |
|
60 |
+ public void onCreate(Bundle savedInstanceState) { |
|
61 |
+ super.onCreate(savedInstanceState); |
|
62 |
+ this.data = getArguments().getString(PARAMETER_DATA); |
|
63 |
+ this.title=getArguments().getString(PARAMETER_TITLE); |
|
64 |
+ this.title=getArguments().getString(PARAMETER_TITLE); |
|
65 |
+ this.buttonOk=getArguments().getString(PARAMETER_BUTTON_OK); |
|
66 |
+ this.buttonCancel=getArguments().getString(PARAMETER_BUTTON_CANCEL); |
|
67 |
+ this.isButtonCancel=getArguments().getBoolean(PARAMETER_IS_BUTTON_CANCEL); |
|
68 |
+ if(buttonOk==null) |
|
69 |
+ buttonOk=getString(R.string.OK); |
|
70 |
+ if(buttonCancel==null) |
|
71 |
+ buttonCancel=getString(R.string.Cancel); |
|
72 |
+ groupsSelect=new ArrayList<>(); |
|
73 |
+ } |
|
74 |
+ |
|
75 |
+ public static DialogAlert newInstance(String data, String title,boolean isButtonCancel) { |
|
76 |
+ DialogAlert f = new DialogAlert(); |
|
77 |
+ |
|
78 |
+ Bundle args = new Bundle(); |
|
79 |
+ args.putString(PARAMETER_DATA, data); |
|
80 |
+ args.putString(PARAMETER_TITLE, title); |
|
81 |
+ args.putBoolean(PARAMETER_IS_BUTTON_CANCEL, isButtonCancel); |
|
82 |
+ f.setArguments(args); |
|
83 |
+ |
|
84 |
+ return f; |
|
85 |
+ } |
|
86 |
+ |
|
87 |
+ public static DialogAlert newInstance(String title, String buttonOk, String buttonCancel,String data,boolean isButtonCancel) { |
|
88 |
+ DialogAlert f = new DialogAlert(); |
|
89 |
+ |
|
90 |
+ Bundle args = new Bundle(); |
|
91 |
+ args.putString(PARAMETER_DATA,data); |
|
92 |
+ args.putString(PARAMETER_TITLE, title); |
|
93 |
+ args.putString(PARAMETER_BUTTON_OK, buttonOk); |
|
94 |
+ args.putString(PARAMETER_BUTTON_CANCEL, buttonCancel); |
|
95 |
+ args.putBoolean(PARAMETER_IS_BUTTON_CANCEL, isButtonCancel); |
|
96 |
+ f.setArguments(args); |
|
97 |
+ return f; |
|
98 |
+ } |
|
99 |
+ |
|
100 |
+ /** |
|
101 |
+ * Display the dialog, adding the fragment to the given FragmentManager. This |
|
102 |
+ * is a convenience for explicitly creating a transaction, adding the |
|
103 |
+ * fragment to it with the given tag, and committing it. This does |
|
104 |
+ * <em>not</em> add the transaction to the back stack. When the fragment |
|
105 |
+ * is dismissed, a new transaction will be executed to remove it from |
|
106 |
+ * the activity. |
|
107 |
+ * @param manager The FragmentManager whom fragment will be added to. |
|
108 |
+ * @param tag The tag for this fragment |
|
109 |
+ */ |
|
110 |
+ public void show(FragmentManager manager, String tag) { |
|
111 |
+ try{ |
|
112 |
+ super.show(manager,tag); |
|
113 |
+ }catch (Exception e){ |
|
114 |
+ Log.e(TAG,"Error in dialog: "+e.getMessage()); |
|
115 |
+ } |
|
116 |
+ |
|
117 |
+ } |
|
118 |
+ |
|
119 |
+ public static DialogAlert newInstance() { |
|
120 |
+ return newInstance(null,null,false); |
|
121 |
+ } |
|
122 |
+ |
|
123 |
+ @NonNull |
|
124 |
+ @Override |
|
125 |
+ public Dialog onCreateDialog(Bundle savedInstanceState) { |
|
126 |
+ return createDialogSelfAffiliation(); |
|
127 |
+ } |
|
128 |
+ |
|
129 |
+ /** |
|
130 |
+ * Create new Dialog Fragment |
|
131 |
+ * @return new Dialog Fragment |
|
132 |
+ */ |
|
133 |
+ public AlertDialog createDialogSelfAffiliation() { |
|
134 |
+ final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); |
|
135 |
+ builder.setTitle(title).setMessage(data) |
|
136 |
+ .setPositiveButton(buttonOk, new DialogInterface.OnClickListener() { |
|
137 |
+ @Override |
|
138 |
+ public void onClick(DialogInterface dialog, int id) { |
|
139 |
+ if(onClickOkButtonListener!=null) |
|
140 |
+ onClickOkButtonListener.onClickOkButton(); |
|
141 |
+ } |
|
142 |
+ }); |
|
143 |
+ |
|
144 |
+ if(isButtonCancel){ |
|
145 |
+ builder.setNegativeButton(buttonCancel, new DialogInterface.OnClickListener() { |
|
146 |
+ @Override |
|
147 |
+ public void onClick(DialogInterface dialog, int id) { |
|
148 |
+ if (BuildConfig.DEBUG)Log.d(TAG,"Cancel dialog."); |
|
149 |
+ |
|
150 |
+ } |
|
151 |
+ }); |
|
152 |
+ } |
|
153 |
+ return builder.create(); |
|
154 |
+ } |
|
155 |
+ |
|
156 |
+ |
|
157 |
+ |
|
158 |
+ public interface OnClickOkButtonListener{ |
|
159 |
+ void onClickOkButton(); |
|
160 |
+ } |
|
161 |
+ |
|
162 |
+ public void setOnClickOkButtonListener(OnClickOkButtonListener onClickOkButtonListener){ |
|
163 |
+ this.onClickOkButtonListener=onClickOkButtonListener; |
|
164 |
+ } |
|
165 |
+} |
... | ... |
@@ -1,1155 +1,1513 @@ |
1 |
-/* |
|
2 |
- * |
|
3 |
- * Copyright (C) 2018 Ander Nieva Anza |
|
4 |
- * Copyright (C) 2018, University of the Basque Country (UPV/EHU) |
|
5 |
- * |
|
6 |
- * Contact for licensing options: <licensing-mcpttclient(at)mcopenplatform(dot)com> |
|
7 |
- * |
|
8 |
- * This file is part of MCOP MCPTT Client |
|
9 |
- * |
|
10 |
- * This is free software: you can redistribute it and/or modify it under the terms of |
|
11 |
- * the GNU General Public License as published by the Free Software Foundation, either version 3 |
|
12 |
- * of the License, or (at your option) any later version. |
|
13 |
- * |
|
14 |
- * This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
15 |
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
16 |
- * See the GNU General Public License for more details. |
|
17 |
- * |
|
18 |
- * You should have received a copy of the GNU General Public License along |
|
19 |
- * with this program; if not, write to the Free Software Foundation, Inc., |
|
20 |
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
21 |
- */ |
|
22 |
- |
|
23 |
-package org.test.client.mcopclient; |
|
24 |
- |
|
25 |
-import android.Manifest; |
|
26 |
-import android.annotation.TargetApi; |
|
27 |
-import android.content.BroadcastReceiver; |
|
28 |
-import android.content.ComponentName; |
|
29 |
-import android.content.Context; |
|
30 |
-import android.content.Intent; |
|
31 |
-import android.content.IntentFilter; |
|
32 |
-import android.content.ServiceConnection; |
|
33 |
-import android.content.pm.PackageManager; |
|
34 |
-import android.media.AudioManager; |
|
35 |
-import android.net.Uri; |
|
36 |
-import android.os.Build; |
|
37 |
-import android.os.Bundle; |
|
38 |
-import android.os.Handler; |
|
39 |
-import android.os.IBinder; |
|
40 |
-import android.os.RemoteException; |
|
41 |
-import android.provider.Settings; |
|
42 |
-import android.support.v4.app.ActivityCompat; |
|
43 |
-import android.support.v4.content.ContextCompat; |
|
44 |
-import android.support.v7.app.AppCompatActivity; |
|
45 |
-import android.support.v7.widget.SwitchCompat; |
|
46 |
-import android.telephony.TelephonyManager; |
|
47 |
-import android.util.Log; |
|
48 |
-import android.view.MotionEvent; |
|
49 |
-import android.view.View; |
|
50 |
-import android.widget.AdapterView; |
|
51 |
-import android.widget.ArrayAdapter; |
|
52 |
-import android.widget.Button; |
|
53 |
-import android.widget.CompoundButton; |
|
54 |
-import android.widget.Spinner; |
|
55 |
-import android.widget.TextView; |
|
56 |
- |
|
57 |
-import org.mcopenplatform.muoapi.IMCOPCallback; |
|
58 |
-import org.mcopenplatform.muoapi.IMCOPsdk; |
|
59 |
-import org.test.client.mcopclient.datatype.UserData; |
|
60 |
-import org.test.client.mcopclient.preference.PreferencesManagerDefault; |
|
61 |
- |
|
62 |
-import java.net.URI; |
|
63 |
-import java.net.URISyntaxException; |
|
64 |
-import java.util.ArrayList; |
|
65 |
-import java.util.HashMap; |
|
66 |
-import java.util.HashSet; |
|
67 |
-import java.util.List; |
|
68 |
-import java.util.Map; |
|
69 |
-import java.util.Set; |
|
70 |
- |
|
71 |
- |
|
72 |
-public class MainActivity extends AppCompatActivity { |
|
73 |
- private final static String TAG = MainActivity.class.getCanonicalName(); |
|
74 |
- |
|
75 |
- private ServiceConnection mConnection; |
|
76 |
- private IMCOPsdk mService; |
|
77 |
- private IMCOPCallback mMCOPCallback; |
|
78 |
- private boolean isConnect=false; |
|
79 |
- private static final int ERROR_CODE_DEFAULT=-1; |
|
80 |
- private static final int AUTHETICATION_RESULT=101; |
|
81 |
- private static final int GET_PERMISSION = 102; |
|
82 |
- private static final boolean VALUE_BOOLEAN_DEFAULT=false; |
|
83 |
- private static UserData userData; |
|
84 |
- private static final int DEFAULT_REGISTER_DELAY = 4000; |
|
85 |
- |
|
86 |
- private static final String ACTION_BUTTON_PTT_DOWN_BITTIUM="com.elektrobit.pttbutton.PTTBUTTON_DOWN"; |
|
87 |
- private static final String ACTION_BUTTON_PTT_UP_BITTIUM="com.elektrobit.pttbutton.PTTBUTTON_UP"; |
|
88 |
- private static final String ACTION_BUTTON_PTT_LONG_PRESS_BITTIUM="com.elektrobit.pttbutton.PTTBUTTON_LONG_PRESS"; |
|
89 |
- private BroadcastReceiver mButtonPTTBroadCastRecvMCPTT; |
|
90 |
- |
|
91 |
- |
|
92 |
- private Button btn_register; |
|
93 |
- private Button btn_unregister; |
|
94 |
- private TextView text_info; |
|
95 |
- private TextView text_error; |
|
96 |
- private TextView text_affiliation; |
|
97 |
- private TextView text_status; |
|
98 |
- private Button btn_hangup; |
|
99 |
- private DialogMenu mDialogIds; |
|
100 |
- private Button btn_accept; |
|
101 |
- private Button reg_status; |
|
102 |
- private Button btn_call; |
|
103 |
- private Button btn_speaker; |
|
104 |
- private Button btn_aux2; |
|
105 |
- private TextView text_talking; |
|
106 |
- private TextView text_callingid; |
|
107 |
- private TextView switch_private; |
|
108 |
- private TextView switch_group; |
|
109 |
- private PreferencesManagerDefault preferencesManager; |
|
110 |
- private static final String PARAMETER_PROFILE = "parameters"; |
|
111 |
- private static final String PARAMETER_SAVE_PROFILE = TAG+".PARAMETER_SAVE_PROFILE"; |
|
112 |
- private Map<String, String> clients; |
|
113 |
- private DialogMenu mDialogMenu; |
|
114 |
- private String currentProfile; |
|
115 |
- private SwitchCompat switchCompat; |
|
116 |
- private Spinner spinnerGroups; |
|
117 |
- private Spinner spinnerUsers; |
|
118 |
- private Boolean isSpeakerphoneOn; |
|
119 |
- private ArrayList<String> groupsCurrent; |
|
120 |
- private Intent serviceIntent; |
|
121 |
- |
|
122 |
- private enum State { |
|
123 |
- GRANTED, |
|
124 |
- IDLE, |
|
125 |
- TAKEN, |
|
126 |
- NONE |
|
127 |
- } |
|
128 |
- private State mState = State.NONE; |
|
129 |
- private enum CallType { |
|
130 |
- PRIVATE, |
|
131 |
- GROUP |
|
132 |
- } |
|
133 |
- private CallType mCallType = CallType.GROUP; |
|
134 |
- private String selGroup = "sip:groupA@organization.org"; |
|
135 |
- private String selUser = "sip:mcptt_id_clientA@organization.org"; |
|
136 |
- |
|
137 |
- @Override |
|
138 |
- protected void onCreate(Bundle savedInstanceState) { |
|
139 |
- super.onCreate(savedInstanceState); |
|
140 |
- setContentView(R.layout.activity_main); |
|
141 |
- setPermissions(); |
|
142 |
- btn_register=(Button)findViewById(R.id.btn_register); |
|
143 |
- btn_unregister=(Button)findViewById(R.id.btn_unregister); |
|
144 |
- text_info=(TextView)findViewById(R.id.text_info); |
|
145 |
- text_error=(TextView)findViewById(R.id.text_error); |
|
146 |
- text_affiliation=(TextView)findViewById(R.id.text_affiliation); |
|
147 |
- text_status=(TextView)findViewById(R.id.text_status); |
|
148 |
- |
|
149 |
- btn_hangup=(Button)findViewById(R.id.btn_hangup); |
|
150 |
- btn_accept=(Button)findViewById(R.id.btn_accept); |
|
151 |
- reg_status=(Button)findViewById(R.id.reg_status); |
|
152 |
- btn_call=(Button)findViewById(R.id.btn_call); |
|
153 |
- btn_speaker=(Button)findViewById(R.id.btn_speaker); |
|
154 |
- btn_aux2=(Button)findViewById(R.id.btn_aux2); |
|
155 |
- text_talking=(TextView)findViewById(R.id.text_talking); |
|
156 |
- text_callingid=(TextView)findViewById(R.id.text_callingid); |
|
157 |
- switch_private=(TextView)findViewById(R.id.switch_private); |
|
158 |
- switch_group=(TextView)findViewById(R.id.switch_group); |
|
159 |
- switchCompat=(SwitchCompat)findViewById(R.id.switch_call); |
|
160 |
- spinnerGroups=(Spinner)findViewById(R.id.spinnerGroups); |
|
161 |
- spinnerUsers=(Spinner)findViewById(R.id.spinnerUsers); |
|
162 |
- |
|
163 |
- btn_unregister.setEnabled(false); |
|
164 |
- btn_call.setEnabled(false); |
|
165 |
- btn_call.setBackgroundResource(R.drawable.token_inactive); |
|
166 |
- btn_register.setEnabled(false); |
|
167 |
- btn_accept.setEnabled(false); |
|
168 |
- btn_hangup.setEnabled(false); |
|
169 |
- reg_status.setEnabled(false); |
|
170 |
- btn_speaker.setEnabled(false); |
|
171 |
- btn_aux2.setEnabled(false); |
|
172 |
- text_talking.setVisibility((View.INVISIBLE)); |
|
173 |
- text_callingid.setVisibility((View.INVISIBLE)); |
|
174 |
- switchCompat.setEnabled(false); |
|
175 |
- switch_group.setTextColor(ContextCompat.getColor(this, R.color.background)); |
|
176 |
- switch_private.setTextColor(ContextCompat.getColor(this, R.color.background)); |
|
177 |
- spinnerGroups.setEnabled(false); |
|
178 |
- spinnerGroups.setAdapter(null); |
|
179 |
- spinnerUsers.setEnabled(false); |
|
180 |
- spinnerUsers.setAdapter(null); |
|
181 |
- spinnerUsers.setVisibility((View.GONE)); |
|
182 |
- spinnerGroups.setVisibility((View.VISIBLE)); |
|
183 |
- isSpeakerphoneOn = false; |
|
184 |
- AudioManager mAudioManager; |
|
185 |
- mAudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE); |
|
186 |
- mAudioManager.setSpeakerphoneOn(isSpeakerphoneOn); |
|
187 |
- |
|
188 |
- //Dissable logging messages. Enable just for debugging |
|
189 |
- text_info.setVisibility((View.GONE)); |
|
190 |
- text_error.setVisibility((View.GONE)); |
|
191 |
- text_affiliation.setVisibility((View.GONE)); |
|
192 |
- |
|
193 |
- preferencesManager=new PreferencesManagerDefault(); |
|
194 |
- |
|
195 |
- clients = new HashMap<>(); |
|
196 |
- |
|
197 |
- if(clients==null || clients.isEmpty()){ |
|
198 |
- clients.put("TESTA", "TESTA"); |
|
199 |
- clients.put("TESTB", "TESTB"); |
|
200 |
- clients.put("TESTC", "TESTC"); |
|
201 |
- clients.put("TESTD", "TESTD"); |
|
202 |
- clients.put("TESTE", "TESTE"); |
|
203 |
- } |
|
204 |
- |
|
205 |
- List<String> usersCurrent = new ArrayList<String>(); |
|
206 |
- |
|
207 |
- if(usersCurrent.isEmpty()){ |
|
208 |
- usersCurrent.add("sip:mcptt_id_test_A@organization.org"); |
|
209 |
- usersCurrent.add("sip:mcptt_id_test_B@organization.org"); |
|
210 |
- usersCurrent.add("sip:mcptt_id_test_C@organization.org"); |
|
211 |
- usersCurrent.add("sip:mcptt_id_test_D@organization.org"); |
|
212 |
- usersCurrent.add("sip:mcptt_id_test_E@organization.org"); |
|
213 |
- } |
|
214 |
- |
|
215 |
- //Group list |
|
216 |
- groupsCurrent = new ArrayList<String>(); |
|
217 |
- groupsCurrent.add("sip:tets_group@organization.org"); |
|
218 |
- groupsCurrent.add("sip:groupTest2@organization.org"); |
|
219 |
- |
|
220 |
- //Adapter por User Spinner |
|
221 |
- ArrayAdapter<String> userAdaptor = new ArrayAdapter<>(getApplicationContext(), |
|
222 |
- android.R.layout.simple_spinner_item, usersCurrent); |
|
223 |
- // Drop down layout style - list view with radio button |
|
224 |
- userAdaptor.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); |
|
225 |
- spinnerUsers.setAdapter(userAdaptor); |
|
226 |
- |
|
227 |
- loadGroups(); |
|
228 |
- |
|
229 |
- |
|
230 |
- ArrayList<String> strings=getIntent().getStringArrayListExtra(PARAMETER_PROFILE); |
|
231 |
- Map<String, String> parameterClients= getProfilesParameters(strings); |
|
232 |
- if(parameterClients!=null && !parameterClients.isEmpty()) |
|
233 |
- clients=parameterClients; |
|
234 |
- |
|
235 |
- if(userData==null); |
|
236 |
- userData=new UserData(); |
|
237 |
- |
|
238 |
- mMCOPCallback=new IMCOPCallback.Stub() { |
|
239 |
- @Override |
|
240 |
- public void handleOnEvent(final List<Intent> actionList) throws RemoteException { |
|
241 |
- runOnUiThread(new Runnable() { |
|
242 |
- @Override |
|
243 |
- public void run() { |
|
244 |
- for(Intent action:actionList){ |
|
245 |
- int codeError=-1; |
|
246 |
- int eventTypeInt=-1; |
|
247 |
- String stringError=null; |
|
248 |
- String sessionID=null; |
|
249 |
- if(action!=null && action.getAction()!=null && !action.getAction().trim().isEmpty()) |
|
250 |
- try { |
|
251 |
- |
|
252 |
- switch (ConstantsMCOP.ActionsCallBack.fromString(action.getAction())){ |
|
253 |
- case none: |
|
254 |
- break; |
|
255 |
- case authorizationRequestEvent: |
|
256 |
- codeError=-1; |
|
257 |
- if((codeError=action.getIntExtra(ConstantsMCOP.AuthorizationRequestExtras.ERROR_CODE,ERROR_CODE_DEFAULT))!=ERROR_CODE_DEFAULT){ |
|
258 |
- //Error in authorizationRequestEvent |
|
259 |
- stringError=action.getStringExtra(ConstantsMCOP.AuthorizationRequestExtras.ERROR_STRING); |
|
260 |
- showLastError("authorizationRequestEvent",codeError,stringError); |
|
261 |
- }else { |
|
262 |
- //No error |
|
263 |
- String requestUri=null; |
|
264 |
- String redirect=null; |
|
265 |
- if((requestUri=action.getStringExtra(ConstantsMCOP.AuthorizationRequestExtras.REQUEST_URI))!=null && |
|
266 |
- (redirect=action.getStringExtra(ConstantsMCOP.AuthorizationRequestExtras.REDIRECT_URI))!=null |
|
267 |
- ){ |
|
268 |
- if(BuildConfig.DEBUG)Log.d(TAG,"onAuthentication URI: "+requestUri+ " redirectionURI: "+redirect); |
|
269 |
- } |
|
270 |
- } |
|
271 |
- break; |
|
272 |
- case loginEvent: |
|
273 |
- codeError=-1; |
|
274 |
- if((codeError=action.getIntExtra(ConstantsMCOP.LoginEventExtras.ERROR_CODE,ERROR_CODE_DEFAULT))!=ERROR_CODE_DEFAULT){ |
|
275 |
- //Error in LoginEvent |
|
276 |
- stringError=action.getStringExtra(ConstantsMCOP.LoginEventExtras.ERROR_STRING); |
|
277 |
- showLastError("LoginEvent",codeError,stringError); |
|
278 |
- }else { |
|
279 |
- //No error |
|
280 |
- boolean success=false; |
|
281 |
- String mcptt_id=null; |
|
282 |
- String displayName=null; |
|
283 |
- if((success=action.getBooleanExtra(ConstantsMCOP.LoginEventExtras.SUCCESS,VALUE_BOOLEAN_DEFAULT))==true && |
|
284 |
- (mcptt_id=action.getStringExtra(ConstantsMCOP.LoginEventExtras.MCPTT_ID))!=null |
|
285 |
- ){ |
|
286 |
- if(BuildConfig.DEBUG)Log.d(TAG,"Login success: "+success+ " mcptt_id: "+mcptt_id); |
|
287 |
- displayName=action.getStringExtra(ConstantsMCOP.LoginEventExtras.DISPLAY_NAME); |
|
288 |
- isRegisted(success,mcptt_id,displayName); |
|
289 |
- }else{ |
|
290 |
- Log.e(TAG,"Error: Registration process"); |
|
291 |
- } |
|
292 |
- } |
|
293 |
- break; |
|
294 |
- case unLoginEvent: |
|
295 |
- codeError=-1; |
|
296 |
- if((codeError=action.getIntExtra(ConstantsMCOP.UnLoginEventExtras.ERROR_CODE,ERROR_CODE_DEFAULT))!=ERROR_CODE_DEFAULT){ |
|
297 |
- //Error in unLoginEvent |
|
298 |
- stringError=action.getStringExtra(ConstantsMCOP.UnLoginEventExtras.ERROR_STRING); |
|
299 |
- showLastError("unLoginEvent",codeError,stringError); |
|
300 |
- }else { |
|
301 |
- //No error |
|
302 |
- boolean success=false; |
|
303 |
- if((success=action.getBooleanExtra(ConstantsMCOP.UnLoginEventExtras.SUCCESS,VALUE_BOOLEAN_DEFAULT))==true){ |
|
304 |
- unRegisted(success); |
|
305 |
- }else{ |
|
306 |
- Log.e(TAG,"Error: Unregistration process"); |
|
307 |
- } |
|
308 |
- } |
|
309 |
- break; |
|
310 |
- case configurationUpdateEvent: |
|
311 |
- break; |
|
312 |
- case callEvent: |
|
313 |
- codeError=-1; |
|
314 |
- eventTypeInt=action.getIntExtra(ConstantsMCOP.CallEventExtras.EVENT_TYPE,ERROR_CODE_DEFAULT); |
|
315 |
- ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum eventTypeCall=null; |
|
316 |
- |
|
317 |
- if(eventTypeInt!=ERROR_CODE_DEFAULT && |
|
318 |
- (eventTypeCall=ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum.fromInt(eventTypeInt))!=null ){ |
|
319 |
- switch (eventTypeCall) { |
|
320 |
- case NONE: |
|
321 |
- break; |
|
322 |
- case INCOMING: |
|
323 |
- Log.e(TAG,"STATE: INCOMING"); |
|
324 |
- stringError=action.getStringExtra(ConstantsMCOP.CallEventExtras.ERROR_STRING); |
|
325 |
- sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
326 |
- String callerID=action.getStringExtra(ConstantsMCOP.CallEventExtras.CALLER_USERID); |
|
327 |
- if(sessionID!=null)userData.addSessionID(sessionID); |
|
328 |
- showData("callEvent ("+sessionID+")","INCOMING "+"-> "+callerID); |
|
329 |
- text_talking.setVisibility((View.VISIBLE)); |
|
330 |
- text_callingid.setVisibility((View.VISIBLE)); |
|
331 |
- text_callingid.setText(callerID); |
|
332 |
- spinnerGroups.setEnabled(false); |
|
333 |
- spinnerUsers.setEnabled(false); |
|
334 |
- switchCompat.setEnabled(false); |
|
335 |
- showIdsAcceptCall(getApplicationContext(), sessionID); |
|
336 |
- break; |
|
337 |
- case RINGING: |
|
338 |
- Log.e(TAG,"STATE: RINGING"); |
|
339 |
- sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
340 |
- spinnerGroups.setEnabled(false); |
|
341 |
- spinnerUsers.setEnabled(false); |
|
342 |
- switchCompat.setEnabled(false); |
|
343 |
- showData("callEvent ("+sessionID+")","RINGING"); |
|
344 |
- if(sessionID!=null)userData.addSessionID(sessionID); |
|
345 |
- break; |
|
346 |
- case INPROGRESS: |
|
347 |
- Log.e(TAG,"STATE: INPROGRESS"); |
|
348 |
- sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
349 |
- spinnerGroups.setEnabled(false); |
|
350 |
- spinnerUsers.setEnabled(false); |
|
351 |
- switchCompat.setEnabled(false); |
|
352 |
- showData("callEvent ("+sessionID+")","INPROGRESS"); |
|
353 |
- if(sessionID!=null)userData.addSessionID(sessionID); |
|
354 |
- break; |
|
355 |
- case CONNECTED: |
|
356 |
- Log.e(TAG,"STATE: CONNECTED"); |
|
357 |
- sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
358 |
- showData("callEvent ("+sessionID+")","CONNECTED"); |
|
359 |
- break; |
|
360 |
- case TERMINATED: |
|
361 |
- Log.e(TAG,"STATE: TERMINATED"); |
|
362 |
- sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
363 |
- spinnerGroups.setEnabled(true); |
|
364 |
- spinnerUsers.setEnabled(true); |
|
365 |
- switchCompat.setEnabled(true); |
|
366 |
- switch_group.setTextColor(ContextCompat.getColor(getBaseContext(), R.color.white)); |
|
367 |
- switch_private.setTextColor(ContextCompat.getColor(getBaseContext(), R.color.white)); |
|
368 |
- showData("callEvent ("+sessionID+")","TERMINATED"); |
|
369 |
- if(sessionID!=null)userData.removeSessionID(sessionID); |
|
370 |
- btn_call.setBackgroundResource(R.drawable.token_default); |
|
371 |
- mState = State.NONE; |
|
372 |
- btn_call.setEnabled(true); |
|
373 |
- btn_hangup.setEnabled(false); |
|
374 |
- text_talking.setVisibility((View.INVISIBLE)); |
|
375 |
- text_callingid.setVisibility((View.INVISIBLE)); |
|
376 |
- break; |
|
377 |
- case ERROR: |
|
378 |
- Log.e(TAG,"STATE: ERROR"); |
|
379 |
- if((codeError=action.getIntExtra(ConstantsMCOP.CallEventExtras.ERROR_CODE,ERROR_CODE_DEFAULT))!=ERROR_CODE_DEFAULT){ |
|
380 |
- //Error in callEvent |
|
381 |
- stringError=action.getStringExtra(ConstantsMCOP.CallEventExtras.ERROR_STRING); |
|
382 |
- sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
383 |
- showLastError("callEvent ("+sessionID+")",codeError,stringError); |
|
384 |
- } |
|
385 |
- if(sessionID!=null)userData.addSessionID(sessionID); |
|
386 |
- break; |
|
387 |
- case UPDATE: |
|
388 |
- Log.e(TAG,"STATE: UPDATE"); |
|
389 |
- sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
390 |
- int updateCallType=action.getIntExtra(ConstantsMCOP.CallEventExtras.CALL_TYPE,ERROR_CODE_DEFAULT); |
|
391 |
- showData("callEvent ("+sessionID+")","UPDATE "+"-> CallType: "+updateCallType); |
|
392 |
- if(sessionID!=null)userData.addSessionID(sessionID); |
|
393 |
- break; |
|
394 |
- default: |
|
395 |
- showLastError("callEvent:",999,"RECEIVE EVENT NO VALID"); |
|
396 |
- break; |
|
397 |
- } |
|
398 |
- }else{ |
|
399 |
- showLastError("callEvent:",999,"RECEIVE EVENT NO VALID"); |
|
400 |
- } |
|
401 |
- break; |
|
402 |
- case floorControlEvent: |
|
403 |
- codeError=-1; |
|
404 |
- if((codeError=action.getIntExtra(ConstantsMCOP.FloorControlEventExtras.ERROR_CODE,ERROR_CODE_DEFAULT))!=ERROR_CODE_DEFAULT){ |
|
405 |
- //Error in unLoginEvent |
|
406 |
- sessionID=action.getStringExtra(ConstantsMCOP.FloorControlEventExtras.SESSION_ID); |
|
407 |
- stringError=action.getStringExtra(ConstantsMCOP.UnLoginEventExtras.ERROR_STRING); |
|
408 |
- showLastError("floorControlEvent("+sessionID+")",codeError,stringError); |
|
409 |
- }else { |
|
410 |
- //No error |
|
411 |
- boolean success=false; |
|
412 |
- String eventFloorControl=action.getStringExtra(ConstantsMCOP.FloorControlEventExtras.FLOOR_CONTROL_EVENT); |
|
413 |
- String causeString=null; |
|
414 |
- int causeInt=-1; |
|
415 |
- try{ |
|
416 |
- sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
417 |
- switch (ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum.fromString(eventFloorControl)) { |
|
418 |
- case none: |
|
419 |
- break; |
|
420 |
- case granted: |
|
421 |
- Log.e(TAG,"TOKEN GRANTED"); |
|
422 |
- int durationGranted=action.getIntExtra(ConstantsMCOP.FloorControlEventExtras.DURATION_TOKEN,ERROR_CODE_DEFAULT); |
|
423 |
- showData("floorControl ("+sessionID+")"," granted "+"-> Duration: "+durationGranted); |
|
424 |
- btn_call.setBackgroundResource(R.drawable.token_green); |
|
425 |
- mState = State.GRANTED; |
|
426 |
- btn_call.setEnabled(true); |
|
427 |
- btn_hangup.setEnabled(true); |
|
428 |
- break; |
|
429 |
- case idle: |
|
430 |
- Log.e(TAG,"TOKEN IDLE"); |
|
431 |
- showData("floorControl ("+sessionID+")"," idle"); |
|
432 |
- btn_call.setBackgroundResource(R.drawable.token_gray); |
|
433 |
- mState = State.IDLE; |
|
434 |
- btn_call.setEnabled(true); |
|
435 |
- btn_hangup.setEnabled(true); |
|
436 |
- text_talking.setVisibility((View.INVISIBLE)); |
|
437 |
- text_callingid.setVisibility((View.INVISIBLE)); |
|
438 |
- break; |
|
439 |
- case taken: |
|
440 |
- Log.e(TAG,"TOKEN TAKEN"); |
|
441 |
- String userIDTaken=action.getStringExtra(ConstantsMCOP.FloorControlEventExtras.USER_ID); |
|
442 |
- String displayNameTaken=action.getStringExtra(ConstantsMCOP.FloorControlEventExtras.DISPLAY_NAME); |
|
443 |
- boolean allow_request=action.getBooleanExtra(ConstantsMCOP.FloorControlEventExtras.ALLOW_REQUEST,VALUE_BOOLEAN_DEFAULT); |
|
444 |
- showData("floorControl ("+sessionID+")"," granted "+"-> userIDTaken(allowRequest="+allow_request+"):("+userIDTaken+":"+displayNameTaken+")"); |
|
445 |
- mState = State.TAKEN; |
|
446 |
- btn_call.setEnabled(false); |
|
447 |
- btn_hangup.setEnabled(true); |
|
448 |
- btn_call.setBackgroundResource(R.drawable.token_red); |
|
449 |
- text_talking.setVisibility((View.VISIBLE)); |
|
450 |
- text_callingid.setVisibility((View.VISIBLE)); |
|
451 |
- text_callingid.setText(userIDTaken); |
|
452 |
- break; |
|
453 |
- case denied: |
|
454 |
- Log.e(TAG,"TOKEN DENIED"); |
|
455 |
- causeString=action.getStringExtra(ConstantsMCOP.FloorControlEventExtras.CAUSE_STRING); |
|
456 |
- causeInt=action.getIntExtra(ConstantsMCOP.FloorControlEventExtras.CAUSE_CODE,ERROR_CODE_DEFAULT); |
|
457 |
- showData("floorControl ("+sessionID+")"," denied "+"-> cause("+causeInt+":"+causeString+")"); |
|
458 |
- break; |
|
459 |
- case revoked: |
|
460 |
- Log.e(TAG,"TOKEN REVOKED"); |
|
461 |
- causeString=action.getStringExtra(ConstantsMCOP.FloorControlEventExtras.CAUSE_STRING); |
|
462 |
- causeInt=action.getIntExtra(ConstantsMCOP.FloorControlEventExtras.CAUSE_CODE,ERROR_CODE_DEFAULT); |
|
463 |
- showData("floorControl ("+sessionID+")"," revoked "+"-> cause("+causeInt+":"+causeString+")"); |
|
464 |
- break; |
|
465 |
- default: |
|
466 |
- break; |
|
467 |
- } |
|
468 |
- }catch (Exception e){ |
|
469 |
- |
|
470 |
- } |
|
471 |
- } |
|
472 |
- |
|
473 |
- break; |
|
474 |
- case groupInfoEvent: |
|
475 |
- break; |
|
476 |
- case groupAffiliationEvent: |
|
477 |
- codeError=-1; |
|
478 |
- eventTypeInt=action.getIntExtra(ConstantsMCOP.GroupAffiliationEventExtras.EVENT_TYPE,ERROR_CODE_DEFAULT); |
|
479 |
- ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum eventTypeAffiliation=null; |
|
480 |
- if(eventTypeInt!=ERROR_CODE_DEFAULT && |
|
481 |
- (eventTypeAffiliation=ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum.fromInt(eventTypeInt))!=null ){ |
|
482 |
- switch (eventTypeAffiliation) { |
|
483 |
- case GROUP_AFFILIATION_UPDATE: |
|
484 |
- Map<String, Integer> groups=(HashMap<String, Integer>)action.getSerializableExtra(ConstantsMCOP.GroupAffiliationEventExtras.GROUPS_LIST); |
|
485 |
- if(groups!=null) |
|
486 |
- showGroups(groups); |
|
487 |
- break; |
|
488 |
- case GROUP_AFFILIATION_ERROR: |
|
489 |
- if((codeError=action.getIntExtra(ConstantsMCOP.GroupAffiliationEventExtras.ERROR_CODE,ERROR_CODE_DEFAULT))!=ERROR_CODE_DEFAULT){ |
|
490 |
- //Error in unLoginEvent |
|
491 |
- stringError=action.getStringExtra(ConstantsMCOP.GroupAffiliationEventExtras.ERROR_STRING); |
|
492 |
- String groupID=action.getStringExtra(ConstantsMCOP.GroupAffiliationEventExtras.GROUP_ID); |
|
493 |
- showLastError("groupAffiliationEvent ("+groupID+")",codeError,stringError); |
|
494 |
- } |
|
495 |
- break; |
|
496 |
- case REMOTE_AFFILIATION: |
|
497 |
- break; |
|
498 |
- default: |
|
499 |
- showLastError("groupAffiliationEvent:",999,"INVALID RECEIVE EVENT"); |
|
500 |
- break; |
|
501 |
- } |
|
502 |
- }else{ |
|
503 |
- showLastError("groupAffiliationEvent:",999,"INVALID RECEIVE EVENT"); |
|
504 |
- } |
|
505 |
- |
|
506 |
- break; |
|
507 |
- case selectedContactChangeEvent: |
|
508 |
- break; |
|
509 |
- case eMBMSNotificationEvent: |
|
510 |
- break; |
|
511 |
- } |
|
512 |
- }catch (Exception ex){ |
|
513 |
- Log.e(TAG,"Event Action Error: "+action.getAction()+" error:"+ex.getMessage()); |
|
514 |
- } |
|
515 |
- } |
|
516 |
- } |
|
517 |
- }); |
|
518 |
- } |
|
519 |
- }; |
|
520 |
- |
|
521 |
- btn_register.setOnClickListener(new View.OnClickListener() { |
|
522 |
- @Override |
|
523 |
- public void onClick(View view) { |
|
524 |
- //test |
|
525 |
- try { |
|
526 |
- if(mService!=null) |
|
527 |
- mService.authorizeUser(null); |
|
528 |
- } catch (RemoteException e) { |
|
529 |
- e.printStackTrace(); |
|
530 |
- } |
|
531 |
- /*try { |
|
532 |
- if(mService!=null) |
|
533 |
- mService.loginMCOP(); |
|
534 |
- } catch (RemoteException e) { |
|
535 |
- e.printStackTrace(); |
|
536 |
- }*/ |
|
537 |
- } |
|
538 |
- }); |
|
539 |
- |
|
540 |
- btn_unregister.setOnClickListener(new View.OnClickListener() { |
|
541 |
- @Override |
|
542 |
- public void onClick(View view) { |
|
543 |
- try { |
|
544 |
- if(mService!=null) |
|
545 |
- mService.unLoginMCOP(); |
|
546 |
- } catch (RemoteException e) { |
|
547 |
- e.printStackTrace(); |
|
548 |
- } |
|
549 |
- } |
|
550 |
- }); |
|
551 |
- |
|
552 |
- btn_hangup.setOnClickListener(new View.OnClickListener() { |
|
553 |
- @Override |
|
554 |
- public void onClick(View view) { |
|
555 |
- showIds(getApplicationContext()); |
|
556 |
- } |
|
557 |
- }); |
|
558 |
- |
|
559 |
- btn_accept.setOnClickListener(new View.OnClickListener() { |
|
560 |
- @Override |
|
561 |
- public void onClick(View view) { |
|
562 |
- //Auto-accept used |
|
563 |
- //showIdsAcceptCall(getApplicationContext()); |
|
564 |
- } |
|
565 |
- }); |
|
566 |
- |
|
567 |
- btn_speaker.setOnClickListener(new View.OnClickListener() { |
|
568 |
- @Override |
|
569 |
- public void onClick(View view) { |
|
570 |
- AudioManager mAudioManager; |
|
571 |
- mAudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE); |
|
572 |
- if(isSpeakerphoneOn){ |
|
573 |
- isSpeakerphoneOn=false; |
|
574 |
- Log.d(TAG, "Speaker false"); |
|
575 |
- btn_speaker.setText(R.string.btn_speaker_off); |
|
576 |
- }else{ |
|
577 |
- isSpeakerphoneOn=true; |
|
578 |
- Log.d(TAG, "Speaker true"); |
|
579 |
- btn_speaker.setText(R.string.btn_speaker_on); |
|
580 |
- } |
|
581 |
- mAudioManager.setSpeakerphoneOn(isSpeakerphoneOn); |
|
582 |
- } |
|
583 |
- }); |
|
584 |
- |
|
585 |
- switchCompat.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
|
586 |
- @Override |
|
587 |
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { |
|
588 |
- if(isChecked){ |
|
589 |
- // Switch is on. Private Call |
|
590 |
- mCallType = CallType.PRIVATE; |
|
591 |
- //Toast.makeText(getBaseContext(), "Selected: " + mCallType, Toast.LENGTH_SHORT).show(); |
|
592 |
- spinnerGroups.setVisibility((View.GONE)); |
|
593 |
- spinnerUsers.setVisibility((View.VISIBLE)); |
|
594 |
- spinnerGroups.setEnabled(false); |
|
595 |
- spinnerUsers.setEnabled(true); |
|
596 |
- } |
|
597 |
- else { |
|
598 |
- // Switch is off. Group Call |
|
599 |
- mCallType = CallType.GROUP; |
|
600 |
- //Toast.makeText(getBaseContext(), "Selected: " + mCallType, Toast.LENGTH_SHORT).show(); |
|
601 |
- spinnerUsers.setVisibility((View.GONE)); |
|
602 |
- spinnerGroups.setVisibility((View.VISIBLE)); |
|
603 |
- spinnerUsers.setEnabled(false); |
|
604 |
- spinnerGroups.setEnabled(true); |
|
605 |
- } |
|
606 |
- } |
|
607 |
- }); |
|
608 |
- |
|
609 |
- spinnerUsers.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { |
|
610 |
- @Override |
|
611 |
- public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { |
|
612 |
- selUser = parent.getItemAtPosition(position).toString(); |
|
613 |
- //Toast.makeText(parent.getContext(), "Selected: " + selUser, Toast.LENGTH_LONG).show(); |
|
614 |
- } |
|
615 |
- |
|
616 |
- @Override |
|
617 |
- public void onNothingSelected(AdapterView<?> parent) { |
|
618 |
- |
|
619 |
- } |
|
620 |
- }); |
|
621 |
- |
|
622 |
- spinnerGroups.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { |
|
623 |
- @Override |
|
624 |
- public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { |
|
625 |
- selGroup = parent.getItemAtPosition(position).toString(); |
|
626 |
- //Toast.makeText(parent.getContext(), "Selected: " + selGroup, Toast.LENGTH_LONG).show(); |
|
627 |
- } |
|
628 |
- |
|
629 |
- @Override |
|
630 |
- public void onNothingSelected(AdapterView<?> parent) { |
|
631 |
- |
|
632 |
- } |
|
633 |
- }); |
|
634 |
- |
|
635 |
- btn_call.setOnTouchListener(new View.OnTouchListener() { |
|
636 |
- @Override |
|
637 |
- public boolean onTouch(View v, MotionEvent event) { |
|
638 |
- if(mState != State.NONE && event.getAction() == MotionEvent.ACTION_DOWN) { |
|
639 |
- if (mState == State.IDLE) { |
|
640 |
- //Request token |
|
641 |
- Log.e(TAG,"TOKEN REQUEST"); |
|
642 |
- showIdsOperationFloorControl(getApplicationContext(), true); |
|
643 |
- } |
|
644 |
- }else if (mState != State.NONE && event.getAction() == MotionEvent.ACTION_UP) { |
|
645 |
- if (mState == State.GRANTED) { |
|
646 |
- //Release token |
|
647 |
- Log.e(TAG,"TOKEN RELEASE"); |
|
648 |
- showIdsOperationFloorControl(getApplicationContext(),false); |
|
649 |
- } |
|
650 |
- } else if (event.getAction() == MotionEvent.ACTION_DOWN){ |
|
651 |
- makeCall(); |
|
652 |
- } |
|
653 |
- return true; |
|
654 |
- } |
|
655 |
- }); |
|
656 |
- |
|
657 |
- |
|
658 |
- |
|
659 |
- |
|
660 |
- //PTT button on Bittium Devices |
|
661 |
- mButtonPTTBroadCastRecvMCPTT=new BroadcastReceiver() { |
|
662 |
- @Override |
|
663 |
- public void onReceive(Context context, Intent intent) { |
|
664 |
- Log.d(TAG,"PTT button"); |
|
665 |
- final String action = intent.getAction(); |
|
666 |
- if(action.compareTo(ACTION_BUTTON_PTT_DOWN_BITTIUM)==0 |
|
667 |
- ){ |
|
668 |
- |
|
669 |
- Log.d(TAG,"PTT button Down"); |
|
670 |
- if(mState==State.IDLE && !showIdsOperationFloorControl(getApplicationContext(), true)){ |
|
671 |
- Log.e(TAG,"Error: the device can´t request the Token now"); |
|
672 |
- }else if(mState==null || mState==State.NONE){ |
|
673 |
- makeCall(); |
|
674 |
- } |
|
675 |
- }else if(action.compareTo(ACTION_BUTTON_PTT_UP_BITTIUM)==0 && mState==State.GRANTED){ |
|
676 |
- Log.d(TAG,"PTT button Up"); |
|
677 |
- if(!showIdsOperationFloorControl(getApplicationContext(), false)){ |
|
678 |
- Log.e(TAG,"Error: the device can´t release the Token now"); |
|
679 |
- } |
|
680 |
- }else if(action.compareTo(ACTION_BUTTON_PTT_LONG_PRESS_BITTIUM)==0){ |
|
681 |
- Log.d(TAG,"Long PTT button press"); |
|
682 |
- } |
|
683 |
- } |
|
684 |
- }; |
|
685 |
- final IntentFilter intentFilter2 = new IntentFilter(); |
|
686 |
- intentFilter2.addAction(ACTION_BUTTON_PTT_DOWN_BITTIUM); |
|
687 |
- intentFilter2.addAction(ACTION_BUTTON_PTT_UP_BITTIUM); |
|
688 |
- intentFilter2.addAction(ACTION_BUTTON_PTT_LONG_PRESS_BITTIUM); |
|
689 |
- |
|
690 |
- if(mConnection==null) |
|
691 |
- mConnection = new ServiceConnection() { |
|
692 |
- |
|
693 |
- @Override |
|
694 |
- public void onServiceConnected(ComponentName className, IBinder service) { |
|
695 |
- Log.e(TAG,"Service binded! "+className.getPackageName()+"\n"); |
|
696 |
- mService = IMCOPsdk.Stub.asInterface(service); |
|
697 |
- |
|
698 |
- try { |
|
699 |
- Log.d(TAG,"execute "+"registerCallback"+mMCOPCallback); |
|
700 |
- mService.registerCallback(mMCOPCallback); |
|
701 |
- } catch (RemoteException e) { |
|
702 |
- e.printStackTrace(); |
|
703 |
- } |
|
704 |
- isConnect=true; |
|
705 |
- |
|
706 |
- //AUTO Register |
|
707 |
- final Handler handler = new Handler(); |
|
708 |
- handler.postDelayed(new Runnable() { |
|
709 |
- @Override |
|
710 |
- public void run() { |
|
711 |
- try { |
|
712 |
- if(mService!=null) |
|
713 |
- mService.authorizeUser(null); |
|
714 |
- } catch (RemoteException e) { |
|
715 |
- e.printStackTrace(); |
|
716 |
- } |
|
717 |
- } |
|
718 |
- }, DEFAULT_REGISTER_DELAY); |
|
719 |
- } |
|
720 |
- |
|
721 |
- @Override |
|
722 |
- public void onServiceDisconnected(ComponentName className) { |
|
723 |
- mService = null; |
|
724 |
- // This method is only invoked when the service quits from the other end or gets killed |
|
725 |
- // Invoking exit() from the AIDL interface makes the Service kill itself, thus invoking this. |
|
726 |
- Log.e(TAG,"Service disconnected.\n"); |
|
727 |
- isConnect=false; |
|
728 |
- } |
|
729 |
- }; |
|
730 |
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) { |
|
731 |
- TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE); |
|
732 |
- if(tm!=null) { |
|
733 |
- String imei = tm.getDeviceId(); |
|
734 |
- String client=clients.get(imei); |
|
735 |
- if(client!=null){ |
|
736 |
- this.currentProfile=client; |
|
737 |
- Log.i(TAG,"currentProfile: " +currentProfile); |
|
738 |
- connectService(currentProfile); |
|
739 |
- }else{ |
|
740 |
- showOptionsProfiles(clients, this); |
|
741 |
- } |
|
742 |
- } |
|
743 |
- }else{ |
|
744 |
- showOptionsProfiles(clients, this); |
|
745 |
- } |
|
746 |
- } |
|
747 |
- |
|
748 |
- private void loadGroups(){ |
|
749 |
- //Adapter por Group Spinner |
|
750 |
- ArrayAdapter<String> groupAdaptor = new ArrayAdapter<>(getApplicationContext(), |
|
751 |
- android.R.layout.simple_spinner_item, groupsCurrent); |
|
752 |
- // Drop down layout style - list view with radio button |
|
753 |
- groupAdaptor.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); |
|
754 |
- spinnerGroups.setAdapter(groupAdaptor); |
|
755 |
- } |
|
756 |
- |
|
757 |
- private void makeCall(){ |
|
758 |
- if (mCallType == CallType.GROUP) { |
|
759 |
- //Group Call |
|
760 |
- try { |
|
761 |
- Log.e(TAG,"Call type: "+mCallType); |
|
762 |
- if(mService!=null) |
|
763 |
- mService.makeCall( |
|
764 |
- selGroup, //DEFAULT_GROUP, |
|
765 |
- ConstantsMCOP.CallEventExtras.CallTypeEnum.Audio.getValue() | |
|
766 |
- ConstantsMCOP.CallEventExtras.CallTypeEnum.WithFloorCtrl.getValue() | |
|
767 |
- ConstantsMCOP.CallEventExtras.CallTypeEnum.PrearrangedGroup.getValue() |
|
768 |
- ); |
|
769 |
- } catch (RemoteException e) { |
|
770 |
- e.printStackTrace(); |
|
771 |
- } |
|
772 |
- } else if (mCallType == CallType.PRIVATE) { |
|
773 |
- //Private Call |
|
774 |
- try { |
|
775 |
- Log.e(TAG,"Call type: "+mCallType); |
|
776 |
- if(mService!=null) |
|
777 |
- mService.makeCall( |
|
778 |
- selUser, //DEFAULT_PRIVATE_CALL, |
|
779 |
- ConstantsMCOP.CallEventExtras.CallTypeEnum.Audio.getValue() | |
|
780 |
- ConstantsMCOP.CallEventExtras.CallTypeEnum.WithFloorCtrl.getValue() | |
|
781 |
- ConstantsMCOP.CallEventExtras.CallTypeEnum.Private.getValue() |
|
782 |
- ); |
|
783 |
- } catch (RemoteException e) { |
|
784 |
- e.printStackTrace(); |
|
785 |
- } |
|
786 |
- } |
|
787 |
- btn_hangup.setEnabled(true); |
|
788 |
- } |
|
789 |
- |
|
790 |
- private void showIds(final Context context){ |
|
791 |
- if(userData.getSessionIDs()==null)return; |
|
792 |
- final String[] strings=userData.getSessionIDs().toArray(new String[userData.getSessionIDs().size()]); |
|
793 |
- if(strings==null || strings.length==0)return; |
|
794 |
- if(strings.length==1) { |
|
795 |
- try { |
|
796 |
- if (mService != null) |
|
797 |
- mService.hangUpCall(strings[0]); |
|
798 |
- } catch (RemoteException e) { |
|
799 |
- e.printStackTrace(); |
|
800 |
- } |
|
801 |
- } else { |
|
802 |
- mDialogIds = DialogMenu.newInstance(strings, null); |
|
803 |
- mDialogIds.setOnClickItemListener(new DialogMenu.OnClickListener() { |
|
804 |
- @Override |
|
805 |
- public void onClickItem(int item) { |
|
806 |
- if (item >= 0 && strings.length > item) { |
|
807 |
- try { |
|
808 |
- if (mService != null) |
|
809 |
- mService.hangUpCall(strings[item]); |
|
810 |
- } catch (RemoteException e) { |
|
811 |
- e.printStackTrace(); |
|
812 |
- } |
|
813 |
- |
|
814 |
- } |
|
815 |
- } |
|
816 |
- }); |
|
817 |
- mDialogIds.show(getSupportFragmentManager(), "SimpleDialog"); |
|
818 |
- } |
|
819 |
- } |
|
820 |
- |
|
821 |
- private boolean showIdsOperationFloorControl(final Context context, final boolean request){ |
|
822 |
- Log.i(TAG,"Send floor control operation : "+((request)?"request":"release")); |
|
823 |
- if(userData.getSessionIDs()==null)return false; |
|
824 |
- final String[] strings=userData.getSessionIDs().toArray(new String[userData.getSessionIDs().size()]); |
|
825 |
- if(strings==null || strings.length==0)return false; |
|
826 |
- if(strings.length==1) { |
|
827 |
- try { |
|
828 |
- if (mService != null){ |
|
829 |
- mService.floorControlOperation( |
|
830 |
- strings[0], |
|
831 |
- request ? ConstantsMCOP.FloorControlEventExtras.FloorControlOperationTypeEnum.MCPTT_Request.getValue() : ConstantsMCOP.FloorControlEventExtras.FloorControlOperationTypeEnum.MCPTT_Release.getValue(), |
|
832 |
- null); |
|
833 |
- } |
|
834 |
- Log.i(TAG,"Send floor control operation 2: "+((request)?"request":"release")); |
|
835 |
- |
|
836 |
- } catch (RemoteException e) { |
|
837 |
- e.printStackTrace(); |
|
838 |
- } |
|
839 |
- } else { |
|
840 |
- mDialogIds = DialogMenu.newInstance(strings, null); |
|
841 |
- mDialogIds.setOnClickItemListener(new DialogMenu.OnClickListener() { |
|
842 |
- @Override |
|
843 |
- public void onClickItem(int item) { |
|
844 |
- if (item >= 0 && strings.length > item) { |
|
845 |
- try { |
|
846 |
- if (mService != null){ |
|
847 |
- mService.floorControlOperation( |
|
848 |
- strings[item], |
|
849 |
- request ? ConstantsMCOP.FloorControlEventExtras.FloorControlOperationTypeEnum.MCPTT_Request.getValue() : ConstantsMCOP.FloorControlEventExtras.FloorControlOperationTypeEnum.MCPTT_Release.getValue(), |
|
850 |
- null); |
|
851 |
- Log.i(TAG,"Send floor control operation 3: "+((request)?"request":"release")); |
|
852 |
- } |
|
853 |
- |
|
854 |
- } catch (RemoteException e) { |
|
855 |
- e.printStackTrace(); |
|
856 |
- } |
|
857 |
- } |
|
858 |
- } |
|
859 |
- }); |
|
860 |
- mDialogIds.show(getSupportFragmentManager(), "SimpleDialog"); |
|
861 |
- } |
|
862 |
- return true; |
|
863 |
- } |
|
864 |
- |
|
865 |
- private void showIdsAcceptCall(final Context context, String sessionID){ |
|
866 |
- if(userData.getSessionIDs()==null)return; |
|
867 |
- final String[] strings=userData.getSessionIDs().toArray(new String[userData.getSessionIDs().size()]); |
|
868 |
- if(strings==null)return; |
|
869 |
- try { |
|
870 |
- if(mService!=null) |
|
871 |
- mService.acceptCall(sessionID); |
|
872 |
- btn_call.setBackgroundResource(R.drawable.token_red); |
|
873 |
- } catch (RemoteException e) { |
|
874 |
- e.printStackTrace(); |
|
875 |
- } |
|
876 |
- } |
|
877 |
- |
|
878 |
- @Override |
|
879 |
- protected void onDestroy(){ |
|
880 |
- if(BuildConfig.DEBUG)Log.i(TAG,"onDestroy"); |
|
881 |
- super.onDestroy(); |
|
882 |
- isConnect=false; |
|
883 |
- if(mConnection!=null && isConnect) |
|
884 |
- try{ |
|
885 |
- unbindService(mConnection); |
|
886 |
- }catch (Exception e){ |
|
887 |
- Log.e(TAG,"Error in unbind Service"); |
|
888 |
- } |
|
889 |
- if(serviceIntent!=null); |
|
890 |
- /* |
|
891 |
- try{ |
|
892 |
- stopService(serviceIntent); |
|
893 |
- }catch (Exception e){ |
|
894 |
- Log.e(TAG,"Error in stop Service"); |
|
895 |
- } |
|
896 |
- */ |
|
897 |
- mConnection=null; |
|
898 |
- } |
|
899 |
- |
|
900 |
- @Override |
|
901 |
- protected void onActivityResult(int requestCode, int resultCode, Intent data) { |
|
902 |
- switch (requestCode){ |
|
903 |
- } |
|
904 |
- } |
|
905 |
- |
|
906 |
- //START GUI |
|
907 |
- private void unRegisted(boolean success){ |
|
908 |
- userData.setRegisted(false); |
|
909 |
- userData.setDisplayName(null); |
|
910 |
- userData.setMcpttID(null); |
|
911 |
- text_info.setText("UNREGISTEREDD"); |
|
912 |
- text_status.setText(getString(R.string.text_status)); |
|
913 |
- btn_call.setEnabled(false); |
|
914 |
- btn_call.setBackgroundResource(R.drawable.token_inactive); |
|
915 |
- btn_unregister.setEnabled(false); |
|
916 |
- btn_register.setEnabled(true); |
|
917 |
- reg_status.setEnabled(false); |
|
918 |
- switchCompat.setEnabled(false); |
|
919 |
- switch_group.setTextColor(ContextCompat.getColor(this, R.color.background)); |
|
920 |
- switch_private.setTextColor(ContextCompat.getColor(this, R.color.background)); |
|
921 |
- spinnerGroups.setEnabled(false); |
|
922 |
- spinnerUsers.setEnabled(false); |
|
923 |
- btn_speaker.setEnabled(false); |
|
924 |
- isSpeakerphoneOn=false; |
|
925 |
- btn_speaker.setText(R.string.btn_speaker_off); |
|
926 |
- } |
|
927 |
- |
|
928 |
- private void isRegisted(boolean success,String mcpttID,String displayName){ |
|
929 |
- userData.setRegisted(success); |
|
930 |
- if(mcpttID!=null) |
|
931 |
- userData.setMcpttID(mcpttID); |
|
932 |
- if(displayName!=null){ |
|
933 |
- userData.setDisplayName(displayName); |
|
934 |
- } |
|
935 |
- text_info.setText("REGISTERED "+"MCPTT ID: "+mcpttID+" DISPLAY NAME: "+displayName); |
|
936 |
- text_status.setText(displayName); |
|
937 |
- btn_unregister.setEnabled(true); |
|
938 |
- btn_register.setEnabled(false); |
|
939 |
- btn_call.setBackgroundResource(R.drawable.token_default); |
|
940 |
- reg_status.setEnabled(true); |
|
941 |
- btn_call.setEnabled(true); |
|
942 |
- switchCompat.setEnabled(true); |
|
943 |
- switchCompat.setChecked(false); |
|
944 |
- switch_group.setTextColor(ContextCompat.getColor(this, R.color.white)); |
|
945 |
- switch_private.setTextColor(ContextCompat.getColor(this, R.color.white)); |
|
946 |
- spinnerGroups.setEnabled(true); |
|
947 |
- spinnerUsers.setEnabled(false); |
|
948 |
- spinnerUsers.setVisibility((View.GONE)); |
|
949 |
- spinnerGroups.setVisibility((View.VISIBLE)); |
|
950 |
- btn_speaker.setEnabled(true); |
|
951 |
- } |
|
952 |
- |
|
953 |
- private void showData(String eventType,String data){ |
|
954 |
- text_info.setText(eventType+": "+data); |
|
955 |
- } |
|
956 |
- |
|
957 |
- private void showLastError(String from,int code,String errorString){ |
|
958 |
- Log.e(TAG,"ERROR "+from+": "+code+" "+errorString); |
|
959 |
- text_info.setText("ERROR "+from+": "+code+" "+errorString); |
|
960 |
- } |
|
961 |
- |
|
962 |
- private void showGroups(Map<String, Integer> groups){ |
|
963 |
- String result=""; |
|
964 |
- if(groups!=null){ |
|
965 |
- groupsCurrent=new ArrayList<>(); |
|
966 |
- for (String groupID:groups.keySet()){ |
|
967 |
- String type=""; |
|
968 |
- switch (ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationStateEnum.fromInt(groups.get(groupID))){ |
|
969 |
- case notaffiliated: |
|
970 |
- type="notaffiliated"; |
|
971 |
- break; |
|
972 |
- case affiliating: |
|
973 |
- type="affiliating"; |
|
974 |
- break; |
|
975 |
- case affiliated: |
|
976 |
- type="affiliated"; |
|
977 |
- groupsCurrent.add(groupID); |
|
978 |
- break; |
|
979 |
- case deaffiliating: |
|
980 |
- type="deaffiliating"; |
|
981 |
- break; |
|
982 |
- } |
|
983 |
- result=result+"groupID:"+groupID+":"+type+"\n"; |
|
984 |
- } |
|
985 |
- loadGroups(); |
|
986 |
- } |
|
987 |
- |
|
988 |
- text_affiliation.setText("List Affiliation Groups: \n"+result); |
|
989 |
- } |
|
990 |
- |
|
991 |
- /** |
|
992 |
- * Set permissions for Android 6.0 or above |
|
993 |
- */ |
|
994 |
- protected void setPermissions(){ |
|
995 |
- //Set permissions |
|
996 |
- //READ_PHONE_STATE |
|
997 |
- if (ContextCompat.checkSelfPermission(this, |
|
998 |
- Manifest.permission.RECORD_AUDIO) |
|
999 |
- != PackageManager.PERMISSION_GRANTED || |
|
1000 |
- ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED || |
|
1001 |
- ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED || |
|
1002 |
- ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED || |
|
1003 |
- ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED |
|
1004 |
- ) { |
|
1005 |
- if (ActivityCompat.shouldShowRequestPermissionRationale(this, |
|
1006 |
- Manifest.permission.RECORD_AUDIO)) { |
|
1007 |
- //Show an explanation to the user *asynchronously* -- don't block |
|
1008 |
- //this thread waiting for the user's response! After the user |
|
1009 |
- //sees the explanation, request the permission again. |
|
1010 |
- ActivityCompat.requestPermissions(this, |
|
1011 |
- new String[]{Manifest.permission.RECORD_AUDIO,Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.CAMERA,Manifest.permission.READ_PHONE_STATE}, |
|
1012 |
- GET_PERMISSION); |
|
1013 |
- } else { |
|
1014 |
- //No explanation needed, we can request the permission. |
|
1015 |
- ActivityCompat.requestPermissions(this, |
|
1016 |
- new String[]{Manifest.permission.RECORD_AUDIO,Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.CAMERA,Manifest.permission.READ_PHONE_STATE}, |
|
1017 |
- GET_PERMISSION); |
|
1018 |
- |
|
1019 |
- //MY_PERMISSIONS_REQUEST_READ_CONTACTS is an |
|
1020 |
- //app-defined int constant. The callback method gets the |
|
1021 |
- //result of the request. |
|
1022 |
- } |
|
1023 |
- } |
|
1024 |
- } |
|
1025 |
- |
|
1026 |
- @Override |
|
1027 |
- public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { |
|
1028 |
- super.onRequestPermissionsResult(requestCode, permissions,grantResults); |
|
1029 |
- switch (requestCode) { |
|
1030 |
- case GET_PERMISSION: { |
|
1031 |
- //If request is cancelled, result arrays are empty. |
|
1032 |
- if (grantResults.length > 0 |
|
1033 |
- && grantResults[0] == PackageManager.PERMISSION_GRANTED) { |
|
1034 |
- //Permission was granted, yay! Do the |
|
1035 |
- //contacts-related task you need to do. |
|
1036 |
- //API>22 |
|
1037 |
- setPermissionsWriteSetting(); |
|
1038 |
- } else { |
|
1039 |
- setPermissions(); |
|
1040 |
- //Permission denied, boo! Disable the |
|
1041 |
- //functionality that depends on this permission. |
|
1042 |
- } |
|
1043 |
- return; |
|
1044 |
- } |
|
1045 |
- default: |
|
1046 |
- break; |
|
1047 |
- //other 'case' lines to check for other |
|
1048 |
- //permissions this app might request |
|
1049 |
- } |
|
1050 |
- } |
|
1051 |
- |
|
1052 |
- /** |
|
1053 |
- * API>22 |
|
1054 |
- */ |
|
1055 |
- @TargetApi(Build.VERSION_CODES.M) |
|
1056 |
- protected void setPermissionsWriteSetting(){ |
|
1057 |
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |
|
1058 |
- if (Settings.System.canWrite(this) ){ |
|
1059 |
- //Do stuff here |
|
1060 |
- } |
|
1061 |
- else { |
|
1062 |
- Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_WRITE_SETTINGS); |
|
1063 |
- intent.setData(Uri.parse("package:" + this.getPackageName())); |
|
1064 |
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
|
1065 |
- startActivity(intent); |
|
1066 |
- } |
|
1067 |
- } |
|
1068 |
- } |
|
1069 |
- //END GUI |
|
1070 |
- |
|
1071 |
- private Map<String,String> getProfilesParameters(List<String> parameters){ |
|
1072 |
- Map<String,String> parametersMap=new HashMap<>(); |
|
1073 |
- if(parameters!=null && !parameters.isEmpty()){ |
|
1074 |
- Log.i(TAG,"we external parameters"); |
|
1075 |
- }else{ |
|
1076 |
- Log.i(TAG,"we don´t have external parameters"); |
|
1077 |
- parameters=loadParameters(); |
|
1078 |
- } |
|
1079 |
- |
|
1080 |
- if(parameters!=null && !parameters.isEmpty()) |
|
1081 |
- for (String parameter:parameters){ |
|
1082 |
- Log.i(TAG,"parameter: "+parameter); |
|
1083 |
- String[] parametersSplit=parameter.split(":"); |
|
1084 |
- if(parametersSplit!=null && parametersSplit.length==2){ |
|
1085 |
- parametersMap.put(parametersSplit[0],parametersSplit[1]); |
|
1086 |
- } |
|
1087 |
- } |
|
1088 |
- if(parametersMap!=null && !parametersMap.isEmpty()){ |
|
1089 |
- saveParameters(parameters); |
|
1090 |
- } |
|
1091 |
- return parametersMap; |
|
1092 |
- } |
|
1093 |
- |
|
1094 |
- private boolean saveParameters(List<String> parameters){ |
|
1095 |
- if(preferencesManager!=null){ |
|
1096 |
- return preferencesManager.putStringSet(this,PARAMETER_SAVE_PROFILE,new HashSet<String>(parameters)); |
|
1097 |
- } |
|
1098 |
- return false; |
|
1099 |
- } |
|
1100 |
- |
|
1101 |
- private ArrayList<String> loadParameters(){ |
|
1102 |
- if(preferencesManager!=null){ |
|
1103 |
- Set<String> stringSet=preferencesManager.getStringSet(this,PARAMETER_SAVE_PROFILE); |
|
1104 |
- if(stringSet!=null){ |
|
1105 |
- return (new ArrayList<String>(stringSet)); |
|
1106 |
- } |
|
1107 |
- } |
|
1108 |
- return null; |
|
1109 |
- } |
|
1110 |
- |
|
1111 |
- private void showOptionsProfiles(Map<String,String> stringsList,final Context context){ |
|
1112 |
- if(stringsList==null)return; |
|
1113 |
- final String[] strings=stringsList.values().toArray(new String[stringsList.size()]); |
|
1114 |
- if(strings==null || strings.length==0)return; |
|
1115 |
- mDialogMenu = DialogMenu.newInstance(strings,null); |
|
1116 |
- mDialogMenu.setOnClickItemListener(new DialogMenu.OnClickListener() { |
|
1117 |
- @Override |
|
1118 |
- public void onClickItem(int item) { |
|
1119 |
- if(item>=0 && strings.length>item){ |
|
1120 |
- Log.d(TAG,"Select profile: "+strings[item]); |
|
1121 |
- connectService(strings[item]); |
|
1122 |
- } |
|
1123 |
- } |
|
1124 |
- }); |
|
1125 |
- mDialogMenu.show(getSupportFragmentManager(), "SimpleDialog"); |
|
1126 |
- } |
|
1127 |
- |
|
1128 |
- private void connectService(String client){ |
|
1129 |
- if(!isConnect){ |
|
1130 |
- serviceIntent = new Intent() |
|
1131 |
- .setComponent(new ComponentName( |
|
1132 |
- "org.mcopenplatform.muoapi", |
|
1133 |
- "org.mcopenplatform.muoapi.MCOPsdk")); |
|
1134 |
- |
|
1135 |
- Log.i(TAG,"Current profile: "+currentProfile); |
|
1136 |
- serviceIntent.putExtra("PROFILE_SELECT", currentProfile!=null?currentProfile:client); |
|
1137 |
- |
|
1138 |
- try{ |
|
1139 |
- ComponentName componentName=this.startService(serviceIntent); |
|
1140 |
- if(componentName==null){ |
|
1141 |
- Log.e(TAG,"Starting Error: "+componentName.getPackageName()); |
|
1142 |
- }else if(serviceIntent==null){ |
|
1143 |
- Log.e(TAG,"serviceIntent Error: "+componentName.getPackageName()); |
|
1144 |
- }else if(mConnection==null){ |
|
1145 |
- Log.e(TAG,"mConnection Error: "+componentName.getPackageName()); |
|
1146 |
- }else{ |
|
1147 |
- |
|
1148 |
- } |
|
1149 |
- }catch (Exception e){ |
|
1150 |
- if(BuildConfig.DEBUG)Log.w(TAG,"Error in start service: "+e.getMessage()); |
|
1151 |
- } |
|
1152 |
- Log.i(TAG,"Bind Service: "+bindService(serviceIntent, mConnection, BIND_AUTO_CREATE)); |
|
1153 |
- } |
|
1154 |
- } |
|
1 |
+/* |
|
2 |
+ * |
|
3 |
+ * Copyright (C) 2018, University of the Basque Country (UPV/EHU) |
|
4 |
+ * |
|
5 |
+ * Contact for licensing options: <licensing-mcpttclient(at)mcopenplatform(dot)com> |
|
6 |
+ * |
|
7 |
+ * This file is part of MCOP MCPTT Client |
|
8 |
+ * |
|
9 |
+ * This is free software: you can redistribute it and/or modify it under the terms of |
|
10 |
+ * the GNU General Public License as published by the Free Software Foundation, either version 3 |
|
11 |
+ * of the License, or (at your option) any later version. |
|
12 |
+ * |
|
13 |
+ * This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
14 |
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
15 |
+ * See the GNU General Public License for more details. |
|
16 |
+ * |
|
17 |
+ * You should have received a copy of the GNU General Public License along |
|
18 |
+ * with this program; if not, write to the Free Software Foundation, Inc., |
|
19 |
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
+ */ |
|
21 |
+ |
|
22 |
+package org.test.client.mcopclient; |
|
23 |
+ |
|
24 |
+import android.Manifest; |
|
25 |
+import android.annotation.TargetApi; |
|
26 |
+import android.content.BroadcastReceiver; |
|
27 |
+import android.content.ComponentName; |
|
28 |
+import android.content.Context; |
|
29 |
+import android.content.Intent; |
|
30 |
+import android.content.IntentFilter; |
|
31 |
+import android.content.ServiceConnection; |
|
32 |
+import android.content.pm.PackageInfo; |
|
33 |
+import android.content.pm.PackageManager; |
|
34 |
+import android.media.AudioManager; |
|
35 |
+import android.net.Uri; |
|
36 |
+import android.os.Build; |
|
37 |
+import android.os.Bundle; |
|
38 |
+import android.os.Handler; |
|
39 |
+import android.os.IBinder; |
|
40 |
+import android.os.RemoteException; |
|
41 |
+import android.provider.Settings; |
|
42 |
+import android.support.design.widget.AppBarLayout; |
|
43 |
+import android.support.v4.app.ActivityCompat; |
|
44 |
+import android.support.v4.content.ContextCompat; |
|
45 |
+import android.support.v7.app.AppCompatActivity; |
|
46 |
+import android.support.v7.widget.SwitchCompat; |
|
47 |
+import android.support.v7.widget.Toolbar; |
|
48 |
+import android.telephony.TelephonyManager; |
|
49 |
+import android.util.Log; |
|
50 |
+import android.view.Menu; |
|
51 |
+import android.view.MenuItem; |
|
52 |
+import android.view.MotionEvent; |
|
53 |
+import android.view.View; |
|
54 |
+import android.widget.AdapterView; |
|
55 |
+import android.widget.ArrayAdapter; |
|
56 |
+import android.widget.Button; |
|
57 |
+import android.widget.CompoundButton; |
|
58 |
+import android.widget.Spinner; |
|
59 |
+import android.widget.TextView; |
|
60 |
+import android.widget.Toast; |
|
61 |
+ |
|
62 |
+import org.mcopenplatform.muoapi.IMCOPCallback; |
|
63 |
+import org.mcopenplatform.muoapi.IMCOPsdk; |
|
64 |
+import org.test.client.mcopclient.datatype.UserData; |
|
65 |
+import org.test.client.mcopclient.preference.PreferencesManagerDefault; |
|
66 |
+ |
|
67 |
+import java.net.URI; |
|
68 |
+import java.net.URISyntaxException; |
|
69 |
+import java.util.ArrayList; |
|
70 |
+import java.util.HashMap; |
|
71 |
+import java.util.HashSet; |
|
72 |
+import java.util.List; |
|
73 |
+import java.util.Map; |
|
74 |
+import java.util.Set; |
|
75 |
+ |
|
76 |
+ |
|
77 |
+public class MainActivity extends AppCompatActivity { |
|
78 |
+ private final static String TAG = MainActivity.class.getCanonicalName(); |
|
79 |
+ |
|
80 |
+ private ServiceConnection mConnection; |
|
81 |
+ private IMCOPsdk mService; |
|
82 |
+ private IMCOPCallback mMCOPCallback; |
|
83 |
+ private boolean isConnect=false; |
|
84 |
+ private static final int ERROR_CODE_DEFAULT=-1; |
|
85 |
+ private static final int AUTHETICATION_RESULT=101; |
|
86 |
+ private static final int GET_PERMISSION = 102; |
|
87 |
+ private static final boolean VALUE_BOOLEAN_DEFAULT=false; |
|
88 |
+ private static UserData userData; |
|
89 |
+ private static final int DEFAULT_REGISTER_DELAY = 3000; |
|
90 |
+ |
|
91 |
+ private static final String ACTION_BUTTON_PTT_DOWN_BITTIUM="com.elektrobit.pttbutton.PTTBUTTON_DOWN"; |
|
92 |
+ private static final String ACTION_BUTTON_PTT_UP_BITTIUM="com.elektrobit.pttbutton.PTTBUTTON_UP"; |
|
93 |
+ private static final String ACTION_BUTTON_PTT_LONG_PRESS_BITTIUM="com.elektrobit.pttbutton.PTTBUTTON_LONG_PRESS"; |
|
94 |
+ private BroadcastReceiver mButtonPTTBroadCastRecvMCPTT; |
|
95 |
+ |
|
96 |
+ private Button btn_register; |
|
97 |
+ private Button btn_unregister; |
|
98 |
+ private TextView text_info; |
|
99 |
+ private TextView text_error; |
|
100 |
+ private TextView text_affiliation; |
|
101 |
+ private TextView text_status; |
|
102 |
+ private Button btn_hangup; |
|
103 |
+ private DialogMenu mDialogIds; |
|
104 |
+ private DialogAlert mDialogAlert; |
|
105 |
+ private Button btn_accept; |
|
106 |
+ private Button reg_status; |
|
107 |
+ private Button reg_eMBMS; |
|
108 |
+ private Button btn_call; |
|
109 |
+ private Button btn_speaker; |
|
110 |
+ private Button btn_er; |
|
111 |
+ private TextView text_talking; |
|
112 |
+ private TextView text_callingid; |
|
113 |
+ private TextView switch_private; |
|
114 |
+ private TextView switch_group; |
|
115 |
+ private Toolbar toolbar; |
|
116 |
+ private TextView text_emergency; |
|
117 |
+ private PreferencesManagerDefault preferencesManager; |
|
118 |
+ private static final String PARAMETER_PROFILE = "parameters"; |
|
119 |
+ private static final String PARAMETER_SAVE_PROFILE = "TAG.PARAMETER_SAVE_PROFILE"; |
|
120 |
+ private static final String PARAMETER_CONFIG = "configuration"; |
|
121 |
+ private static final String PARAMETER_CONFIG_IDMSCMS = "TAG.PARAMETER_CONFIG_IDMSCMS"; |
|
122 |
+ private static final String PARAMETER_CONFIG_AUTOREGISTER = "TAG.PARAMETER_CONFIG_AUTOREGISTER"; |
|
123 |
+ private Map<String, String> clients; |
|
124 |
+ private DialogMenu mDialogMenu; |
|
125 |
+ private String currentProfile; |
|
126 |
+ private SwitchCompat switchCompat; |
|
127 |
+ private Spinner spinnerGroups; |
|
128 |
+ private Spinner spinnerUsers; |
|
129 |
+ private MenuItem itemIdMSCSM; |
|
130 |
+ private MenuItem itemAutoReg; |
|
131 |
+ private MenuItem itemExit; |
|
132 |
+ private Boolean isSpeakerphoneOn; |
|
133 |
+ private ArrayList<String> groupsCurrent; |
|
134 |
+ private Intent serviceIntent; |
|
135 |
+ private String[] regConfig = {"IdMS/CMS", "None"}; |
|
136 |
+ private String[] autoReg = {"Manual", "Automatic"}; |
|
137 |
+ private boolean IdMSCMS = false; |
|
138 |
+ private boolean autoRegister = false; |
|
139 |
+ private boolean registered = false; |
|
140 |
+ private enum State { |
|
141 |
+ GRANTED, |
|
142 |
+ IDLE, |
|
143 |
+ TAKEN, |
|
144 |
+ NONE |
|
145 |
+ } |
|
146 |
+ private State mState = State.NONE; |
|
147 |
+ private enum CallType { |
|
148 |
+ PRIVATE, |
|
149 |
+ GROUP |
|
150 |
+ } |
|
151 |
+ private CallType mCallType = CallType.GROUP; |
|
152 |
+ private boolean mERState = false; |
|
153 |
+ private String selGroup = "sip:DEMO_group@organization.org"; |
|
154 |
+ private String selUser = "sip:mcptt_id_DEMO_A@organization.org"; |
|
155 |
+ |
|
156 |
+ @Override |
|
157 |
+ protected void onCreate(Bundle savedInstanceState) { |
|
158 |
+ super.onCreate(savedInstanceState); |
|
159 |
+ setContentView(R.layout.activity_main); |
|
160 |
+ setPermissions(); |
|
161 |
+ |
|
162 |
+ toolbar = (Toolbar) findViewById(R.id.screen_menu_toolbar); |
|
163 |
+ setSupportActionBar(toolbar); |
|
164 |
+ btn_register=(Button)findViewById(R.id.btn_register); |
|
165 |
+ btn_unregister=(Button)findViewById(R.id.btn_unregister); |
|
166 |
+ text_info=(TextView)findViewById(R.id.text_info); |
|
167 |
+ text_error=(TextView)findViewById(R.id.text_error); |
|
168 |
+ text_affiliation=(TextView)findViewById(R.id.text_affiliation); |
|
169 |
+ text_status=(TextView)findViewById(R.id.text_status); |
|
170 |
+ btn_hangup=(Button)findViewById(R.id.btn_hangup); |
|
171 |
+ btn_accept=(Button)findViewById(R.id.btn_accept); |
|
172 |
+ reg_status=(Button)findViewById(R.id.reg_status); |
|
173 |
+ reg_eMBMS=(Button)findViewById(R.id.reg_eMBMS); |
|
174 |
+ btn_call=(Button)findViewById(R.id.btn_call); |
|
175 |
+ btn_speaker=(Button)findViewById(R.id.btn_speaker); |
|
176 |
+ btn_er=(Button)findViewById(R.id.btn_er); |
|
177 |
+ text_talking=(TextView)findViewById(R.id.text_talking); |
|
178 |
+ text_callingid=(TextView)findViewById(R.id.text_callingid); |
|
179 |
+ switch_private=(TextView)findViewById(R.id.switch_private); |
|
180 |
+ switch_group=(TextView)findViewById(R.id.switch_group); |
|
181 |
+ switchCompat=(SwitchCompat)findViewById(R.id.switch_call); |
|
182 |
+ spinnerGroups=(Spinner)findViewById(R.id.spinnerGroups); |
|
183 |
+ spinnerUsers=(Spinner)findViewById(R.id.spinnerUsers); |
|
184 |
+ text_emergency=(TextView)findViewById(R.id.emergency); |
|
185 |
+ |
|
186 |
+ btn_unregister.setEnabled(false); |
|
187 |
+ btn_call.setEnabled(false); |
|
188 |
+ btn_call.setBackgroundResource(R.drawable.token_inactive); |
|
189 |
+ btn_register.setEnabled(true); |
|
190 |
+ btn_accept.setEnabled(false); |
|
191 |
+ btn_hangup.setEnabled(false); |
|
192 |
+ reg_status.setEnabled(false); |
|
193 |
+ reg_eMBMS.setEnabled(false); |
|
194 |
+ btn_speaker.setEnabled(false); |
|
195 |
+ btn_er.setEnabled(false); |
|
196 |
+ text_talking.setVisibility((View.INVISIBLE)); |
|
197 |
+ text_callingid.setVisibility((View.INVISIBLE)); |
|
198 |
+ switchCompat.setEnabled(false); |
|
199 |
+ switch_group.setTextColor(ContextCompat.getColor(this, R.color.background)); |
|
200 |
+ switch_private.setTextColor(ContextCompat.getColor(this, R.color.background)); |
|
201 |
+ spinnerGroups.setEnabled(false); |
|
202 |
+ spinnerGroups.setAdapter(null); |
|
203 |
+ spinnerUsers.setEnabled(false); |
|
204 |
+ spinnerUsers.setAdapter(null); |
|
205 |
+ spinnerUsers.setVisibility((View.GONE)); |
|
206 |
+ spinnerGroups.setVisibility((View.VISIBLE)); |
|
207 |
+ isSpeakerphoneOn = false; |
|
208 |
+ AudioManager mAudioManager; |
|
209 |
+ mAudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE); |
|
210 |
+ mAudioManager.setSpeakerphoneOn(isSpeakerphoneOn); |
|
211 |
+ |
|
212 |
+ //Dissable logging messages. Enable just for debugging |
|
213 |
+ text_info.setVisibility((View.GONE)); |
|
214 |
+ text_error.setVisibility((View.GONE)); |
|
215 |
+ text_affiliation.setVisibility((View.GONE)); |
|
216 |
+ |
|
217 |
+ preferencesManager=new PreferencesManagerDefault(); |
|
218 |
+ clients = new HashMap<>(); |
|
219 |
+ List<String> usersCurrent = new ArrayList<String>(); |
|
220 |
+ |
|
221 |
+ // User list |
|
222 |
+ // EDIT THIS LIST WITH THE PROVIDED USERNAMES |
|
223 |
+ usersCurrent.add("sip:mcptt_id_DEMO_A@organization.org"); |
|
224 |
+ usersCurrent.add("sip:mcptt_id_DEMO_B@organization.org"); |
|
225 |
+ usersCurrent.add("sip:mcptt_id_DEMO_C@organization.org"); |
|
226 |
+ usersCurrent.add("sip:mcptt_id_DEMO_D@organization.org"); |
|
227 |
+ usersCurrent.add("sip:mcptt_id_DEMO_E@organization.org"); |
|
228 |
+ |
|
229 |
+ // Group list |
|
230 |
+ // EDIT THIS LIST WITH THE PROVIDED GROUP NAME(s) |
|
231 |
+ groupsCurrent = new ArrayList<String>(); |
|
232 |
+ groupsCurrent.add("sip:DEMO_group@organization.org"); |
|
233 |
+ groupsCurrent.add("sip:DEMO_group2@organization.org"); |
|
234 |
+ |
|
235 |
+ // Adapter for User Spinner |
|
236 |
+ ArrayAdapter<String> userAdaptor = new ArrayAdapter<>(getApplicationContext(), |
|
237 |
+ android.R.layout.simple_spinner_item, usersCurrent); |
|
238 |
+ // Drop down layout style - list view with radio button |
|
239 |
+ userAdaptor.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); |
|
240 |
+ spinnerUsers.setAdapter(userAdaptor); |
|
241 |
+ loadGroups(); |
|
242 |
+ |
|
243 |
+ // Load Profiles |
|
244 |
+ ArrayList<String> strings=getIntent().getStringArrayListExtra(PARAMETER_PROFILE); |
|
245 |
+ Map<String, String> parameterClients= getProfilesParameters(strings); |
|
246 |
+ if(parameterClients!=null && !parameterClients.isEmpty()) |
|
247 |
+ clients=parameterClients; |
|
248 |
+ |
|
249 |
+ loadConfiguration(); |
|
250 |
+ |
|
251 |
+ if(userData==null); |
|
252 |
+ userData=new UserData(); |
|
253 |
+ |
|
254 |
+ mMCOPCallback=new IMCOPCallback.Stub() { |
|
255 |
+ @Override |
|
256 |
+ public void handleOnEvent(final List<Intent> actionList) throws RemoteException { |
|
257 |
+ runOnUiThread(new Runnable() { |
|
258 |
+ @Override |
|
259 |
+ public void run() { |
|
260 |
+ for(Intent action:actionList){ |
|
261 |
+ int codeError=-1; |
|
262 |
+ int eventTypeInt=-1; |
|
263 |
+ String stringError=null; |
|
264 |
+ String sessionID=null; |
|
265 |
+ int callType=0; |
|
266 |
+ if(action!=null && action.getAction()!=null && !action.getAction().trim().isEmpty()) |
|
267 |
+ try { |
|
268 |
+ |
|
269 |
+ switch (ConstantsMCOP.ActionsCallBack.fromString(action.getAction())){ |
|
270 |
+ case none: |
|
271 |
+ if(BuildConfig.DEBUG)Log.d(TAG,"none"); |
|
272 |
+ break; |
|
273 |
+ case authorizationRequestEvent: |
|
274 |
+ codeError=-1; |
|
275 |
+ if((codeError=action.getIntExtra(ConstantsMCOP.AuthorizationRequestExtras.ERROR_CODE,ERROR_CODE_DEFAULT))!=ERROR_CODE_DEFAULT){ |
|
276 |
+ // Error in authorizationRequestEvent |
|
277 |
+ stringError=action.getStringExtra(ConstantsMCOP.AuthorizationRequestExtras.ERROR_STRING); |
|
278 |
+ showLastError("authorizationRequestEvent",codeError,stringError); |
|
279 |
+ }else { |
|
280 |
+ // No error |
|
281 |
+ String requestUri=null; |
|
282 |
+ String redirect=null; |
|
283 |
+ if((requestUri=action.getStringExtra(ConstantsMCOP.AuthorizationRequestExtras.REQUEST_URI))!=null && |
|
284 |
+ (redirect=action.getStringExtra(ConstantsMCOP.AuthorizationRequestExtras.REDIRECT_URI))!=null |
|
285 |
+ ){ |
|
286 |
+ if(BuildConfig.DEBUG)Log.d(TAG,"onAuthentication URI: "+requestUri+" redirectionURI: "+redirect); |
|
287 |
+ Intent intent2 = new Intent(getApplicationContext(), ScreenAuthenticationWebView.class); |
|
288 |
+ intent2.putExtra(ScreenAuthenticationWebView.DATA_URI_INTENT,requestUri.trim()); |
|
289 |
+ intent2.putExtra(ScreenAuthenticationWebView.DATA_REDIRECTION_URI,redirect.trim()); |
|
290 |
+ startActivityForResult(intent2,AUTHETICATION_RESULT); |
|
291 |
+ } |
|
292 |
+ } |
|
293 |
+ break; |
|
294 |
+ case loginEvent: |
|
295 |
+ codeError=-1; |
|
296 |
+ if((codeError=action.getIntExtra(ConstantsMCOP.LoginEventExtras.ERROR_CODE,ERROR_CODE_DEFAULT))!=ERROR_CODE_DEFAULT){ |
|
297 |
+ // Error in LoginEvent |
|
298 |
+ stringError=action.getStringExtra(ConstantsMCOP.LoginEventExtras.ERROR_STRING); |
|
299 |
+ showLastError("LoginEvent",codeError,stringError); |
|
300 |
+ }else { |
|
301 |
+ // No error |
|
302 |
+ boolean success=false; |
|
303 |
+ String mcptt_id=null; |
|
304 |
+ String displayName=null; |
|
305 |
+ if((success=action.getBooleanExtra(ConstantsMCOP.LoginEventExtras.SUCCESS,VALUE_BOOLEAN_DEFAULT))==true && |
|
306 |
+ (mcptt_id=action.getStringExtra(ConstantsMCOP.LoginEventExtras.MCPTT_ID))!=null |
|
307 |
+ ){ |
|
308 |
+ if(BuildConfig.DEBUG)Log.d(TAG,"Login success: "+success+" mcptt_id: "+mcptt_id); |
|
309 |
+ displayName=action.getStringExtra(ConstantsMCOP.LoginEventExtras.DISPLAY_NAME); |
|
310 |
+ isRegisted(success,mcptt_id,displayName); |
|
311 |
+ }else{ |
|
312 |
+ Log.e(TAG,"Error: Registration process"); |
|
313 |
+ } |
|
314 |
+ } |
|
315 |
+ break; |
|
316 |
+ case unLoginEvent: |
|
317 |
+ codeError=-1; |
|
318 |
+ if((codeError=action.getIntExtra(ConstantsMCOP.UnLoginEventExtras.ERROR_CODE,ERROR_CODE_DEFAULT))!=ERROR_CODE_DEFAULT){ |
|
319 |
+ // Error in unLoginEvent |
|
320 |
+ stringError=action.getStringExtra(ConstantsMCOP.UnLoginEventExtras.ERROR_STRING); |
|
321 |
+ showLastError("unLoginEvent",codeError,stringError); |
|
322 |
+ }else { |
|
323 |
+ // No error |
|
324 |
+ boolean success=false; |
|
325 |
+ if((success=action.getBooleanExtra(ConstantsMCOP.UnLoginEventExtras.SUCCESS,VALUE_BOOLEAN_DEFAULT))==true){ |
|
326 |
+ unRegisted(success); |
|
327 |
+ }else{ |
|
328 |
+ Log.e(TAG,"Error: Unregistration process"); |
|
329 |
+ } |
|
330 |
+ } |
|
331 |
+ break; |
|
332 |
+ case configurationUpdateEvent: |
|
333 |
+ break; |
|
334 |
+ case callEvent: |
|
335 |
+ codeError=-1; |
|
336 |
+ eventTypeInt=action.getIntExtra(ConstantsMCOP.CallEventExtras.EVENT_TYPE,ERROR_CODE_DEFAULT); |
|
337 |
+ ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum eventTypeCall=null; |
|
338 |
+ |
|
339 |
+ if(eventTypeInt!=ERROR_CODE_DEFAULT && |
|
340 |
+ (eventTypeCall=ConstantsMCOP.CallEventExtras.CallEventEventTypeEnum.fromInt(eventTypeInt))!=null ){ |
|
341 |
+ switch (eventTypeCall) { |
|
342 |
+ case NONE: |
|
343 |
+ break; |
|
344 |
+ case INCOMING: |
|
345 |
+ Log.d(TAG,"STATE: INCOMING"); |
|
346 |
+ stringError=action.getStringExtra(ConstantsMCOP.CallEventExtras.ERROR_STRING); |
|
347 |
+ sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
348 |
+ String callerID=action.getStringExtra(ConstantsMCOP.CallEventExtras.CALLER_USERID); |
|
349 |
+ callType=action.getIntExtra(ConstantsMCOP.CallEventExtras.CALL_TYPE,ERROR_CODE_DEFAULT); |
|
350 |
+ if (CallEvent.validationCallType(callType) == CallEvent.CallTypeValidEnum.AudioWithFloorCtrlPrivateEmergency) { |
|
351 |
+ Log.d(TAG,"Prearranged Emergency Group Call"); |
|
352 |
+ startERState(); |
|
353 |
+ } else if (CallEvent.validationCallType(callType) == CallEvent.CallTypeValidEnum.AudioWithFloorCtrlPrivateEmergency) { |
|
354 |
+ Log.d(TAG,"Private Emergency Call"); |
|
355 |
+ startERState(); |
|
356 |
+ } |
|
357 |
+ if(sessionID!=null)userData.addSessionID(sessionID); |
|
358 |
+ showData("callEvent ("+sessionID+")","INCOMING -> "+callerID); |
|
359 |
+ text_talking.setVisibility((View.VISIBLE)); |
|
360 |
+ text_callingid.setVisibility((View.VISIBLE)); |
|
361 |
+ text_callingid.setText(callerID); |
|
362 |
+ spinnerGroups.setEnabled(false); |
|
363 |
+ spinnerUsers.setEnabled(false); |
|
364 |
+ switchCompat.setEnabled(false); |
|
365 |
+ showIdsAcceptCall(getApplicationContext(), sessionID); |
|
366 |
+ break; |
|
367 |
+ case RINGING: |
|
368 |
+ Log.d(TAG,"STATE: RINGING"); |
|
369 |
+ sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
370 |
+ spinnerGroups.setEnabled(false); |
|
371 |
+ spinnerUsers.setEnabled(false); |
|
372 |
+ switchCompat.setEnabled(false); |
|
373 |
+ showData("callEvent ("+sessionID+")","RINGING"); |
|
374 |
+ if(sessionID!=null)userData.addSessionID(sessionID); |
|
375 |
+ break; |
|
376 |
+ case INPROGRESS: |
|
377 |
+ Log.d(TAG,"STATE: INPROGRESS"); |
|
378 |
+ sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
379 |
+ spinnerGroups.setEnabled(false); |
|
380 |
+ spinnerUsers.setEnabled(false); |
|
381 |
+ switchCompat.setEnabled(false); |
|
382 |
+ btn_er.setEnabled(false); |
|
383 |
+ showData("callEvent ("+sessionID+")","INPROGRESS"); |
|
384 |
+ if(sessionID!=null)userData.addSessionID(sessionID); |
|
385 |
+ break; |
|
386 |
+ case CONNECTED: |
|
387 |
+ Log.d(TAG,"STATE: CONNECTED"); |
|
388 |
+ sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
389 |
+ callType=action.getIntExtra(ConstantsMCOP.CallEventExtras.CALL_TYPE,ERROR_CODE_DEFAULT); |
|
390 |
+ if (CallEvent.validationCallType(callType) == CallEvent.CallTypeValidEnum.AudioWithFloorCtrlPrearrangedGroupEmergency) { |
|
391 |
+ Log.d(TAG,"Prearranged Emergency Group Call"); |
|
392 |
+ startERState(); |
|
393 |
+ } else if (CallEvent.validationCallType(callType) == CallEvent.CallTypeValidEnum.AudioWithFloorCtrlPrivateEmergency) { |
|
394 |
+ Log.d(TAG,"Private Emergency Call"); |
|
395 |
+ startERState(); |
|
396 |
+ } |
|
397 |
+ showData("callEvent ("+sessionID+")","CONNECTED"); |
|
398 |
+ if(sessionID!=null)userData.addSessionID(sessionID); |
|
399 |
+ btn_er.setEnabled(false); |
|
400 |
+ break; |
|
401 |
+ case TERMINATED: |
|
402 |
+ Log.d(TAG,"STATE: TERMINATED"); |
|
403 |
+ sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
404 |
+ spinnerGroups.setEnabled(true); |
|
405 |
+ spinnerUsers.setEnabled(true); |
|
406 |
+ switchCompat.setEnabled(true); |
|
407 |
+ switch_group.setTextColor(ContextCompat.getColor(getBaseContext(), R.color.white)); |
|
408 |
+ switch_private.setTextColor(ContextCompat.getColor(getBaseContext(), R.color.white)); |
|
409 |
+ showData("callEvent ("+sessionID+")","TERMINATED"); |
|
410 |
+ if(sessionID!=null)userData.removeSessionID(sessionID); |
|
411 |
+ if (mERState == false) { |
|
412 |
+ endERState(); |
|
413 |
+ } |
|
414 |
+ btn_call.setBackgroundResource(R.drawable.token_default); |
|
415 |
+ mState = State.NONE; |
|
416 |
+ btn_call.setEnabled(true); |
|
417 |
+ btn_hangup.setEnabled(false); |
|
418 |
+ btn_er.setEnabled(true); |
|
419 |
+ text_talking.setVisibility((View.INVISIBLE)); |
|
420 |
+ text_callingid.setVisibility((View.INVISIBLE)); |
|
421 |
+ break; |
|
422 |
+ case ERROR: |
|
423 |
+ Log.e(TAG,"STATE: ERROR"); |
|
424 |
+ if((codeError=action.getIntExtra(ConstantsMCOP.CallEventExtras.ERROR_CODE,ERROR_CODE_DEFAULT))!=ERROR_CODE_DEFAULT){ |
|
425 |
+ // Error in callEvent |
|
426 |
+ stringError=action.getStringExtra(ConstantsMCOP.CallEventExtras.ERROR_STRING); |
|
427 |
+ sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
428 |
+ showLastError("callEvent ("+sessionID+")",codeError,stringError); |
|
429 |
+ } |
|
430 |
+ if(sessionID!=null)userData.addSessionID(sessionID); |
|
431 |
+ break; |
|
432 |
+ case UPDATE: |
|
433 |
+ Log.d(TAG,"STATE: UPDATE"); |
|
434 |
+ sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
435 |
+ int updateCallType=action.getIntExtra(ConstantsMCOP.CallEventExtras.CALL_TYPE,ERROR_CODE_DEFAULT); |
|
436 |
+ showData("callEvent ("+sessionID+")","UPDATE -> CallType: "+updateCallType); |
|
437 |
+ if(sessionID!=null)userData.addSessionID(sessionID); |
|
438 |
+ break; |
|
439 |
+ default: |
|
440 |
+ showLastError("callEvent:",999,"RECEIVE EVENT NO VALID"); |
|
441 |
+ break; |
|
442 |
+ } |
|
443 |
+ }else{ |
|
444 |
+ showLastError("callEvent:",999,"RECEIVE EVENT NO VALID"); |
|
445 |
+ } |
|
446 |
+ break; |
|
447 |
+ case floorControlEvent: |
|
448 |
+ codeError=-1; |
|
449 |
+ if((codeError=action.getIntExtra(ConstantsMCOP.FloorControlEventExtras.ERROR_CODE,ERROR_CODE_DEFAULT))!=ERROR_CODE_DEFAULT){ |
|
450 |
+ // Error in unLoginEvent |
|
451 |
+ sessionID=action.getStringExtra(ConstantsMCOP.FloorControlEventExtras.SESSION_ID); |
|
452 |
+ stringError=action.getStringExtra(ConstantsMCOP.UnLoginEventExtras.ERROR_STRING); |
|
453 |
+ showLastError("floorControlEvent("+sessionID+")",codeError,stringError); |
|
454 |
+ }else { |
|
455 |
+ // No error |
|
456 |
+ boolean success=false; |
|
457 |
+ String eventFloorControl=action.getStringExtra(ConstantsMCOP.FloorControlEventExtras.FLOOR_CONTROL_EVENT); |
|
458 |
+ String causeString=null; |
|
459 |
+ int causeInt=-1; |
|
460 |
+ try{ |
|
461 |
+ sessionID=action.getStringExtra(ConstantsMCOP.CallEventExtras.SESSION_ID); |
|
462 |
+ switch (ConstantsMCOP.FloorControlEventExtras.FloorControlEventTypeEnum.fromString(eventFloorControl)) { |
|
463 |
+ case none: |
|
464 |
+ break; |
|
465 |
+ case granted: |
|
466 |
+ Log.d(TAG,"TOKEN GRANTED"); |
|
467 |
+ int durationGranted=action.getIntExtra(ConstantsMCOP.FloorControlEventExtras.DURATION_TOKEN,ERROR_CODE_DEFAULT); |
|
468 |
+ showData("floorControl ("+sessionID+")"," granted "+"-> Duration: "+durationGranted); |
|
469 |
+ btn_call.setBackgroundResource(R.drawable.token_green); |
|
470 |
+ mState = State.GRANTED; |
|
471 |
+ btn_call.setEnabled(true); |
|
472 |
+ btn_hangup.setEnabled(true); |
|
473 |
+ break; |
|
474 |
+ case idle: |
|
475 |
+ Log.d(TAG,"TOKEN IDLE"); |
|
476 |
+ showData("floorControl ("+sessionID+")"," idle"); |
|
477 |
+ btn_call.setBackgroundResource(R.drawable.token_gray); |
|
478 |
+ mState = State.IDLE; |
|
479 |
+ btn_call.setEnabled(true); |
|
480 |
+ btn_hangup.setEnabled(true); |
|
481 |
+ text_talking.setVisibility((View.INVISIBLE)); |
|
482 |
+ text_callingid.setVisibility((View.INVISIBLE)); |
|
483 |
+ break; |
|
484 |
+ case taken: |
|
485 |
+ Log.d(TAG,"TOKEN TAKEN"); |
|
486 |
+ String userIDTaken=action.getStringExtra(ConstantsMCOP.FloorControlEventExtras.USER_ID); |
|
487 |
+ String displayNameTaken=action.getStringExtra(ConstantsMCOP.FloorControlEventExtras.DISPLAY_NAME); |
|
488 |
+ boolean allow_request=action.getBooleanExtra(ConstantsMCOP.FloorControlEventExtras.ALLOW_REQUEST,VALUE_BOOLEAN_DEFAULT); |
|
489 |
+ showData("floorControl ("+sessionID+")"," granted "+"-> userIDTaken(allowRequest="+allow_request+"):("+userIDTaken+":"+displayNameTaken+")"); |
|
490 |
+ mState = State.TAKEN; |
|
491 |
+ btn_call.setEnabled(false); |
|
492 |
+ btn_hangup.setEnabled(true); |
|
493 |
+ btn_call.setBackgroundResource(R.drawable.token_red); |
|
494 |
+ text_talking.setVisibility((View.VISIBLE)); |
|
495 |
+ text_callingid.setVisibility((View.VISIBLE)); |
|
496 |
+ text_callingid.setText(userIDTaken); |
|
497 |
+ break; |
|
498 |
+ case denied: |
|
499 |
+ Log.d(TAG,"TOKEN DENIED"); |
|
500 |
+ causeString=action.getStringExtra(ConstantsMCOP.FloorControlEventExtras.CAUSE_STRING); |
|
501 |
+ causeInt=action.getIntExtra(ConstantsMCOP.FloorControlEventExtras.CAUSE_CODE,ERROR_CODE_DEFAULT); |
|
502 |
+ showData("floorControl ("+sessionID+")"," denied "+"-> cause("+causeInt+":"+causeString+")"); |
|
503 |
+ break; |
|
504 |
+ case revoked: |
|
505 |
+ Log.d(TAG,"TOKEN REVOKED"); |
|
506 |
+ causeString=action.getStringExtra(ConstantsMCOP.FloorControlEventExtras.CAUSE_STRING); |
|
507 |
+ causeInt=action.getIntExtra(ConstantsMCOP.FloorControlEventExtras.CAUSE_CODE,ERROR_CODE_DEFAULT); |
|
508 |
+ showData("floorControl ("+sessionID+")"," revoked "+"-> cause("+causeInt+":"+causeString+")"); |
|
509 |
+ break; |
|
510 |
+ default: |
|
511 |
+ break; |
|
512 |
+ } |
|
513 |
+ }catch (Exception e){ |
|
514 |
+ |
|
515 |
+ } |
|
516 |
+ } |
|
517 |
+ |
|
518 |
+ break; |
|
519 |
+ case groupInfoEvent: |
|
520 |
+ break; |
|
521 |
+ case groupAffiliationEvent: |
|
522 |
+ codeError=-1; |
|
523 |
+ eventTypeInt=action.getIntExtra(ConstantsMCOP.GroupAffiliationEventExtras.EVENT_TYPE,ERROR_CODE_DEFAULT); |
|
524 |
+ ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum eventTypeAffiliation=null; |
|
525 |
+ if(eventTypeInt!=ERROR_CODE_DEFAULT && |
|
526 |
+ (eventTypeAffiliation=ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationEventTypeEnum.fromInt(eventTypeInt))!=null ){ |
|
527 |
+ switch (eventTypeAffiliation) { |
|
528 |
+ case GROUP_AFFILIATION_UPDATE: |
|
529 |
+ Map<String, Integer> groups=(HashMap<String, Integer>)action.getSerializableExtra(ConstantsMCOP.GroupAffiliationEventExtras.GROUPS_LIST); |
|
530 |
+ if(groups!=null) |
|
531 |
+ showGroups(groups); |
|
532 |
+ break; |
|
533 |
+ case GROUP_AFFILIATION_ERROR: |
|
534 |
+ if((codeError=action.getIntExtra(ConstantsMCOP.GroupAffiliationEventExtras.ERROR_CODE,ERROR_CODE_DEFAULT))!=ERROR_CODE_DEFAULT){ |
|
535 |
+ // Error in unLoginEvent |
|
536 |
+ stringError=action.getStringExtra(ConstantsMCOP.GroupAffiliationEventExtras.ERROR_STRING); |
|
537 |
+ String groupID=action.getStringExtra(ConstantsMCOP.GroupAffiliationEventExtras.GROUP_ID); |
|
538 |
+ showLastError("groupAffiliationEvent ("+groupID+")",codeError,stringError); |
|
539 |
+ } |
|
540 |
+ break; |
|
541 |
+ case REMOTE_AFFILIATION: |
|
542 |
+ break; |
|
543 |
+ default: |
|
544 |
+ showLastError("groupAffiliationEvent:",999,"INVALID RECEIVE EVENT"); |
|
545 |
+ break; |
|
546 |
+ } |
|
547 |
+ }else{ |
|
548 |
+ showLastError("groupAffiliationEvent:",999,"INVALID RECEIVE EVENT"); |
|
549 |
+ } |
|
550 |
+ |
|
551 |
+ break; |
|
552 |
+ case selectedContactChangeEvent: |
|
553 |
+ break; |
|
554 |
+ case eMBMSNotificationEvent: |
|
555 |
+ if(BuildConfig.DEBUG)Log.d(TAG,"Receipt eMBMS Notification Event"); |
|
556 |
+ codeError=-1; |
|
557 |
+ String TMGI = null; |
|
558 |
+ String areaList =null; |
|
559 |
+ eventTypeInt=action.getIntExtra(ConstantsMCOP.EMBMSNotificationEventExtras.EVENT_TYPE,ERROR_CODE_DEFAULT); |
|
560 |
+ ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum eventTypeEmbms = null; |
|
561 |
+ if(eventTypeInt!=ERROR_CODE_DEFAULT && |
|
562 |
+ (eventTypeEmbms=ConstantsMCOP.EMBMSNotificationEventExtras.EMBMSNotificationEventEventTypeEnum.fromInt(eventTypeInt))!=null ){ |
|
563 |
+ switch (eventTypeEmbms) { |
|
564 |
+ case none: |
|
565 |
+ break; |
|
566 |
+ case eMBMSAvailable: |
|
567 |
+ if(BuildConfig.DEBUG)Log.d(TAG,"Receipt eMBMS available"); |
|
568 |
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |
|
569 |
+ reg_eMBMS.setEnabled(true); |
|
570 |
+ } |
|
571 |
+ break; |
|
572 |
+ case UndereMBMSCoverage: |
|
573 |
+ if(BuildConfig.DEBUG)Log.d(TAG,"Receipt eMBMS under coverage"); |
|
574 |
+ TMGI = action.getStringExtra(ConstantsMCOP.EMBMSNotificationEventExtras.TMGI); |
|
575 |
+ sessionID = action.getStringExtra(ConstantsMCOP.EMBMSNotificationEventExtras.SESSION_ID); |
|
576 |
+ areaList = action.getStringExtra(ConstantsMCOP.EMBMSNotificationEventExtras.AREA_LIST); |
|
577 |
+ break; |
|
578 |
+ case eMBMSBearerInUse: |
|
579 |
+ if(BuildConfig.DEBUG)Log.d(TAG,"Receipt eMBMS bearer in use"); |
|
580 |
+ TMGI = action.getStringExtra(ConstantsMCOP.EMBMSNotificationEventExtras.TMGI); |
|
581 |
+ sessionID = action.getStringExtra(ConstantsMCOP.EMBMSNotificationEventExtras.SESSION_ID); |
|
582 |
+ areaList = action.getStringExtra(ConstantsMCOP.EMBMSNotificationEventExtras.AREA_LIST); |
|
583 |
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |
|
584 |
+ reg_eMBMS.setEnabled(true); |
|
585 |
+ } else { |
|
586 |
+ reg_eMBMS.setEnabled(true); |
|
587 |
+ } |
|
588 |
+ break; |
|
589 |
+ case eMBMSBearerNotInUse: |
|
590 |
+ if(BuildConfig.DEBUG)Log.d(TAG,"Receipt eMBMS bearer not in use"); |
|
591 |
+ TMGI = action.getStringExtra(ConstantsMCOP.EMBMSNotificationEventExtras.TMGI); |
|
592 |
+ sessionID = action.getStringExtra(ConstantsMCOP.EMBMSNotificationEventExtras.SESSION_ID); |
|
593 |
+ areaList = action.getStringExtra(ConstantsMCOP.EMBMSNotificationEventExtras.AREA_LIST); |
|
594 |
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |
|
595 |
+ reg_eMBMS.setEnabled(false); |
|
596 |
+ } else { |
|
597 |
+ reg_eMBMS.setEnabled(false); |
|
598 |
+ } |
|
599 |
+ break; |
|
600 |
+ case NoeMBMSCoverage: |
|
601 |
+ if(BuildConfig.DEBUG)Log.d(TAG,"Receipt eMBMS not under coverage"); |
|
602 |
+ TMGI = action.getStringExtra(ConstantsMCOP.EMBMSNotificationEventExtras.TMGI); |
|
603 |
+ sessionID = action.getStringExtra(ConstantsMCOP.EMBMSNotificationEventExtras.SESSION_ID); |
|
604 |
+ areaList = action.getStringExtra(ConstantsMCOP.EMBMSNotificationEventExtras.AREA_LIST); |
|
605 |
+ break; |
|
606 |
+ case eMBMSNotAvailable: |
|
607 |
+ if(BuildConfig.DEBUG)Log.d(TAG,"Receipt eMBMS not available"); |
|
608 |
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |
|
609 |
+ reg_eMBMS.setBackgroundColor(getColor(R.color.unregistered)); |
|
610 |
+ } |
|
611 |
+ break; |
|
612 |
+ default: |
|
613 |
+ showLastError("eMBMSNotificationEvent:",999,"INVALID RECEIVE EVENT"); |
|
614 |
+ break; |
|
615 |
+ } |
|
616 |
+ }else{ |
|
617 |
+ showLastError("eMBMSNotificationEvent:",999,"INVALID RECEIVE EVENT"); |
|
618 |
+ } |
|
619 |
+ break; |
|
620 |
+ } |
|
621 |
+ }catch (Exception ex){ |
|
622 |
+ Log.e(TAG,"Event Action Error: "+action.getAction()+" error:"+ex.getMessage()); |
|
623 |
+ } |
|
624 |
+ } |
|
625 |
+ } |
|
626 |
+ }); |
|
627 |
+ } |
|
628 |
+ }; |
|
629 |
+ |
|
630 |
+ btn_register.setOnClickListener(new View.OnClickListener() { |
|
631 |
+ @Override |
|
632 |
+ public void onClick(View view) { |
|
633 |
+ register(); |
|
634 |
+ } |
|
635 |
+ }); |
|
636 |
+ |
|
637 |
+ btn_unregister.setOnClickListener(new View.OnClickListener() { |
|
638 |
+ @Override |
|
639 |
+ public void onClick(View view) { |
|
640 |
+ try { |
|
641 |
+ if(mService!=null) { |
|
642 |
+ mService.unLoginMCOP(); |
|
643 |
+ } |
|
644 |
+ } catch (RemoteException e) { |
|
645 |
+ e.printStackTrace(); |
|
646 |
+ } |
|
647 |
+ } |
|
648 |
+ }); |
|
649 |
+ |
|
650 |
+ btn_hangup.setOnClickListener(new View.OnClickListener() { |
|
651 |
+ @Override |
|
652 |
+ public void onClick(View view) { |
|
653 |
+ if(BuildConfig.DEBUG)Log.d(TAG,"onClick btn_hangup"); |
|
654 |
+ showIds(getApplicationContext()); |
|
655 |
+ } |
|
656 |
+ }); |
|
657 |
+ |
|
658 |
+ btn_accept.setOnClickListener(new View.OnClickListener() { |
|
659 |
+ @Override |
|
660 |
+ public void onClick(View view) { |
|
661 |
+ // Auto-accept used |
|
662 |
+ //showIdsAcceptCall(getApplicationContext()); |
|
663 |
+ } |
|
664 |
+ }); |
|
665 |
+ |
|
666 |
+ btn_er.setOnClickListener(new View.OnClickListener() { |
|
667 |
+ @Override |
|
668 |
+ public void onClick(View view) { |
|
669 |
+ // Set Emergency state |
|
670 |
+ if (mERState == false) { |
|
671 |
+ mERState = true; |
|
672 |
+ startERState(); |
|
673 |
+ } else { |
|
674 |
+ mERState = false; |
|
675 |
+ endERState(); |
|
676 |
+ } |
|
677 |
+ } |
|
678 |
+ }); |
|
679 |
+ |
|
680 |
+ btn_speaker.setOnClickListener(new View.OnClickListener() { |
|
681 |
+ @Override |
|
682 |
+ public void onClick(View view) { |
|
683 |
+ AudioManager mAudioManager; |
|
684 |
+ mAudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE); |
|
685 |
+ if(isSpeakerphoneOn){ |
|
686 |
+ isSpeakerphoneOn=false; |
|
687 |
+ Log.d(TAG, "Speaker OFF"); |
|
688 |
+ btn_speaker.setText(R.string.btn_speaker_off); |
|
689 |
+ }else{ |
|
690 |
+ isSpeakerphoneOn=true; |
|
691 |
+ Log.d(TAG, "Speaker ON"); |
|
692 |
+ btn_speaker.setText(R.string.btn_speaker_on); |
|
693 |
+ } |
|
694 |
+ mAudioManager.setSpeakerphoneOn(isSpeakerphoneOn); |
|
695 |
+ } |
|
696 |
+ }); |
|
697 |
+ |
|
698 |
+ switchCompat.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { |
|
699 |
+ @Override |
|
700 |
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { |
|
701 |
+ if(isChecked){ |
|
702 |
+ // Switch is on. Private Call |
|
703 |
+ mCallType = CallType.PRIVATE; |
|
704 |
+ spinnerGroups.setVisibility((View.GONE)); |
|
705 |
+ spinnerUsers.setVisibility((View.VISIBLE)); |
|
706 |
+ spinnerGroups.setEnabled(false); |
|
707 |
+ spinnerUsers.setEnabled(true); |
|
708 |
+ } |
|
709 |
+ else { |
|
710 |
+ // Switch is off. Group Call |
|
711 |
+ mCallType = CallType.GROUP; |
|
712 |
+ spinnerUsers.setVisibility((View.GONE)); |
|
713 |
+ spinnerGroups.setVisibility((View.VISIBLE)); |
|
714 |
+ spinnerUsers.setEnabled(false); |
|
715 |
+ spinnerGroups.setEnabled(true); |
|
716 |
+ } |
|
717 |
+ } |
|
718 |
+ }); |
|
719 |
+ |
|
720 |
+ spinnerUsers.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { |
|
721 |
+ @Override |
|
722 |
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { |
|
723 |
+ selUser = parent.getItemAtPosition(position).toString(); |
|
724 |
+ } |
|
725 |
+ |
|
726 |
+ @Override |
|
727 |
+ public void onNothingSelected(AdapterView<?> parent) { |
|
728 |
+ |
|
729 |
+ } |
|
730 |
+ }); |
|
731 |
+ |
|
732 |
+ spinnerGroups.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { |
|
733 |
+ @Override |
|
734 |
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { |
|
735 |
+ selGroup = parent.getItemAtPosition(position).toString(); |
|
736 |
+ } |
|
737 |
+ |
|
738 |
+ @Override |
|
739 |
+ public void onNothingSelected(AdapterView<?> parent) { |
|
740 |
+ |
|
741 |
+ } |
|
742 |
+ }); |
|
743 |
+ |
|
744 |
+ btn_call.setOnTouchListener(new View.OnTouchListener() { |
|
745 |
+ @Override |
|
746 |
+ public boolean onTouch(View v, MotionEvent event) { |
|
747 |
+ if(mState != State.NONE && event.getAction() == MotionEvent.ACTION_DOWN) { |
|
748 |
+ if (mState == State.IDLE) { |
|
749 |
+ //Request token |
|
750 |
+ Log.d(TAG,"TOKEN REQUEST"); |
|
751 |
+ showIdsOperationFloorControl(getApplicationContext(), true); |
|
752 |
+ } |
|
753 |
+ }else if (mState != State.NONE && event.getAction() == MotionEvent.ACTION_UP) { |
|
754 |
+ if (mState == State.GRANTED) { |
|
755 |
+ //Release token |
|
756 |
+ Log.d(TAG,"TOKEN RELEASE"); |
|
757 |
+ showIdsOperationFloorControl(getApplicationContext(),false); |
|
758 |
+ } |
|
759 |
+ } else if (event.getAction() == MotionEvent.ACTION_DOWN){ |
|
760 |
+ makeCall(); |
|
761 |
+ } |
|
762 |
+ return true; |
|
763 |
+ } |
|
764 |
+ }); |
|
765 |
+ |
|
766 |
+ // PTT button on Bittium Devices |
|
767 |
+ mButtonPTTBroadCastRecvMCPTT=new BroadcastReceiver() { |
|
768 |
+ @Override |
|
769 |
+ public void onReceive(Context context, Intent intent) { |
|
770 |
+ Log.d(TAG,"PTT button"); |
|
771 |
+ final String action = intent.getAction(); |
|
772 |
+ if(action.compareTo(ACTION_BUTTON_PTT_DOWN_BITTIUM)==0 |
|
773 |
+ ){ |
|
774 |
+ |
|
775 |
+ Log.d(TAG,"PTT button Down"); |
|
776 |
+ if(mState==State.IDLE && !showIdsOperationFloorControl(getApplicationContext(), true)){ |
|
777 |
+ Log.e(TAG,"Error: the device can´t request the Token now"); |
|
778 |
+ }else if(mState==null || mState==State.NONE){ |
|
779 |
+ makeCall(); |
|
780 |
+ } |
|
781 |
+ }else if(action.compareTo(ACTION_BUTTON_PTT_UP_BITTIUM)==0 && mState==State.GRANTED){ |
|
782 |
+ Log.d(TAG,"PTT button Up"); |
|
783 |
+ if(!showIdsOperationFloorControl(getApplicationContext(), false)){ |
|
784 |
+ Log.e(TAG,"Error: the device can´t release the Token now"); |
|
785 |
+ } |
|
786 |
+ }else if(action.compareTo(ACTION_BUTTON_PTT_LONG_PRESS_BITTIUM)==0){ |
|
787 |
+ Log.d(TAG,"Long PTT button press"); |
|
788 |
+ } |
|
789 |
+ } |
|
790 |
+ }; |
|
791 |
+ final IntentFilter intentFilter2 = new IntentFilter(); |
|
792 |
+ intentFilter2.addAction(ACTION_BUTTON_PTT_DOWN_BITTIUM); |
|
793 |
+ intentFilter2.addAction(ACTION_BUTTON_PTT_UP_BITTIUM); |
|
794 |
+ intentFilter2.addAction(ACTION_BUTTON_PTT_LONG_PRESS_BITTIUM); |
|
795 |
+ |
|
796 |
+ if(mConnection==null) |
|
797 |
+ mConnection = new ServiceConnection() { |
|
798 |
+ |
|
799 |
+ @Override |
|
800 |
+ public void onServiceConnected(ComponentName className, IBinder service) { |
|
801 |
+ Log.d(TAG,"Service binded! "+className.getPackageName()+"\n"); |
|
802 |
+ Toast.makeText(getApplicationContext(),"Binded to MCOP SDK",Toast.LENGTH_SHORT).show(); |
|
803 |
+ mService = IMCOPsdk.Stub.asInterface(service); |
|
804 |
+ |
|
805 |
+ try { |
|
806 |
+ Log.d(TAG,"execute registerCallback "+mMCOPCallback); |
|
807 |
+ mService.registerCallback(mMCOPCallback); |
|
808 |
+ } catch (RemoteException e) { |
|
809 |
+ e.printStackTrace(); |
|
810 |
+ } |
|
811 |
+ isConnect=true; |
|
812 |
+ |
|
813 |
+ // Auto Registration |
|
814 |
+ if (autoRegister) { |
|
815 |
+ final Handler handler = new Handler(); |
|
816 |
+ handler.postDelayed(new Runnable() { |
|
817 |
+ @Override |
|
818 |
+ public void run() { |
|
819 |
+ register(); |
|
820 |
+ } |
|
821 |
+ }, DEFAULT_REGISTER_DELAY); |
|
822 |
+ } |
|
823 |
+ } |
|
824 |
+ |
|
825 |
+ @Override |
|
826 |
+ public void onServiceDisconnected(ComponentName className) { |
|
827 |
+ mService = null; |
|
828 |
+ // This method is only invoked when the service quits from the other end or gets killed |
|
829 |
+ // Invoking exit() from the AIDL interface makes the Service kill itself, thus invoking this. |
|
830 |
+ Log.d(TAG,"Service disconnected.\n"); |
|
831 |
+ isConnect=false; |
|
832 |
+ } |
|
833 |
+ }; |
|
834 |
+ if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && |
|
835 |
+ ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED && |
|
836 |
+ ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED && |
|
837 |
+ ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) { |
|
838 |
+ TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE); |
|
839 |
+ if(tm!=null) { |
|
840 |
+ String imei = tm.getDeviceId(); |
|
841 |
+ String client=clients.get(imei); |
|
842 |
+ if(client!=null){ |
|
843 |
+ this.currentProfile=client; |
|
844 |
+ Log.i(TAG,"currentProfile: "+ currentProfile); |
|
845 |
+ connectService(currentProfile); |
|
846 |
+ }else{ |
|
847 |
+ connectService(); |
|
848 |
+ } |
|
849 |
+ } |
|
850 |
+ } |
|
851 |
+ } |
|
852 |
+ |
|
853 |
+ private void register() { |
|
854 |
+ if (IdMSCMS) { |
|
855 |
+ try { |
|
856 |
+ if(mService!=null) |
|
857 |
+ mService.loginMCOP(); |
|
858 |
+ } catch (RemoteException e) { |
|
859 |
+ e.printStackTrace(); |
|
860 |
+ } |
|
861 |
+ } else { // CMS |
|
862 |
+ try { |
|
863 |
+ if(mService!=null) |
|
864 |
+ mService.authorizeUser(null); |
|
865 |
+ } catch (RemoteException e) { |
|
866 |
+ e.printStackTrace(); |
|
867 |
+ } |
|
868 |
+ } |
|
869 |
+ } |
|
870 |
+ |
|
871 |
+ private void loadGroups(){ |
|
872 |
+ // Adapter por Group Spinner |
|
873 |
+ ArrayAdapter<String> groupAdaptor = new ArrayAdapter<>(getApplicationContext(), |
|
874 |
+ android.R.layout.simple_spinner_item, groupsCurrent); |
|
875 |
+ // Drop down layout style - list view with radio button |
|
876 |
+ groupAdaptor.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); |
|
877 |
+ spinnerGroups.setAdapter(groupAdaptor); |
|
878 |
+ } |
|
879 |
+ |
|
880 |
+ private void startERState() { |
|
881 |
+ // Start Emergency State |
|
882 |
+ Log.d(TAG,"Start Emergency State"); |
|
883 |
+ Toolbar toolbar = (Toolbar) findViewById(R.id.screen_menu_toolbar); |
|
884 |
+ setSupportActionBar(toolbar); |
|
885 |
+ toolbar.setBackgroundColor(getResources().getColor(R.color.colorER)); |
|
886 |
+ AppBarLayout appbarLayout = (AppBarLayout) findViewById(R.id.screen_menu_toolbar_AppBarLayout); |
|
887 |
+ appbarLayout.setBackgroundColor(getResources().getColor(R.color.colorER)); |
|
888 |
+ text_emergency.setTextColor(getResources().getColor(R.color.colorER)); |
|
889 |
+ } |
|
890 |
+ |
|
891 |
+ private void endERState() { |
|
892 |
+ // End Emergency State |
|
893 |
+ Log.d(TAG,"End Emergency State"); |
|
894 |
+ Toolbar toolbar = (Toolbar) findViewById(R.id.screen_menu_toolbar); |
|
895 |
+ setSupportActionBar(toolbar); |
|
896 |
+ toolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimary)); |
|
897 |
+ AppBarLayout appbarLayout = (AppBarLayout) findViewById(R.id.screen_menu_toolbar_AppBarLayout); |
|
898 |
+ appbarLayout.setBackgroundColor(getResources().getColor(R.color.colorPrimary)); |
|
899 |
+ text_emergency.setTextColor(getResources().getColor(R.color.background)); |
|
900 |
+ } |
|
901 |
+ |
|
902 |
+ private void makeCall(){ |
|
903 |
+ if (mERState == false) { |
|
904 |
+ // Non-Emergency Calls |
|
905 |
+ if (mCallType == CallType.GROUP) { |
|
906 |
+ // Group Call |
|
907 |
+ try { |
|
908 |
+ Log.d(TAG,"Call type: " + mCallType); |
|
909 |
+ if(mService!=null) |
|
910 |
+ mService.makeCall( |
|
911 |
+ selGroup, //DEFAULT_GROUP, |
|
912 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.Audio.getValue() | |
|
913 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.WithFloorCtrl.getValue() | |
|
914 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.PrearrangedGroup.getValue()); |
|
915 |
+ } catch (RemoteException e) { |
|
916 |
+ e.printStackTrace(); |
|
917 |
+ } |
|
918 |
+ } else if (mCallType == CallType.PRIVATE) { |
|
919 |
+ // Private Call |
|
920 |
+ try { |
|
921 |
+ Log.d(TAG,"Call type: " + mCallType); |
|
922 |
+ if(mService!=null) |
|
923 |
+ mService.makeCall( |
|
924 |
+ selUser, //DEFAULT_PRIVATE_CALL, |
|
925 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.Audio.getValue() | |
|
926 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.WithFloorCtrl.getValue() | |
|
927 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.Private.getValue()); |
|
928 |
+ } catch (RemoteException e) { |
|
929 |
+ e.printStackTrace(); |
|
930 |
+ } |
|
931 |
+ } |
|
932 |
+ } else { |
|
933 |
+ // Emergency Calls |
|
934 |
+ if (mCallType == CallType.GROUP) { |
|
935 |
+ // Emergency Group Call |
|
936 |
+ try { |
|
937 |
+ Log.d(TAG,"Call type: Emergency " + mCallType); |
|
938 |
+ if(mService!=null) |
|
939 |
+ mService.makeCall( |
|
940 |
+ selGroup, //DEFAULT_GROUP, |
|
941 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.Audio.getValue() | |
|
942 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.WithFloorCtrl.getValue() | |
|
943 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.PrearrangedGroup.getValue() | |
|
944 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.Emergency.getValue()); |
|
945 |
+ } catch (RemoteException e) { |
|
946 |
+ e.printStackTrace(); |
|
947 |
+ } |
|
948 |
+ } else if (mCallType == CallType.PRIVATE) { |
|
949 |
+ // Private Call |
|
950 |
+ try { |
|
951 |
+ Log.d(TAG,"Call type: Emergency " + mCallType); |
|
952 |
+ if(mService!=null) |
|
953 |
+ mService.makeCall( |
|
954 |
+ selUser, //DEFAULT_PRIVATE_CALL, |
|
955 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.Audio.getValue() | |
|
956 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.WithFloorCtrl.getValue() | |
|
957 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.Private.getValue() | |
|
958 |
+ ConstantsMCOP.CallEventExtras.CallTypeEnum.Emergency.getValue()); |
|
959 |
+ } catch (RemoteException e) { |
|
960 |
+ e.printStackTrace(); |
|
961 |
+ } |
|
962 |
+ } |
|
963 |
+ } |
|
964 |
+ btn_hangup.setEnabled(true); |
|
965 |
+ } |
|
966 |
+ |
|
967 |
+ private void showIds(final Context context){ |
|
968 |
+ if(userData.getSessionIDs()==null)return; |
|
969 |
+ final String[] strings=userData.getSessionIDs().toArray(new String[userData.getSessionIDs().size()]); |
|
970 |
+ if(strings==null || strings.length==0){ |
|
971 |
+ if(BuildConfig.DEBUG)Log.d(TAG,"Error showIds"); |
|
972 |
+ return; |
|
973 |
+ } |
|
974 |
+ if(strings.length==1) { |
|
975 |
+ try { |
|
976 |
+ if (mService != null) |
|
977 |
+ mService.hangUpCall(strings[0]); |
|
978 |
+ } catch (RemoteException e) { |
|
979 |
+ e.printStackTrace(); |
|
980 |
+ } |
|
981 |
+ } else { |
|
982 |
+ mDialogIds = DialogMenu.newInstance(strings, null); |
|
983 |
+ mDialogIds.setOnClickItemListener(new DialogMenu.OnClickListener() { |
|
984 |
+ @Override |
|
985 |
+ public void onClickItem(int item) { |
|
986 |
+ if (item >= 0 && strings.length > item) { |
|
987 |
+ try { |
|
988 |
+ if (mService != null) |
|
989 |
+ mService.hangUpCall(strings[item]); |
|
990 |
+ } catch (RemoteException e) { |
|
991 |
+ e.printStackTrace(); |
|
992 |
+ } |
|
993 |
+ } |
|
994 |
+ } |
|
995 |
+ }); |
|
996 |
+ mDialogIds.show(getSupportFragmentManager(), "SimpleDialog"); |
|
997 |
+ } |
|
998 |
+ } |
|
999 |
+ |
|
1000 |
+ private boolean showIdsOperationFloorControl(final Context context, final boolean request){ |
|
1001 |
+ Log.i(TAG,"Send floor control operation : "+((request)?"request":"release")); |
|
1002 |
+ if(userData.getSessionIDs()==null)return false; |
|
1003 |
+ final String[] strings=userData.getSessionIDs().toArray(new String[userData.getSessionIDs().size()]); |
|
1004 |
+ if(strings==null || strings.length==0)return false; |
|
1005 |
+ if(strings.length==1) { |
|
1006 |
+ try { |
|
1007 |
+ if (mService != null){ |
|
1008 |
+ mService.floorControlOperation( |
|
1009 |
+ strings[0], |
|
1010 |
+ request ? ConstantsMCOP.FloorControlEventExtras.FloorControlOperationTypeEnum.MCPTT_Request.getValue() : ConstantsMCOP.FloorControlEventExtras.FloorControlOperationTypeEnum.MCPTT_Release.getValue(), |
|
1011 |
+ null); |
|
1012 |
+ } |
|
1013 |
+ Log.i(TAG,"Send floor control operation 2: "+((request)?"request":"release")); |
|
1014 |
+ |
|
1015 |
+ } catch (RemoteException e) { |
|
1016 |
+ e.printStackTrace(); |
|
1017 |
+ } |
|
1018 |
+ } else { |
|
1019 |
+ mDialogIds = DialogMenu.newInstance(strings, null); |
|
1020 |
+ mDialogIds.setOnClickItemListener(new DialogMenu.OnClickListener() { |
|
1021 |
+ @Override |
|
1022 |
+ public void onClickItem(int item) { |
|
1023 |
+ if (item >= 0 && strings.length > item) { |
|
1024 |
+ try { |
|
1025 |
+ if (mService != null){ |
|
1026 |
+ mService.floorControlOperation( |
|
1027 |
+ strings[item], |
|
1028 |
+ request ? ConstantsMCOP.FloorControlEventExtras.FloorControlOperationTypeEnum.MCPTT_Request.getValue() : ConstantsMCOP.FloorControlEventExtras.FloorControlOperationTypeEnum.MCPTT_Release.getValue(), |
|
1029 |
+ null); |
|
1030 |
+ Log.i(TAG,"Send floor control operation 3: "+((request)?"request":"release")); |
|
1031 |
+ } |
|
1032 |
+ |
|
1033 |
+ } catch (RemoteException e) { |
|
1034 |
+ e.printStackTrace(); |
|
1035 |
+ } |
|
1036 |
+ } |
|
1037 |
+ } |
|
1038 |
+ }); |
|
1039 |
+ mDialogIds.show(getSupportFragmentManager(), "SimpleDialog"); |
|
1040 |
+ } |
|
1041 |
+ return true; |
|
1042 |
+ } |
|
1043 |
+ |
|
1044 |
+ private void showIdsAcceptCall(final Context context, String sessionID){ |
|
1045 |
+ if(userData.getSessionIDs()==null)return; |
|
1046 |
+ final String[] strings=userData.getSessionIDs().toArray(new String[userData.getSessionIDs().size()]); |
|
1047 |
+ if(strings==null)return; |
|
1048 |
+ try { |
|
1049 |
+ if(mService!=null) |
|
1050 |
+ mService.acceptCall(sessionID); |
|
1051 |
+ btn_call.setBackgroundResource(R.drawable.token_red); |
|
1052 |
+ } catch (RemoteException e) { |
|
1053 |
+ e.printStackTrace(); |
|
1054 |
+ } |
|
1055 |
+ } |
|
1056 |
+ |
|
1057 |
+ @Override |
|
1058 |
+ protected void onDestroy(){ |
|
1059 |
+ if(BuildConfig.DEBUG)Log.i(TAG,"onDestroy"); |
|
1060 |
+ super.onDestroy(); |
|
1061 |
+ isConnect=false; |
|
1062 |
+ if(mConnection!=null && isConnect) { |
|
1063 |
+ try { |
|
1064 |
+ unbindService(mConnection); |
|
1065 |
+ } catch (Exception e) { |
|
1066 |
+ Log.e(TAG, "Error unbinding Service"); |
|
1067 |
+ } |
|
1068 |
+ } |
|
1069 |
+ if(serviceIntent!=null); |
|
1070 |
+ mConnection=null; |
|
1071 |
+ } |
|
1072 |
+ |
|
1073 |
+ @Override |
|
1074 |
+ protected void onActivityResult(int requestCode, int resultCode, Intent data) { |
|
1075 |
+ switch (requestCode){ |
|
1076 |
+ case AUTHETICATION_RESULT: |
|
1077 |
+ if ( resultCode == ScreenAuthenticationWebView.RETURN_ON_AUTHENTICATION_LISTENER_FAILURE) { |
|
1078 |
+ String dataError; |
|
1079 |
+ if (data != null && |
|
1080 |
+ (dataError= data.getStringExtra(org.test.client.mcopclient.ScreenAuthenticationWebView.RETURN_ON_AUTHENTICATION_ERROR))!=null && |
|
1081 |
+ dataError instanceof String) { |
|
1082 |
+ Log.e(TAG,"Authentication Error: "+dataError); |
|
1083 |
+ }else{ |
|
1084 |
+ Log.e(TAG,"Error processing authentication."); |
|
1085 |
+ } |
|
1086 |
+ }else if ( resultCode == ScreenAuthenticationWebView.RETURN_ON_AUTHENTICATION_LISTENER_OK) { |
|
1087 |
+ String dataUri; |
|
1088 |
+ if (data != null && |
|
1089 |
+ (dataUri= data.getStringExtra(org.test.client.mcopclient.ScreenAuthenticationWebView.RETURN_ON_AUTHENTICATION_RESPONSE))!=null && |
|
1090 |
+ dataUri instanceof String) { |
|
1091 |
+ URI uri = null; |
|
1092 |
+ try { |
|
1093 |
+ uri = new URI(dataUri); |
|
1094 |
+ Log.i(TAG, "Uri: " + uri.toString()); |
|
1095 |
+ try { |
|
1096 |
+ if(mService!=null) |
|
1097 |
+ mService.authorizeUser(dataUri); |
|
1098 |
+ } catch (RemoteException e) { |
|
1099 |
+ e.printStackTrace(); |
|
1100 |
+ } |
|
1101 |
+ } catch (URISyntaxException e) { |
|
1102 |
+ Log.e(TAG,"Authentication Error: "+e.getMessage()); |
|
1103 |
+ e.printStackTrace(); |
|
1104 |
+ } |
|
1105 |
+ }else{ |
|
1106 |
+ Log.e(TAG,"Error processing file to import profiles."); |
|
1107 |
+ } |
|
1108 |
+ } |
|
1109 |
+ break; |
|
1110 |
+ } |
|
1111 |
+ } |
|
1112 |
+ |
|
1113 |
+ // START GUI |
|
1114 |
+ private void unRegisted(boolean success){ |
|
1115 |
+ userData.setRegisted(false); |
|
1116 |
+ userData.setDisplayName(null); |
|
1117 |
+ userData.setMcpttID(null); |
|
1118 |
+ text_info.setText("UNREGISTERED"); |
|
1119 |
+ text_status.setText(getString(R.string.text_status)); |
|
1120 |
+ btn_call.setEnabled(false); |
|
1121 |
+ btn_call.setBackgroundResource(R.drawable.token_inactive); |
|
1122 |
+ btn_unregister.setEnabled(false); |
|
1123 |
+ btn_register.setEnabled(true); |
|
1124 |
+ btn_er.setEnabled(false); |
|
1125 |
+ reg_status.setEnabled(false); |
|
1126 |
+ switchCompat.setEnabled(false); |
|
1127 |
+ switch_group.setTextColor(ContextCompat.getColor(this, R.color.background)); |
|
1128 |
+ switch_private.setTextColor(ContextCompat.getColor(this, R.color.background)); |
|
1129 |
+ spinnerGroups.setEnabled(false); |
|
1130 |
+ spinnerUsers.setEnabled(false); |
|
1131 |
+ btn_speaker.setEnabled(false); |
|
1132 |
+ isSpeakerphoneOn=false; |
|
1133 |
+ btn_speaker.setText(R.string.btn_speaker_off); |
|
1134 |
+ registered = false; |
|
1135 |
+ invalidateOptionsMenu(); |
|
1136 |
+ } |
|
1137 |
+ |
|
1138 |
+ private void isRegisted(boolean success,String mcpttID,String displayName){ |
|
1139 |
+ userData.setRegisted(success); |
|
1140 |
+ if(mcpttID!=null) |
|
1141 |
+ userData.setMcpttID(mcpttID); |
|
1142 |
+ if(displayName!=null){ |
|
1143 |
+ userData.setDisplayName(displayName); |
|
1144 |
+ } |
|
1145 |
+ text_info.setText("REGISTERED - MCPTT ID: " + mcpttID + " DISPLAY NAME: " + displayName); |
|
1146 |
+ text_status.setText(displayName); |
|
1147 |
+ btn_unregister.setEnabled(true); |
|
1148 |
+ btn_register.setEnabled(false); |
|
1149 |
+ btn_call.setBackgroundResource(R.drawable.token_default); |
|
1150 |
+ reg_status.setEnabled(true); |
|
1151 |
+ btn_er.setEnabled(true); |
|
1152 |
+ btn_call.setEnabled(true); |
|
1153 |
+ switchCompat.setEnabled(true); |
|
1154 |
+ switchCompat.setChecked(false); |
|
1155 |
+ switch_group.setTextColor(ContextCompat.getColor(this, R.color.white)); |
|
1156 |
+ switch_private.setTextColor(ContextCompat.getColor(this, R.color.white)); |
|
1157 |
+ spinnerGroups.setEnabled(true); |
|
1158 |
+ spinnerUsers.setEnabled(false); |
|
1159 |
+ spinnerUsers.setVisibility((View.GONE)); |
|
1160 |
+ spinnerGroups.setVisibility((View.VISIBLE)); |
|
1161 |
+ btn_speaker.setEnabled(true); |
|
1162 |
+ registered = true; |
|
1163 |
+ invalidateOptionsMenu(); |
|
1164 |
+ } |
|
1165 |
+ |
|
1166 |
+ private void showData(String eventType, String data){ |
|
1167 |
+ text_info.setText(eventType + ": " + data); |
|
1168 |
+ } |
|
1169 |
+ |
|
1170 |
+ private void showLastError(String from, int code, String errorString){ |
|
1171 |
+ Log.e(TAG,"ERROR " + from + ": " + code + " " + errorString); |
|
1172 |
+ text_info.setText("ERROR " + from + ": " + code + " " + errorString); |
|
1173 |
+ } |
|
1174 |
+ |
|
1175 |
+ private void showGroups(Map<String, Integer> groups){ |
|
1176 |
+ String result=""; |
|
1177 |
+ if(groups!=null){ |
|
1178 |
+ groupsCurrent=new ArrayList<>(); |
|
1179 |
+ for (String groupID:groups.keySet()){ |
|
1180 |
+ String type=""; |
|
1181 |
+ switch (ConstantsMCOP.GroupAffiliationEventExtras.GroupAffiliationStateEnum.fromInt(groups.get(groupID))){ |
|
1182 |
+ case notaffiliated: |
|
1183 |
+ type="notaffiliated"; |
|
1184 |
+ break; |
|
1185 |
+ case affiliating: |
|
1186 |
+ type="affiliating"; |
|
1187 |
+ break; |
|
1188 |
+ case affiliated: |
|
1189 |
+ type="affiliated"; |
|
1190 |
+ groupsCurrent.add(groupID); |
|
1191 |
+ break; |
|
1192 |
+ case deaffiliating: |
|
1193 |
+ type="deaffiliating"; |
|
1194 |
+ break; |
|
1195 |
+ } |
|
1196 |
+ result=result+"groupID:"+groupID+":"+type+"\n"; |
|
1197 |
+ } |
|
1198 |
+ loadGroups(); |
|
1199 |
+ } |
|
1200 |
+ text_affiliation.setText("List Affiliation Groups: \n"+result); |
|
1201 |
+ } |
|
1202 |
+ |
|
1203 |
+ @Override |
|
1204 |
+ public boolean onCreateOptionsMenu(Menu menu) { |
|
1205 |
+ // Inflate the menu; this adds items to the action bar if it is present. |
|
1206 |
+ getMenuInflater().inflate(R.menu.menu_main, menu); |
|
1207 |
+ itemIdMSCSM = menu.findItem(R.id.action_registration); |
|
1208 |
+ itemAutoReg = menu.findItem(R.id.action_auto_reg); |
|
1209 |
+ itemExit = menu.findItem(R.id.action_exit); |
|
1210 |
+ if (registered) { |
|
1211 |
+ itemIdMSCSM.setVisible(false); |
|
1212 |
+ itemAutoReg.setVisible(false); |
|
1213 |
+ itemExit.setVisible(false); |
|
1214 |
+ } else { |
|
1215 |
+ itemIdMSCSM.setVisible(true); |
|
1216 |
+ itemAutoReg.setVisible(true); |
|
1217 |
+ itemExit.setVisible(true); |
|
1218 |
+ } |
|
1219 |
+ return true; |
|
1220 |
+ } |
|
1221 |
+ |
|
1222 |
+ @Override |
|
1223 |
+ public boolean onOptionsItemSelected(MenuItem item) { |
|
1224 |
+ boolean result; |
|
1225 |
+ result = super.onOptionsItemSelected(item); |
|
1226 |
+ // Handle action bar item clicks. The action bar will |
|
1227 |
+ // automatically handle clicks on the Home/Up button, as long |
|
1228 |
+ // as you specify a parent activity in AndroidManifest.xml. |
|
1229 |
+ int id = item.getItemId(); |
|
1230 |
+ // No inspection SimplifiableIfStatement |
|
1231 |
+ switch (id) { |
|
1232 |
+ case R.id.action_registration: |
|
1233 |
+ if (BuildConfig.DEBUG) Log.d(TAG, "Selected Registration configuration"); |
|
1234 |
+ mDialogMenu = DialogMenu.newInstance(regConfig, IdMSCMS?"IdMS/CMS":"None"); |
|
1235 |
+ mDialogMenu.setOnClickItemListener(new DialogMenu.OnClickListener() { |
|
1236 |
+ @Override |
|
1237 |
+ public void onClickItem(int item) { |
|
1238 |
+ if(item>=0 && regConfig.length>item){ |
|
1239 |
+ Log.d(TAG,"Selected registration configuration: " + regConfig[item]); |
|
1240 |
+ if (regConfig[item].equals("IdMS/CMS")) { |
|
1241 |
+ IdMSCMS = true; |
|
1242 |
+ Toast.makeText(getApplicationContext(),"IdMS/CMS Registration",Toast.LENGTH_SHORT).show(); |
|
1243 |
+ } else if (regConfig[item].equals("None")) { |
|
1244 |
+ IdMSCMS = false; |
|
1245 |
+ Toast.makeText(getApplicationContext(),"None",Toast.LENGTH_SHORT).show(); |
|
1246 |
+ } |
|
1247 |
+ } |
|
1248 |
+ saveConfiguration(); |
|
1249 |
+ } |
|
1250 |
+ }); |
|
1251 |
+ mDialogMenu.show(getSupportFragmentManager(), "SimpleDialog"); |
|
1252 |
+ break; |
|
1253 |
+ case R.id.action_auto_reg: |
|
1254 |
+ if (BuildConfig.DEBUG) Log.d(TAG, "Selected Auto-Registration"); |
|
1255 |
+ mDialogMenu = DialogMenu.newInstance(autoReg, autoRegister?"Automatic":"Manual"); |
|
1256 |
+ mDialogMenu.setOnClickItemListener(new DialogMenu.OnClickListener() { |
|
1257 |
+ @Override |
|
1258 |
+ public void onClickItem(int item) { |
|
1259 |
+ if(item>=0 && autoReg.length>item){ |
|
1260 |
+ Log.d(TAG,"Selected registration configuration: " + autoReg[item]); |
|
1261 |
+ if (autoReg[item].equals("Automatic")) { |
|
1262 |
+ autoRegister = true; |
|
1263 |
+ Toast.makeText(getApplicationContext(),"Auto-Registration",Toast.LENGTH_SHORT).show(); |
|
1264 |
+ register(); |
|
1265 |
+ } else if (autoReg[item].equals("Manual")) { |
|
1266 |
+ autoRegister = false; |
|
1267 |
+ Toast.makeText(getApplicationContext(),"Manual Registration",Toast.LENGTH_SHORT).show(); |
|
1268 |
+ } |
|
1269 |
+ } |
|
1270 |
+ saveConfiguration(); |
|
1271 |
+ } |
|
1272 |
+ }); |
|
1273 |
+ mDialogMenu.show(getSupportFragmentManager(), "SimpleDialog"); |
|
1274 |
+ break; |
|
1275 |
+ case R.id.action_about: |
|
1276 |
+ if (BuildConfig.DEBUG) Log.d(TAG, "Selected About"); |
|
1277 |
+ mDialogAlert = DialogAlert.newInstance(getAbout(this), getString(R.string.option_about), false); |
|
1278 |
+ mDialogAlert.show(getSupportFragmentManager(), "SimpleDialog"); |
|
1279 |
+ break; |
|
1280 |
+ case R.id.action_exit: |
|
1281 |
+ if (BuildConfig.DEBUG) Log.d(TAG, "Selected Exit"); |
|
1282 |
+ saveConfiguration(); |
|
1283 |
+ if (mService != null){ |
|
1284 |
+ try { |
|
1285 |
+ mService.unLoginMCOP(); |
|
1286 |
+ } catch (RemoteException e) { |
|
1287 |
+ e.printStackTrace(); |
|
1288 |
+ } |
|
1289 |
+ } |
|
1290 |
+ android.os.Process.killProcess(android.os.Process.myPid()); |
|
1291 |
+ break; |
|
1292 |
+ default: |
|
1293 |
+ break; |
|
1294 |
+ } |
|
1295 |
+ saveConfiguration(); |
|
1296 |
+ return result; |
|
1297 |
+ } |
|
1298 |
+ |
|
1299 |
+ public static String getAbout(Context context){ |
|
1300 |
+ if(context==null)return ""; |
|
1301 |
+ PackageInfo pInfo = null; |
|
1302 |
+ String version = null; |
|
1303 |
+ try { |
|
1304 |
+ pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); |
|
1305 |
+ version = pInfo.versionName; |
|
1306 |
+ } catch (PackageManager.NameNotFoundException e) { |
|
1307 |
+ version=null; |
|
1308 |
+ } |
|
1309 |
+ String about=context.getString(R.string.app_name) + "\n"; |
|
1310 |
+ about+=context.getString(R.string.Build_version)+": " + version; |
|
1311 |
+ about+="\n"+context.getString(R.string.Developed_by)+": " + context.getString(R.string.web); |
|
1312 |
+ about+="\n"+context.getString(R.string.copyright); |
|
1313 |
+ |
|
1314 |
+ return about; |
|
1315 |
+ } |
|
1316 |
+ // END GUI |
|
1317 |
+ |
|
1318 |
+ /** |
|
1319 |
+ * Set permissions for Android 6.0 or above |
|
1320 |
+ */ |
|
1321 |
+ protected void setPermissions(){ |
|
1322 |
+ //Set permissions |
|
1323 |
+ //READ_PHONE_STATE |
|
1324 |
+ if (ContextCompat.checkSelfPermission(this, |
|
1325 |
+ Manifest.permission.RECORD_AUDIO) |
|
1326 |
+ != PackageManager.PERMISSION_GRANTED || |
|
1327 |
+ ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED || |
|
1328 |
+ ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED || |
|
1329 |
+ ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED || |
|
1330 |
+ ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED |
|
1331 |
+ ) { |
|
1332 |
+ if (ActivityCompat.shouldShowRequestPermissionRationale(this, |
|
1333 |
+ Manifest.permission.RECORD_AUDIO)) { |
|
1334 |
+ //Show an explanation to the user *asynchronously* -- don't block |
|
1335 |
+ //this thread waiting for the user's response! After the user |
|
1336 |
+ //sees the explanation, request the permission again. |
|
1337 |
+ ActivityCompat.requestPermissions(this, |
|
1338 |
+ new String[]{Manifest.permission.RECORD_AUDIO,Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.CAMERA,Manifest.permission.READ_PHONE_STATE}, |
|
1339 |
+ GET_PERMISSION); |
|
1340 |
+ } else { |
|
1341 |
+ //No explanation needed, we can request the permission. |
|
1342 |
+ ActivityCompat.requestPermissions(this, |
|
1343 |
+ new String[]{Manifest.permission.RECORD_AUDIO,Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.CAMERA,Manifest.permission.READ_PHONE_STATE}, |
|
1344 |
+ GET_PERMISSION); |
|
1345 |
+ |
|
1346 |
+ //MY_PERMISSIONS_REQUEST_READ_CONTACTS is an |
|
1347 |
+ //app-defined int constant. The callback method gets the |
|
1348 |
+ //result of the request. |
|
1349 |
+ } |
|
1350 |
+ } |
|
1351 |
+ } |
|
1352 |
+ |
|
1353 |
+ @Override |
|
1354 |
+ public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { |
|
1355 |
+ super.onRequestPermissionsResult(requestCode, permissions,grantResults); |
|
1356 |
+ switch (requestCode) { |
|
1357 |
+ case GET_PERMISSION: { |
|
1358 |
+ //If request is cancelled, result arrays are empty. |
|
1359 |
+ if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { |
|
1360 |
+ //Permission was granted, yay! Do the |
|
1361 |
+ //contacts-related task you need to do. |
|
1362 |
+ //API>22 |
|
1363 |
+ setPermissionsWriteSetting(); |
|
1364 |
+ connectService(); |
|
1365 |
+ } else { |
|
1366 |
+ setPermissions(); |
|
1367 |
+ //Permission denied, boo! Disable the |
|
1368 |
+ //functionality that depends on this permission. |
|
1369 |
+ } |
|
1370 |
+ return; |
|
1371 |
+ } |
|
1372 |
+ default: |
|
1373 |
+ break; |
|
1374 |
+ //other 'case' lines to check for other |
|
1375 |
+ //permissions this app might request |
|
1376 |
+ } |
|
1377 |
+ } |
|
1378 |
+ |
|
1379 |
+ /** |
|
1380 |
+ * API>22 |
|
1381 |
+ */ |
|
1382 |
+ @TargetApi(Build.VERSION_CODES.M) |
|
1383 |
+ protected void setPermissionsWriteSetting(){ |
|
1384 |
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |
|
1385 |
+ if (Settings.System.canWrite(this) ){ |
|
1386 |
+ //Do stuff here |
|
1387 |
+ } else { |
|
1388 |
+ Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_WRITE_SETTINGS); |
|
1389 |
+ intent.setData(Uri.parse("package:"+ this.getPackageName())); |
|
1390 |
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
|
1391 |
+ startActivity(intent); |
|
1392 |
+ } |
|
1393 |
+ } |
|
1394 |
+ } |
|
1395 |
+ |
|
1396 |
+ private Map<String,String> getProfilesParameters(List<String> parameters){ |
|
1397 |
+ Map<String,String> parametersMap=new HashMap<>(); |
|
1398 |
+ if(parameters!=null && !parameters.isEmpty()){ |
|
1399 |
+ Log.i(TAG,"External parameters"); |
|
1400 |
+ }else{ |
|
1401 |
+ Log.i(TAG,"No external parameters"); |
|
1402 |
+ parameters=loadParameters(); |
|
1403 |
+ } |
|
1404 |
+ |
|
1405 |
+ if(parameters!=null && !parameters.isEmpty()) |
|
1406 |
+ for (String parameter:parameters){ |
|
1407 |
+ Log.i(TAG,"parameter: "+parameter); |
|
1408 |
+ String[] parametersSplit=parameter.split(":"); |
|
1409 |
+ if(parametersSplit!=null && parametersSplit.length==2){ |
|
1410 |
+ parametersMap.put(parametersSplit[0],parametersSplit[1]); |
|
1411 |
+ } |
|
1412 |
+ } |
|
1413 |
+ if(parametersMap!=null && !parametersMap.isEmpty()){ |
|
1414 |
+ saveParameters(parameters); |
|
1415 |
+ } |
|
1416 |
+ return parametersMap; |
|
1417 |
+ } |
|
1418 |
+ |
|
1419 |
+ private boolean saveParameters(List<String> parameters){ |
|
1420 |
+ if(preferencesManager!=null){ |
|
1421 |
+ return preferencesManager.putStringSet(this, PARAMETER_SAVE_PROFILE,new HashSet<String>(parameters)); |
|
1422 |
+ } |
|
1423 |
+ return false; |
|
1424 |
+ } |
|
1425 |
+ |
|
1426 |
+ private ArrayList<String> loadParameters(){ |
|
1427 |
+ if(preferencesManager!=null){ |
|
1428 |
+ Set<String> stringSet=preferencesManager.getStringSet(this, PARAMETER_SAVE_PROFILE); |
|
1429 |
+ if(stringSet!=null){ |
|
1430 |
+ return (new ArrayList<String>(stringSet)); |
|
1431 |
+ } |
|
1432 |
+ } |
|
1433 |
+ return null; |
|
1434 |
+ } |
|
1435 |
+ |
|
1436 |
+ private boolean saveConfiguration(){ |
|
1437 |
+ if(preferencesManager!=null){ |
|
1438 |
+ if (IdMSCMS) { |
|
1439 |
+ preferencesManager.putString(this, PARAMETER_CONFIG_IDMSCMS, "IdMS/CMS"); |
|
1440 |
+ } else { |
|
1441 |
+ preferencesManager.putString(this, PARAMETER_CONFIG_IDMSCMS, "None"); |
|
1442 |
+ } |
|
1443 |
+ if (autoRegister) { |
|
1444 |
+ preferencesManager.putString(this, PARAMETER_CONFIG_AUTOREGISTER, "Automatic"); |
|
1445 |
+ } else { |
|
1446 |
+ preferencesManager.putString(this, PARAMETER_CONFIG_AUTOREGISTER, "Manual"); |
|
1447 |
+ } |
|
1448 |
+ return true; |
|
1449 |
+ } |
|
1450 |
+ return false; |
|
1451 |
+ } |
|
1452 |
+ |
|
1453 |
+ private void loadConfiguration(){ |
|
1454 |
+ if(preferencesManager!=null){ |
|
1455 |
+ String idmscms = preferencesManager.getString(this, PARAMETER_CONFIG_IDMSCMS, "None"); |
|
1456 |
+ if (idmscms.equals("IdMS/CMS")) { |
|
1457 |
+ IdMSCMS = true; |
|
1458 |
+ } else { |
|
1459 |
+ IdMSCMS = false; |
|
1460 |
+ } |
|
1461 |
+ String auto = preferencesManager.getString(this, PARAMETER_CONFIG_AUTOREGISTER, "Manual"); |
|
1462 |
+ if (auto.equals("Automatic")) { |
|
1463 |
+ autoRegister = true; |
|
1464 |
+ } else { |
|
1465 |
+ autoRegister = false; |
|
1466 |
+ } |
|
1467 |
+ } |
|
1468 |
+ } |
|
1469 |
+ |
|
1470 |
+ private void connectService(){ |
|
1471 |
+ connectService(null); |
|
1472 |
+ } |
|
1473 |
+ |
|
1474 |
+ private void connectService(String client){ |
|
1475 |
+ if(BuildConfig.DEBUG)Log.d(TAG,"connectService execute"); |
|
1476 |
+ if(!isConnect){ |
|
1477 |
+ serviceIntent = new Intent() |
|
1478 |
+ .setComponent(new ComponentName( |
|
1479 |
+ "org.mcopenplatform.muoapi", |
|
1480 |
+ "org.mcopenplatform.muoapi.MCOPsdk")); |
|
1481 |
+ |
|
1482 |
+ if(client!=null && !client.trim().isEmpty()){ |
|
1483 |
+ Log.i(TAG,"Current profile: "+currentProfile); |
|
1484 |
+ serviceIntent.putExtra("PROFILE_SELECT", currentProfile!=null?currentProfile:client); |
|
1485 |
+ } |
|
1486 |
+ |
|
1487 |
+ serviceIntent.putExtra(ConstantsMCOP.MBMS_PLUGIN_PACKAGE_ID, "com.expway.embmsserver"); |
|
1488 |
+ serviceIntent.putExtra(ConstantsMCOP.MBMS_PLUGIN_SERVICE_ID, "com.expway.embmsserver.MCOP"); |
|
1489 |
+ |
|
1490 |
+ try{ |
|
1491 |
+ ComponentName componentName; |
|
1492 |
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
|
1493 |
+ componentName = this.startForegroundService(serviceIntent); |
|
1494 |
+ } else { |
|
1495 |
+ componentName = this.startService(serviceIntent); |
|
1496 |
+ } |
|
1497 |
+ if(componentName==null){ |
|
1498 |
+ Log.e(TAG,"Starting Error: "+componentName.getPackageName()); |
|
1499 |
+ }else if(serviceIntent==null){ |
|
1500 |
+ Log.e(TAG,"serviceIntent Error: "+componentName.getPackageName()); |
|
1501 |
+ }else if(mConnection==null){ |
|
1502 |
+ Log.e(TAG,"mConnection Error: "+componentName.getPackageName()); |
|
1503 |
+ }else{ |
|
1504 |
+ |
|
1505 |
+ } |
|
1506 |
+ }catch (Exception e){ |
|
1507 |
+ if(BuildConfig.DEBUG)Log.w(TAG,"Error in start service: "+e.getMessage()); |
|
1508 |
+ } |
|
1509 |
+ if(mConnection!=null) |
|
1510 |
+ Log.i(TAG,"Bind Service: "+bindService(serviceIntent, mConnection, BIND_AUTO_CREATE)); |
|
1511 |
+ } |
|
1512 |
+ } |
|
1155 | 1513 |
} |
1156 | 1514 |
\ No newline at end of file |
1157 | 1515 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,219 @@ |
0 |
+/* |
|
1 |
+ * |
|
2 |
+ * Copyright (C) 2018 Eduardo Zarate Lasurtegui |
|
3 |
+ * Copyright (C) 2018, University of the Basque Country (UPV/EHU) |
|
4 |
+ * |
|
5 |
+ * Contact for licensing options: <licensing-mcpttclient(at)mcopenplatform(dot)com> |
|
6 |
+ * |
|
7 |
+ * This file is part of MCOP MCPTT Client |
|
8 |
+ * |
|
9 |
+ * This is free software: you can redistribute it and/or modify it under the terms of |
|
10 |
+ * the GNU General Public License as published by the Free Software Foundation, either version 3 |
|
11 |
+ * of the License, or (at your option) any later version. |
|
12 |
+ * |
|
13 |
+ * This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
14 |
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
15 |
+ * See the GNU General Public License for more details. |
|
16 |
+ * |
|
17 |
+ * You should have received a copy of the GNU General Public License along |
|
18 |
+ * with this program; if not, write to the Free Software Foundation, Inc., |
|
19 |
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
+ */ |
|
21 |
+ |
|
22 |
+ |
|
23 |
+package org.test.client.mcopclient; |
|
24 |
+ |
|
25 |
+import android.content.Context; |
|
26 |
+import android.content.Intent; |
|
27 |
+import android.net.Uri; |
|
28 |
+import android.os.Bundle; |
|
29 |
+import android.os.Handler; |
|
30 |
+import android.support.v7.app.AppCompatActivity; |
|
31 |
+import android.util.Log; |
|
32 |
+import android.webkit.CookieManager; |
|
33 |
+import android.webkit.CookieSyncManager; |
|
34 |
+import android.webkit.WebSettings; |
|
35 |
+import android.webkit.WebView; |
|
36 |
+import android.webkit.WebViewClient; |
|
37 |
+ |
|
38 |
+ |
|
39 |
+ |
|
40 |
+import java.net.URI; |
|
41 |
+import java.net.URISyntaxException; |
|
42 |
+ |
|
43 |
+public class ScreenAuthenticationWebView extends AppCompatActivity { |
|
44 |
+ |
|
45 |
+ private final static String TAG = Utils.getTAG(ScreenAuthenticationWebView.class.getCanonicalName()); |
|
46 |
+ private Context mContext; |
|
47 |
+ public final static int RETURN_ON_AUTHENTICATION_LISTENER_OK= 6547; |
|
48 |
+ public final static int RETURN_ON_AUTHENTICATION_LISTENER_FAILURE= 6548; |
|
49 |
+ public final static String RETURN_ON_AUTHENTICATION_CAMPS= "RETURN__ON_AUTHENTICATION_CAMPS."+TAG; |
|
50 |
+ public final static String RETURN_ON_AUTHENTICATION_ERROR= "RETURN__ON_AUTHENTICATION_ERROR."+TAG; |
|
51 |
+ public final static String RETURN_ON_AUTHENTICATION_RESPONSE= "RETURN__ON_AUTHENTICATION_RESPONSE."+TAG; |
|
52 |
+ |
|
53 |
+ public final static String DATA_URI_INTENT= "DATA_URI_INTENT."+TAG; |
|
54 |
+ public final static String DATA_REDIRECTION_URI= "DATA_REDIRECTION_URI."+TAG; |
|
55 |
+ public final static String DATA_USER= "DATA_USER."+TAG; |
|
56 |
+ public final static String DATA_PASS= "DATA_PASS."+TAG; |
|
57 |
+ private final static String QUERY_PATH="code"; |
|
58 |
+ |
|
59 |
+ private final static int TIME_DELAY_MSEG=3000; |
|
60 |
+ |
|
61 |
+ private WebView screen_authentication_WebView_info; |
|
62 |
+ private String userAuthentication; |
|
63 |
+ private String passAuthentication; |
|
64 |
+ private String uriString; |
|
65 |
+ private Runnable mRunnableCheckUrl; |
|
66 |
+ private Handler handler; |
|
67 |
+ private URI redirectionDataUri; |
|
68 |
+ |
|
69 |
+ |
|
70 |
+ @Override |
|
71 |
+ protected void onCreate(Bundle savedInstanceState) { |
|
72 |
+ super.onCreate(savedInstanceState); |
|
73 |
+ setContentView(R.layout.screen_authentication_web); |
|
74 |
+ |
|
75 |
+ mContext=this; |
|
76 |
+ Log.d(TAG,"Init proccess for token"); |
|
77 |
+ //Init Delete all Cache for webView |
|
78 |
+ CookieSyncManager.createInstance(this); |
|
79 |
+ CookieManager cookieManager = CookieManager.getInstance(); |
|
80 |
+ cookieManager.removeAllCookie(); |
|
81 |
+ //End Delete all Cache for webView |
|
82 |
+ screen_authentication_WebView_info=(WebView)findViewById(R.id.screen_authentication_WebView_info); |
|
83 |
+ // Force links and redirects to open in the WebView instead of in a browser |
|
84 |
+ screen_authentication_WebView_info.setWebViewClient(new WebViewClient()); |
|
85 |
+ // Enable Javascript |
|
86 |
+ WebSettings webSettings = screen_authentication_WebView_info.getSettings(); |
|
87 |
+ webSettings.setJavaScriptEnabled(true); |
|
88 |
+ webSettings.setAppCacheEnabled(false); |
|
89 |
+ webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); |
|
90 |
+ Intent intent=getIntent(); |
|
91 |
+ if (intent != null) { |
|
92 |
+ uriString=intent.getStringExtra(DATA_URI_INTENT); |
|
93 |
+ String redirectionDataString=intent.getStringExtra(DATA_REDIRECTION_URI); |
|
94 |
+ if(redirectionDataString==null || redirectionDataString.trim().isEmpty()){ |
|
95 |
+ Log.e(TAG,"Data for redirectionURI isn´t valid"); |
|
96 |
+ sendError("Data for redirectionURI isn´t valid"); |
|
97 |
+ }else{ |
|
98 |
+ try { |
|
99 |
+ redirectionDataUri=new URI(redirectionDataString); |
|
100 |
+ } catch (URISyntaxException e) { |
|
101 |
+ Log.e(TAG,"Error parse redirection URI. "+e.getMessage() ); |
|
102 |
+ sendError("Error parse redirection URI. "+e.getMessage()); |
|
103 |
+ } |
|
104 |
+ } |
|
105 |
+ userAuthentication=intent.getStringExtra(DATA_USER); |
|
106 |
+ passAuthentication=intent.getStringExtra(DATA_PASS); |
|
107 |
+ if(uriString!=null){ |
|
108 |
+ screen_authentication_WebView_info.loadUrl(uriString); |
|
109 |
+ } |
|
110 |
+ |
|
111 |
+ } |
|
112 |
+ screen_authentication_WebView_info.setWebViewClient(new WebViewClient(){ |
|
113 |
+ @Override |
|
114 |
+ public void onReceivedError(final WebView view, int errorCode, String description, |
|
115 |
+ final String failingUrl) { |
|
116 |
+ |
|
117 |
+ Uri uri=Uri.parse(screen_authentication_WebView_info.getUrl()); |
|
118 |
+ if(((uri.getScheme().compareToIgnoreCase(redirectionDataUri.getScheme())!=0 || |
|
119 |
+ uri.getHost().compareToIgnoreCase(redirectionDataUri.getHost())!=0 || |
|
120 |
+ uri.getPort()!=redirectionDataUri.getPort() )&& |
|
121 |
+ description.trim().compareTo("net::ERR_CONNECTION_REFUSED") ==0 |
|
122 |
+ )){ |
|
123 |
+ Log.e(TAG,"Error in web code: "+errorCode+" des: "+description); |
|
124 |
+ finishError(getString(R.string.Error_in_authetication)+" code: "+errorCode+" des: "+description); |
|
125 |
+ } |
|
126 |
+ |
|
127 |
+ super.onReceivedError(view, errorCode, description, failingUrl); |
|
128 |
+ |
|
129 |
+ } |
|
130 |
+ |
|
131 |
+ @Override |
|
132 |
+ public void onPageFinished(WebView view, String url) |
|
133 |
+ { |
|
134 |
+ if(userAuthentication!=null && passAuthentication!=null){ |
|
135 |
+ screen_authentication_WebView_info.loadUrl("javascript:(function() { document.getElementById('j_username').value = '" + userAuthentication + "'; ;})()"); |
|
136 |
+ screen_authentication_WebView_info.loadUrl("javascript:(function() { document.getElementById('j_password').value = '" + passAuthentication + "'; ;})()"); |
|
137 |
+ } |
|
138 |
+ checkUrl(); |
|
139 |
+ } |
|
140 |
+ }); |
|
141 |
+ } |
|
142 |
+ |
|
143 |
+ private void checkUrl(){ |
|
144 |
+ handler = new Handler(); |
|
145 |
+ mRunnableCheckUrl=new Runnable() { |
|
146 |
+ @Override |
|
147 |
+ public void run() { |
|
148 |
+ try { |
|
149 |
+ Uri uri=Uri.parse(screen_authentication_WebView_info.getUrl()); |
|
150 |
+ String scheme=uri.getScheme(); |
|
151 |
+ String host=uri.getHost(); |
|
152 |
+ String path=uri.getPath(); |
|
153 |
+ if(scheme.compareToIgnoreCase(redirectionDataUri.getScheme())==0 && |
|
154 |
+ host.compareToIgnoreCase(redirectionDataUri.getHost())==0 && |
|
155 |
+ uri.getPort()==redirectionDataUri.getPort() && |
|
156 |
+ path.contains(redirectionDataUri.getPath()) |
|
157 |
+ ){ |
|
158 |
+ Intent intent = new Intent(); |
|
159 |
+ intent.putExtra(RETURN_ON_AUTHENTICATION_RESPONSE, uri.toString()); |
|
160 |
+ setResult(RETURN_ON_AUTHENTICATION_LISTENER_OK,intent); |
|
161 |
+ finish(); |
|
162 |
+ } |
|
163 |
+ else{ |
|
164 |
+ if(userAuthentication!=null && |
|
165 |
+ !userAuthentication.isEmpty() && |
|
166 |
+ passAuthentication!=null && |
|
167 |
+ !passAuthentication.isEmpty()) { |
|
168 |
+ //Configure user and pass And click in submit |
|
169 |
+ screen_authentication_WebView_info.loadUrl("javascript:(function() { document.getElementsByName('submit')[0].click(); })()"); |
|
170 |
+ //Click in Authorize |
|
171 |
+ screen_authentication_WebView_info.loadUrl("javascript:(function() { document.getElementsByName('authorize')[0].click(); })()"); |
|
172 |
+ |
|
173 |
+ }else{ |
|
174 |
+ //In this situation the |
|
175 |
+ checkUrl(); |
|
176 |
+ } |
|
177 |
+ } |
|
178 |
+ } catch (Exception e) { |
|
179 |
+ Log.e(TAG,"Error checking Url authentication: "+e.getMessage()); |
|
180 |
+ e.printStackTrace(); |
|
181 |
+ } |
|
182 |
+ |
|
183 |
+ } |
|
184 |
+ }; |
|
185 |
+ handler.postDelayed(mRunnableCheckUrl,TIME_DELAY_MSEG); |
|
186 |
+ } |
|
187 |
+ |
|
188 |
+ @Override |
|
189 |
+ protected void onStart() { |
|
190 |
+ super.onStart(); |
|
191 |
+ } |
|
192 |
+ |
|
193 |
+ |
|
194 |
+ @Override |
|
195 |
+ protected void onNewIntent(Intent intent) { |
|
196 |
+ |
|
197 |
+ } |
|
198 |
+ |
|
199 |
+ @Override |
|
200 |
+ public void finish(){ |
|
201 |
+ if(handler!=null){ |
|
202 |
+ handler.removeCallbacks(mRunnableCheckUrl); |
|
203 |
+ } |
|
204 |
+ super.finish(); |
|
205 |
+ } |
|
206 |
+ |
|
207 |
+ public void finishError(String error){ |
|
208 |
+ sendError(error); |
|
209 |
+ finish(); |
|
210 |
+ } |
|
211 |
+ |
|
212 |
+ private void sendError(String error){ |
|
213 |
+ Intent intent = new Intent(); |
|
214 |
+ intent.putExtra(RETURN_ON_AUTHENTICATION_ERROR,error); |
|
215 |
+ setResult(RETURN_ON_AUTHENTICATION_LISTENER_FAILURE,intent); |
|
216 |
+ } |
|
217 |
+ |
|
218 |
+} |
... | ... |
@@ -1,317 +1,385 @@ |
1 |
-<?xml version="1.0" encoding="utf-8"?> |
|
2 |
-<!--* |
|
3 |
- * |
|
4 |
- * Copyright (C) 2018 Ander Nieva Anza |
|
5 |
- * Copyright (C) 2018, University of the Basque Country (UPV/EHU) |
|
6 |
- * |
|
7 |
- * Contact for licensing options: <licensing-mcpttclient(at)mcopenplatform(dot)com> |
|
8 |
- * |
|
9 |
- * This file is part of MCOP MCPTT Client |
|
10 |
- * |
|
11 |
- * This is free software: you can redistribute it and/or modify it under the terms of |
|
12 |
- * the GNU General Public License as published by the Free Software Foundation, either version 3 |
|
13 |
- * of the License, or (at your option) any later version. |
|
14 |
- * |
|
15 |
- * This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
16 |
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
17 |
- * See the GNU General Public License for more details. |
|
18 |
- * |
|
19 |
- * You should have received a copy of the GNU General Public License along |
|
20 |
- * with this program; if not, write to the Free Software Foundation, Inc., |
|
21 |
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
22 |
- * |
|
23 |
- *--> |
|
24 |
- |
|
25 |
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
26 |
- xmlns:app="http://schemas.android.com/apk/res-auto" |
|
27 |
- xmlns:tools="http://schemas.android.com/tools" |
|
28 |
- android:layout_width="match_parent" |
|
29 |
- android:layout_height="match_parent" |
|
30 |
- android:background="@color/background" |
|
31 |
- tools:context="org.test.client.mcopclient.MainActivity"> |
|
32 |
- |
|
33 |
- <LinearLayout |
|
34 |
- android:layout_width="wrap_content" |
|
35 |
- android:layout_height="wrap_content" |
|
36 |
- android:orientation="vertical"> |
|
37 |
- |
|
38 |
- <ImageView |
|
39 |
- android:id="@+id/logoMCOP" |
|
40 |
- android:layout_width="match_parent" |
|
41 |
- android:layout_height="56dp" |
|
42 |
- android:background="@color/colorPrimaryDark" |
|
43 |
- app:srcCompat="@drawable/mcop_logo" /> |
|
44 |
- </LinearLayout> |
|
45 |
- |
|
46 |
- <LinearLayout |
|
47 |
- android:layout_width="match_parent" |
|
48 |
- android:layout_height="wrap_content" |
|
49 |
- android:layout_marginTop="55dp" |
|
50 |
- android:gravity="center_horizontal" |
|
51 |
- android:orientation="vertical" |
|
52 |
- app:layout_constraintTop_toTopOf="parent" |
|
53 |
- tools:layout_editor_absoluteX="2dp"> |
|
54 |
- |
|
55 |
- <RelativeLayout |
|
56 |
- android:layout_width="fill_parent" |
|
57 |
- android:layout_height="wrap_content" |
|
58 |
- android:layout_marginTop="10dp" |
|
59 |
- android:layout_weight="1" |
|
60 |
- android:orientation="horizontal"> |
|
61 |
- |
|
62 |
- <TextView |
|
63 |
- android:id="@+id/text_status" |
|
64 |
- android:layout_width="wrap_content" |
|
65 |
- android:layout_height="wrap_content" |
|
66 |
- android:layout_alignParentRight="true" |
|
67 |
- android:layout_marginLeft="10dp" |
|
68 |
- android:layout_marginRight="40dp" |
|
69 |
- android:layout_weight="1" |
|
70 |
- android:text="@string/text_status" |
|
71 |
- android:textColor="@color/white" |
|
72 |
- android:textSize="14sp" /> |
|
73 |
- |
|
74 |
- <Button |
|
75 |
- android:id="@+id/reg_status" |
|
76 |
- android:layout_width="21dp" |
|
77 |
- android:layout_height="21dp" |
|
78 |
- android:layout_alignParentRight="true" |
|
79 |
- android:layout_marginLeft="10dp" |
|
80 |
- android:layout_marginRight="15dp" |
|
81 |
- android:layout_weight="1" |
|
82 |
- android:background="@drawable/reg_status" |
|
83 |
- tools:layout_editor_absoluteX="21dp" |
|
84 |
- tools:layout_editor_absoluteY="21dp" /> |
|
85 |
- </RelativeLayout> |
|
86 |
- |
|
87 |
- <LinearLayout |
|
88 |
- android:layout_width="wrap_content" |
|
89 |
- android:layout_height="match_parent" |
|
90 |
- android:layout_weight="1" |
|
91 |
- android:layout_marginTop="3dp" |
|
92 |
- android:orientation="vertical"> |
|
93 |
- |
|
94 |
- <TextView |
|
95 |
- android:id="@+id/text_talking" |
|
96 |
- android:layout_width="match_parent" |
|
97 |
- android:layout_height="wrap_content" |
|
98 |
- android:text="@string/text_talking" |
|
99 |
- android:textSize="15sp" |
|
100 |
- android:textColor="@color/white"/> |
|
101 |
- <TextView |
|
102 |
- android:id="@+id/text_callingid" |
|
103 |
- android:layout_width="match_parent" |
|
104 |
- android:layout_height="wrap_content" |
|
105 |
- android:textSize="18sp" |
|
106 |
- android:textColor="@color/white"/> |
|
107 |
- </LinearLayout> |
|
108 |
- |
|
109 |
- <LinearLayout |
|
110 |
- android:layout_width="wrap_content" |
|
111 |
- android:layout_height="match_parent" |
|
112 |
- android:layout_marginTop="10dp" |
|
113 |
- android:layout_weight="1" |
|
114 |
- android:orientation="horizontal" |
|
115 |
- tools:layout_editor_absoluteX="8dp" |
|
116 |
- tools:layout_editor_absoluteY="8dp"> |
|
117 |
- |
|
118 |
- <Button |
|
119 |
- android:id="@+id/btn_register" |
|
120 |
- android:layout_width="85dp" |
|
121 |
- android:layout_height="85dp" |
|
122 |
- android:layout_marginLeft="10dp" |
|
123 |
- android:layout_marginRight="10dp" |
|
124 |
- android:layout_weight="1" |
|
125 |
- android:background="@drawable/circle_btn" |
|
126 |
- android:text="@string/btn_register" |
|
127 |
- android:textSize="10sp" |
|
128 |
- tools:layout_editor_absoluteX="85dp" |
|
129 |
- tools:layout_editor_absoluteY="85dp" /> |
|
130 |
- |
|
131 |
- <Button |
|
132 |
- android:id="@+id/btn_unregister" |
|
133 |
- android:layout_width="85dp" |
|
134 |
- android:layout_height="85dp" |
|
135 |
- android:layout_marginLeft="10dp" |
|
136 |
- android:layout_marginRight="10dp" |
|
137 |
- android:layout_weight="1" |
|
138 |
- android:background="@drawable/circle_btn" |
|
139 |
- android:text="@string/btn_unregister" |
|
140 |
- android:textSize="10sp" |
|
141 |
- tools:layout_editor_absoluteX="85dp" |
|
142 |
- tools:layout_editor_absoluteY="85dp" /> |
|
143 |
- </LinearLayout> |
|
144 |
- |
|
145 |
- <LinearLayout |
|
146 |
- android:layout_width="wrap_content" |
|
147 |
- android:layout_height="match_parent" |
|
148 |
- android:layout_weight="1" |
|
149 |
- android:orientation="horizontal" |
|
150 |
- tools:layout_editor_absoluteX="85dp"> |
|
151 |
- |
|
152 |
- <Button |
|
153 |
- android:id="@+id/btn_accept" |
|
154 |
- android:layout_width="85dp" |
|
155 |
- android:layout_height="85dp" |
|
156 |
- android:layout_weight="1" |
|
157 |
- android:background="@drawable/circle_btn" |
|
158 |
- android:text="@string/btn_accept" |
|
159 |
- android:textSize="10sp" |
|
160 |
- tools:layout_editor_absoluteX="85dp" |
|
161 |
- tools:layout_editor_absoluteY="85dp" /> |
|
162 |
- |
|
163 |
- <Button |
|
164 |
- android:id="@+id/btn_call" |
|
165 |
- android:layout_width="140dp" |
|
166 |
- android:layout_height="140dp" |
|
167 |
- android:layout_weight="1" |
|
168 |
- android:background="@drawable/token_inactive" |
|
169 |
- tools:layout_editor_absoluteX="85dp" |
|
170 |
- tools:layout_editor_absoluteY="85dp" /> |
|
171 |
- |
|
172 |
- <Button |
|
173 |
- android:id="@+id/btn_hangup" |
|
174 |
- android:layout_width="85dp" |
|
175 |
- android:layout_height="85dp" |
|
176 |
- android:layout_weight="1" |
|
177 |
- android:background="@drawable/circle_btn" |
|
178 |
- android:text="@string/btn_hangup" |
|
179 |
- android:textSize="10sp" |
|
180 |
- tools:layout_editor_absoluteX="85dp" |
|
181 |
- tools:layout_editor_absoluteY="85dp" /> |
|
182 |
- </LinearLayout> |
|
183 |
- |
|
184 |
- <LinearLayout |
|
185 |
- android:layout_width="wrap_content" |
|
186 |
- android:layout_height="match_parent" |
|
187 |
- android:layout_weight="1" |
|
188 |
- android:orientation="horizontal" |
|
189 |
- tools:layout_editor_absoluteX="8dp" |
|
190 |
- tools:layout_editor_absoluteY="8dp"> |
|
191 |
- |
|
192 |
- <Button |
|
193 |
- android:id="@+id/btn_speaker" |
|
194 |
- android:layout_width="85dp" |
|
195 |
- android:layout_height="85dp" |
|
196 |
- android:layout_marginLeft="10dp" |
|
197 |
- android:layout_marginRight="10dp" |
|
198 |
- android:layout_weight="1" |
|
199 |
- android:background="@drawable/circle_btn" |
|
200 |
- android:text="@string/btn_speaker_off" |
|
201 |
- android:textSize="10sp" |
|
202 |
- tools:layout_editor_absoluteX="85dp" |
|
203 |
- tools:layout_editor_absoluteY="85dp" /> |
|
204 |
- |
|
205 |
- <Button |
|
206 |
- android:id="@+id/btn_aux2" |
|
207 |
- android:layout_width="85dp" |
|
208 |
- android:layout_height="85dp" |
|
209 |
- android:layout_marginLeft="10dp" |
|
210 |
- android:layout_marginRight="10dp" |
|
211 |
- android:layout_weight="1" |
|
212 |
- android:background="@drawable/circle_btn" |
|
213 |
- android:text="@string/btn_aux2" |
|
214 |
- android:textSize="10sp" |
|
215 |
- tools:layout_editor_absoluteX="85dp" |
|
216 |
- tools:layout_editor_absoluteY="85dp" /> |
|
217 |
- </LinearLayout> |
|
218 |
- |
|
219 |
- <LinearLayout |
|
220 |
- android:layout_width="wrap_content" |
|
221 |
- android:layout_height="wrap_content" |
|
222 |
- android:layout_marginTop="15dp" |
|
223 |
- android:layout_weight="1" |
|
224 |
- android:gravity="bottom" |
|
225 |
- android:orientation="horizontal"> |
|
226 |
- |
|
227 |
- <TextView |
|
228 |
- android:id="@+id/switch_group" |
|
229 |
- android:layout_width="wrap_content" |
|
230 |
- android:layout_height="wrap_content" |
|
231 |
- android:layout_marginLeft="10dp" |
|
232 |
- android:layout_marginRight="10dp" |
|
233 |
- android:layout_weight="1" |
|
234 |
- android:text="@string/switch_group" |
|
235 |
- android:textColor="@color/white" |
|
236 |
- android:textSize="14sp" /> |
|
237 |
- |
|
238 |
- <android.support.v7.widget.SwitchCompat |
|
239 |
- android:id="@+id/switch_call" |
|
240 |
- style="@style/SwitchCompatTheme" |
|
241 |
- android:layout_width="wrap_content" |
|
242 |
- android:layout_height="wrap_content" |
|
243 |
- android:layout_marginTop="14dp" |
|
244 |
- android:layout_weight="1" /> |
|
245 |
- |
|
246 |
- <TextView |
|
247 |
- android:id="@+id/switch_private" |
|
248 |
- android:layout_width="wrap_content" |
|
249 |
- android:layout_height="wrap_content" |
|
250 |
- android:layout_marginLeft="10dp" |
|
251 |
- android:layout_marginRight="10dp" |
|
252 |
- android:layout_weight="1" |
|
253 |
- android:text="@string/switch_private" |
|
254 |
- android:textColor="@color/white" |
|
255 |
- android:textSize="14sp" /> |
|
256 |
- </LinearLayout> |
|
257 |
- |
|
258 |
- <LinearLayout |
|
259 |
- android:layout_width="wrap_content" |
|
260 |
- android:layout_height="match_parent" |
|
261 |
- android:layout_marginTop="10dp" |
|
262 |
- android:layout_weight="1" |
|
263 |
- android:gravity="bottom" |
|
264 |
- android:orientation="horizontal"> |
|
265 |
- |
|
266 |
- <Spinner |
|
267 |
- android:id="@+id/spinnerGroups" |
|
268 |
- android:layout_width="368dp" |
|
269 |
- android:layout_height="wrap_content" |
|
270 |
- android:layout_marginBottom="1dp" |
|
271 |
- android:layout_marginEnd="1dp" |
|
272 |
- android:layout_marginStart="5dp" |
|
273 |
- android:layout_marginTop="1dp" |
|
274 |
- android:enabled="false" /> |
|
275 |
- |
|
276 |
- <Spinner |
|
277 |
- android:id="@+id/spinnerUsers" |
|
278 |
- android:layout_width="368dp" |
|
279 |
- android:layout_height="wrap_content" |
|
280 |
- android:layout_marginBottom="1dp" |
|
281 |
- android:layout_marginEnd="1dp" |
|
282 |
- android:layout_marginStart="5dp" |
|
283 |
- android:layout_marginTop="1dp" |
|
284 |
- android:enabled="false" /> |
|
285 |
- </LinearLayout> |
|
286 |
- |
|
287 |
- <LinearLayout |
|
288 |
- android:layout_width="match_parent" |
|
289 |
- android:layout_height="match_parent" |
|
290 |
- android:layout_weight="1" |
|
291 |
- android:orientation="vertical"> |
|
292 |
- |
|
293 |
- <TextView |
|
294 |
- android:id="@+id/text_info" |
|
295 |
- android:layout_width="match_parent" |
|
296 |
- android:layout_height="wrap_content" |
|
297 |
- android:textSize="12sp" |
|
298 |
- android:textColor="#bebebe"/> |
|
299 |
- |
|
300 |
- <TextView |
|
301 |
- android:id="@+id/text_error" |
|
302 |
- android:layout_width="match_parent" |
|
303 |
- android:layout_height="wrap_content" |
|
304 |
- android:textSize="12sp" |
|
305 |
- android:textColor="#bebebe"/> |
|
306 |
- |
|
307 |
- <TextView |
|
308 |
- android:id="@+id/text_affiliation" |
|
309 |
- android:layout_width="match_parent" |
|
310 |
- android:layout_height="wrap_content" |
|
311 |
- android:textSize="12sp" |
|
312 |
- android:textColor="#bebebe"/> |
|
313 |
- </LinearLayout> |
|
314 |
- |
|
315 |
- </LinearLayout> |
|
316 |
- |
|
317 |
-</android.support.constraint.ConstraintLayout> |
|
318 | 1 |
\ No newline at end of file |
2 |
+<?xml version="1.0" encoding="utf-8"?> |
|
3 |
+<!--* |
|
4 |
+ * |
|
5 |
+ * Copyright (C) 2018, University of the Basque Country (UPV/EHU) |
|
6 |
+ * |
|
7 |
+ * Contact for licensing options: <licensing-mcpttclient(at)mcopenplatform(dot)com> |
|
8 |
+ * |
|
9 |
+ * This file is part of MCOP MCPTT Client |
|
10 |
+ * |
|
11 |
+ * This is free software: you can redistribute it and/or modify it under the terms of |
|
12 |
+ * the GNU General Public License as published by the Free Software Foundation, either version 3 |
|
13 |
+ * of the License, or (at your option) any later version. |
|
14 |
+ * |
|
15 |
+ * This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|
16 |
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
17 |
+ * See the GNU General Public License for more details. |
|
18 |
+ * |
|
19 |
+ * You should have received a copy of the GNU General Public License along |
|
20 |
+ * with this program; if not, write to the Free Software Foundation, Inc., |
|
21 |
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
22 |
+ * |
|
23 |
+ *--> |
|
24 |
+<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
25 |
+ xmlns:app="http://schemas.android.com/apk/res-auto" |
|
26 |
+ xmlns:tools="http://schemas.android.com/tools" |
|
27 |
+ android:id="@+id/main_content" |
|
28 |
+ android:layout_width="match_parent" |
|
29 |
+ android:layout_height="match_parent" |
|
30 |
+ android:fitsSystemWindows="true" |
|
31 |
+ tools:context="org.test.client.mcopclient.MainActivity"> |
|
32 |
+ |
|
33 |
+ <android.support.design.widget.AppBarLayout |
|
34 |
+ android:id="@+id/screen_menu_toolbar_AppBarLayout" |
|
35 |
+ android:layout_width="match_parent" |
|
36 |
+ android:layout_height="wrap_content" |
|
37 |
+ android:paddingTop="8dp" |
|
38 |
+ android:theme="@style/AppTheme.AppBarOverlay"> |
|
39 |
+ |
|
40 |
+ <android.support.v7.widget.Toolbar |
|
41 |
+ android:id="@+id/screen_menu_toolbar" |
|
42 |
+ android:layout_width="match_parent" |
|
43 |
+ android:layout_height="wrap_content" |
|
44 |
+ |
|
45 |
+ app:popupTheme="@style/AppTheme.PopupOverlay"> |
|
46 |
+ |
|
47 |
+ <RelativeLayout |
|
48 |
+ android:id="@+id/screen_menu_toolbar_mcop_logo" |
|
49 |
+ android:layout_width="match_parent" |
|
50 |
+ android:layout_height="wrap_content" |
|
51 |
+ android:gravity="center_horizontal|center_vertical"> |
|
52 |
+ |
|
53 |
+ <ImageView |
|
54 |
+ android:id="@+id/logoMCOP" |
|
55 |
+ android:layout_width="wrap_content" |
|
56 |
+ android:layout_height="60dp" |
|
57 |
+ android:scaleType="fitCenter" |
|
58 |
+ android:adjustViewBounds="true" |
|
59 |
+ app:srcCompat="@drawable/mcop_logo" /> |
|
60 |
+ |
|
61 |
+ </RelativeLayout> |
|
62 |
+ </android.support.v7.widget.Toolbar> |
|
63 |
+ |
|
64 |
+ </android.support.design.widget.AppBarLayout> |
|
65 |
+ |
|
66 |
+ <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|
67 |
+ xmlns:app="http://schemas.android.com/apk/res-auto" |
|
68 |
+ xmlns:tools="http://schemas.android.com/tools" |
|
69 |
+ android:layout_width="match_parent" |
|
70 |
+ android:layout_height="match_parent" |
|
71 |
+ android:paddingTop="68dp" |
|
72 |
+ android:id="@+id/background" |
|
73 |
+ android:background="@color/background"> |
|
74 |
+ |
|
75 |
+ <LinearLayout |
|
76 |
+ android:layout_width="wrap_content" |
|
77 |
+ android:layout_height="wrap_content" |
|
78 |
+ android:gravity="center_horizontal" |
|
79 |
+ android:orientation="vertical" |
|
80 |
+ app:layout_constraintTop_toTopOf="parent" |
|
81 |
+ tools:layout_editor_absoluteX="2dp" |
|
82 |
+ tools:ignore="MissingConstraints"> |
|
83 |
+ |
|
84 |
+ <RelativeLayout |
|
85 |
+ android:layout_width="fill_parent" |
|
86 |
+ android:layout_height="wrap_content" |
|
87 |
+ android:layout_marginTop="10dp" |
|
88 |
+ android:layout_weight="1" |
|
89 |
+ android:orientation="horizontal"> |
|
90 |
+ |
|
91 |
+ <TextView |
|
92 |
+ android:id="@+id/text_eMBMS" |
|
93 |
+ android:layout_width="wrap_content" |
|
94 |
+ android:layout_height="wrap_content" |
|
95 |
+ android:layout_alignParentStart="true" |
|
96 |
+ android:layout_alignParentTop="true" |
|
97 |
+ android:layout_marginStart="16dp" |
|
98 |
+ android:layout_weight="1" |
|
99 |
+ android:text="@string/text_eMBMS" |
|
100 |
+ android:textAlignment="viewStart" |
|
101 |
+ android:textColor="@color/white" |
|
102 |
+ android:textSize="14sp" /> |
|
103 |
+ |
|
104 |
+ <TextView |
|
105 |
+ android:id="@+id/text_status" |
|
106 |
+ android:layout_width="wrap_content" |
|
107 |
+ android:layout_height="wrap_content" |
|
108 |
+ android:layout_alignParentRight="true" |
|
109 |
+ android:layout_marginLeft="10dp" |
|
110 |
+ android:layout_marginRight="40dp" |
|
111 |
+ android:layout_weight="1" |
|
112 |
+ android:text="@string/text_status" |
|
113 |
+ android:textColor="@color/white" |
|
114 |
+ android:textSize="14sp" /> |
|
115 |
+ |
|
116 |
+ <TextView |
|
117 |
+ android:id="@+id/emergency" |
|
118 |
+ android:layout_width="wrap_content" |
|
119 |
+ android:layout_height="wrap_content" |
|
120 |
+ android:layout_toLeftOf="@id/text_status" |
|
121 |
+ android:layout_toRightOf="@id/reg_eMBMS" |
|
122 |
+ android:layout_weight="1" |
|
123 |
+ android:gravity="center_horizontal" |
|
124 |
+ android:text="@string/Emergency" |
|
125 |
+ android:textStyle="bold" |
|
126 |
+ android:textColor="@color/background" |
|
127 |
+ android:textSize="20sp" /> |
|
128 |
+ |
|
129 |
+ <Button |
|
130 |
+ android:id="@+id/reg_eMBMS" |
|
131 |
+ android:layout_width="21dp" |
|
132 |
+ android:layout_height="21dp" |
|
133 |
+ android:layout_alignParentStart="true" |
|
134 |
+ android:layout_alignParentTop="true" |
|
135 |
+ android:layout_marginStart="70dp" |
|
136 |
+ android:layout_weight="1" |
|
137 |
+ android:background="@drawable/reg_status" |
|
138 |
+ tools:layout_editor_absoluteX="21dp" |
|
139 |
+ tools:layout_editor_absoluteY="21dp" /> |
|
140 |
+ |
|
141 |
+ <Button |
|
142 |
+ android:id="@+id/reg_status" |
|
143 |
+ android:layout_width="21dp" |
|
144 |
+ android:layout_height="21dp" |
|
145 |
+ android:layout_alignParentRight="true" |
|
146 |
+ android:layout_marginLeft="10dp" |
|
147 |
+ android:layout_marginRight="15dp" |
|
148 |
+ android:layout_weight="1" |
|
149 |
+ android:background="@drawable/reg_status" |
|
150 |
+ tools:layout_editor_absoluteX="21dp" |
|
151 |
+ tools:layout_editor_absoluteY="21dp" /> |
|
152 |
+ </RelativeLayout> |
|
153 |
+ |
|
154 |
+ <LinearLayout |
|
155 |
+ android:layout_width="wrap_content" |
|
156 |
+ android:layout_height="match_parent" |
|
157 |
+ android:layout_weight="1" |
|
158 |
+ android:layout_marginTop="1dp" |
|
159 |
+ android:orientation="vertical"> |
|
160 |
+ |
|
161 |
+ <TextView |
|
162 |
+ android:id="@+id/text_talking" |
|
163 |
+ android:layout_width="match_parent" |
|
164 |
+ android:layout_height="wrap_content" |
|
165 |
+ android:text="@string/text_talking" |
|
166 |
+ android:textSize="15sp" |
|
167 |
+ android:textColor="@color/white"/> |
|
168 |
+ <TextView |
|
169 |
+ android:id="@+id/text_callingid" |
|
170 |
+ android:layout_width="match_parent" |
|
171 |
+ android:layout_height="wrap_content" |
|
172 |
+ android:textSize="18sp" |
|
173 |
+ android:textColor="@color/white"/> |
|
174 |
+ </LinearLayout> |
|
175 |
+ |
|
176 |
+ <LinearLayout |
|
177 |
+ android:layout_width="wrap_content" |
|
178 |
+ android:layout_height="match_parent" |
|
179 |
+ android:layout_marginTop="10dp" |
|
180 |
+ android:layout_weight="1" |
|
181 |
+ android:orientation="horizontal" |
|
182 |
+ tools:layout_editor_absoluteX="8dp" |
|
183 |
+ tools:layout_editor_absoluteY="8dp"> |
|
184 |
+ |
|
185 |
+ <Button |
|
186 |
+ android:id="@+id/btn_register" |
|
187 |
+ android:layout_width="85dp" |
|
188 |
+ android:layout_height="85dp" |
|
189 |
+ android:layout_marginLeft="10dp" |
|
190 |
+ android:layout_marginRight="10dp" |
|
191 |
+ android:layout_weight="1" |
|
192 |
+ android:background="@drawable/circle_btn" |
|
193 |
+ android:text="@string/btn_register" |
|
194 |
+ android:textSize="10sp" |
|
195 |
+ tools:layout_editor_absoluteX="85dp" |
|
196 |
+ tools:layout_editor_absoluteY="85dp" /> |
|
197 |
+ |
|
198 |
+ <Button |
|
199 |
+ android:id="@+id/btn_unregister" |
|
200 |
+ android:layout_width="85dp" |
|
201 |
+ android:layout_height="85dp" |
|
202 |
+ android:layout_marginLeft="10dp" |
|
203 |
+ android:layout_marginRight="10dp" |
|
204 |
+ android:layout_weight="1" |
|
205 |
+ android:background="@drawable/circle_btn" |
|
206 |
+ android:text="@string/btn_unregister" |
|
207 |
+ android:textSize="10sp" |
|
208 |
+ tools:layout_editor_absoluteX="85dp" |
|
209 |
+ tools:layout_editor_absoluteY="85dp" /> |
|
210 |
+ </LinearLayout> |
|
211 |
+ |
|
212 |
+ <LinearLayout |
|
213 |
+ android:layout_width="wrap_content" |
|
214 |
+ android:layout_height="match_parent" |
|
215 |
+ android:layout_weight="1" |
|
216 |
+ android:orientation="horizontal" |
|
217 |
+ tools:layout_editor_absoluteX="85dp"> |
|
218 |
+ |
|
219 |
+ <Button |
|
220 |
+ android:id="@+id/btn_accept" |
|
221 |
+ android:layout_width="85dp" |
|
222 |
+ android:layout_height="85dp" |
|
223 |
+ android:layout_weight="1" |
|
224 |
+ android:background="@drawable/circle_btn" |
|
225 |
+ android:text="@string/btn_accept" |
|
226 |
+ android:textSize="10sp" |
|
227 |
+ tools:layout_editor_absoluteX="85dp" |
|
228 |
+ tools:layout_editor_absoluteY="85dp" /> |
|
229 |
+ |
|
230 |
+ <Button |
|
231 |
+ android:id="@+id/btn_call" |
|
232 |
+ android:layout_width="140dp" |
|
233 |
+ android:layout_height="140dp" |
|
234 |
+ android:layout_weight="1" |
|
235 |
+ android:background="@drawable/token_inactive" |
|
236 |
+ tools:layout_editor_absoluteX="85dp" |
|
237 |
+ tools:layout_editor_absoluteY="85dp" /> |
|
238 |
+ |
|
239 |
+ <Button |
|
240 |
+ android:id="@+id/btn_hangup" |
|
241 |
+ android:layout_width="85dp" |
|
242 |
+ android:layout_height="85dp" |
|
243 |
+ android:layout_weight="1" |
|
244 |
+ android:background="@drawable/circle_btn" |
|
245 |
+ android:text="@string/btn_hangup" |
|
246 |
+ android:textSize="10sp" |
|
247 |
+ tools:layout_editor_absoluteX="85dp" |
|
248 |
+ tools:layout_editor_absoluteY="85dp" /> |
|
249 |
+ </LinearLayout> |
|
250 |
+ |
|
251 |
+ <LinearLayout |
|
252 |
+ android:layout_width="wrap_content" |
|
253 |
+ android:layout_height="match_parent" |
|
254 |
+ android:layout_weight="1" |
|
255 |
+ android:orientation="horizontal" |
|
256 |
+ tools:layout_editor_absoluteX="8dp" |
|
257 |
+ tools:layout_editor_absoluteY="8dp"> |
|
258 |
+ |
|
259 |
+ <Button |
|
260 |
+ android:id="@+id/btn_speaker" |
|
261 |
+ android:layout_width="85dp" |
|
262 |
+ android:layout_height="85dp" |
|
263 |
+ android:layout_marginLeft="10dp" |
|
264 |
+ android:layout_marginRight="10dp" |
|
265 |
+ android:layout_weight="1" |
|
266 |
+ android:background="@drawable/circle_btn" |
|
267 |
+ android:text="@string/btn_speaker_off" |
|
268 |
+ android:textSize="10sp" |
|
269 |
+ tools:layout_editor_absoluteX="85dp" |
|
270 |
+ tools:layout_editor_absoluteY="85dp" /> |
|
271 |
+ |
|
272 |
+ <Button |
|
273 |
+ android:id="@+id/btn_er" |
|
274 |
+ android:layout_width="85dp" |
|
275 |
+ android:layout_height="85dp" |
|
276 |
+ android:layout_marginLeft="10dp" |
|
277 |
+ android:layout_marginRight="10dp" |
|
278 |
+ android:layout_weight="1" |
|
279 |
+ android:background="@drawable/circle_btn" |
|
280 |
+ android:text="@string/btn_er" |
|
281 |
+ android:textSize="10sp" |
|
282 |
+ tools:layout_editor_absoluteX="85dp" |
|
283 |
+ tools:layout_editor_absoluteY="85dp" /> |
|
284 |
+ </LinearLayout> |
|
285 |
+ |
|
286 |
+ <LinearLayout |
|
287 |
+ android:layout_width="wrap_content" |
|
288 |
+ android:layout_height="wrap_content" |
|
289 |
+ android:layout_marginTop="15dp" |
|
290 |
+ android:layout_weight="1" |
|
291 |
+ android:gravity="bottom" |
|
292 |
+ android:orientation="horizontal"> |
|
293 |
+ |
|
294 |
+ <TextView |
|
295 |
+ android:id="@+id/switch_group" |
|
296 |
+ android:layout_width="wrap_content" |
|
297 |
+ android:layout_height="wrap_content" |
|
298 |
+ android:layout_marginLeft="10dp" |
|
299 |
+ android:layout_marginRight="8dp" |
|
300 |
+ android:layout_weight="1" |
|
301 |
+ android:text="@string/switch_group" |
|
302 |
+ android:textColor="@color/white" |
|
303 |
+ android:textSize="14sp" /> |
|
304 |
+ |
|
305 |
+ <android.support.v7.widget.SwitchCompat |
|
306 |
+ android:id="@+id/switch_call" |
|
307 |
+ style="@style/SwitchCompatTheme" |
|
308 |
+ android:layout_width="wrap_content" |
|
309 |
+ android:layout_height="wrap_content" |
|
310 |
+ android:layout_marginTop="14dp" |
|
311 |
+ android:layout_weight="1" /> |
|
312 |
+ |
|
313 |
+ <TextView |
|
314 |
+ android:id="@+id/switch_private" |
|
315 |
+ android:layout_width="wrap_content" |
|
316 |
+ android:layout_height="wrap_content" |
|
317 |
+ android:layout_marginLeft="8dp" |
|
318 |
+ android:layout_marginRight="10dp" |
|
319 |
+ android:layout_weight="1" |
|
320 |
+ android:text="@string/switch_private" |
|
321 |
+ android:textColor="@color/white" |
|
322 |
+ android:textSize="14sp" /> |
|
323 |
+ </LinearLayout> |
|
324 |
+ |
|
325 |
+ <LinearLayout |
|
326 |
+ android:layout_width="wrap_content" |
|
327 |
+ android:layout_height="match_parent" |
|
328 |
+ android:layout_marginTop="10dp" |
|
329 |
+ android:layout_weight="1" |
|
330 |
+ android:gravity="bottom" |
|
331 |
+ android:orientation="horizontal"> |
|
332 |
+ |
|
333 |
+ <Spinner |
|
334 |
+ android:id="@+id/spinnerGroups" |
|
335 |
+ android:layout_width="368dp" |
|
336 |
+ android:layout_height="wrap_content" |
|
337 |
+ android:layout_marginBottom="1dp" |
|
338 |
+ android:layout_marginEnd="1dp" |
|
339 |
+ android:layout_marginStart="5dp" |
|
340 |
+ android:layout_marginTop="1dp" |
|
341 |
+ android:enabled="false" /> |
|
342 |
+ |
|
343 |
+ <Spinner |
|
344 |
+ android:id="@+id/spinnerUsers" |
|
345 |
+ android:layout_width="368dp" |
|
346 |
+ android:layout_height="wrap_content" |
|
347 |
+ android:layout_marginBottom="1dp" |
|
348 |
+ android:layout_marginEnd="1dp" |
|
349 |
+ android:layout_marginStart="5dp" |
|
350 |
+ android:layout_marginTop="1dp" |
|
351 |
+ android:enabled="false" /> |
|
352 |
+ </LinearLayout> |
|
353 |
+ |
|
354 |
+ <LinearLayout |
|
355 |
+ android:layout_width="match_parent" |
|
356 |
+ android:layout_height="match_parent" |
|
357 |
+ android:layout_weight="1" |
|
358 |
+ android:orientation="vertical"> |
|
359 |
+ |
|
360 |
+ <TextView |
|
361 |
+ android:id="@+id/text_info" |
|
362 |
+ android:layout_width="match_parent" |
|
363 |
+ android:layout_height="wrap_content" |
|
364 |
+ android:textSize="12sp" |
|
365 |
+ android:textColor="#bebebe"/> |
|
366 |
+ |
|
367 |
+ <TextView |
|
368 |
+ android:id="@+id/text_error" |
|
369 |
+ android:layout_width="match_parent" |
|
370 |
+ android:layout_height="wrap_content" |
|
371 |
+ android:textSize="12sp" |
|
372 |
+ android:textColor="#bebebe"/> |
|
373 |
+ |
|
374 |
+ <TextView |
|
375 |
+ android:id="@+id/text_affiliation" |
|
376 |
+ android:layout_width="match_parent" |
|
377 |
+ android:layout_height="wrap_content" |
|
378 |
+ android:textSize="12sp" |
|
379 |
+ android:textColor="#bebebe"/> |
|
380 |
+ </LinearLayout> |
|
381 |
+ |
|
382 |
+ </LinearLayout> |
|
383 |
+ |
|
384 |
+ </android.support.constraint.ConstraintLayout> |
|
385 |
+ |
|
386 |
+</android.support.design.widget.CoordinatorLayout> |
|
319 | 387 |
\ No newline at end of file |
... | ... |
@@ -29,7 +29,7 @@ |
29 | 29 |
android:paddingLeft="@dimen/activity_horizontal_margin" |
30 | 30 |
android:paddingRight="@dimen/activity_horizontal_margin" |
31 | 31 |
android:paddingTop="@dimen/activity_vertical_margin" |
32 |
- tools:context=".mcopsdk.ScreenAutheticationWebView"> |
|
32 |
+ tools:context=".ScreenAuthenticationWebView"> |
|
33 | 33 |
<WebView |
34 | 34 |
android:id="@+id/screen_authentication_WebView_info" |
35 | 35 |
android:layout_width="match_parent" |
36 | 36 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,26 @@ |
0 |
+<menu xmlns:android="http://schemas.android.com/apk/res/android" |
|
1 |
+ xmlns:app="http://schemas.android.com/apk/res-auto" |
|
2 |
+ xmlns:tools="http://schemas.android.com/tools" |
|
3 |
+ tools:context="org.test.client.mcopclient.MainActivity"> |
|
4 |
+ |
|
5 |
+ <item |
|
6 |
+ android:id="@+id/action_registration" |
|
7 |
+ android:orderInCategory="300" |
|
8 |
+ android:title="@string/option_registration" |
|
9 |
+ app:showAsAction="never"/> |
|
10 |
+ |
|
11 |
+ <item android:id="@+id/action_auto_reg" |
|
12 |
+ android:title="@string/option_auto_reg" |
|
13 |
+ android:orderInCategory="400" |
|
14 |
+ app:showAsAction="never"/> |
|
15 |
+ |
|
16 |
+ <item android:id="@+id/action_about" |
|
17 |
+ android:title="@string/option_about" |
|
18 |
+ android:orderInCategory="500" |
|
19 |
+ app:showAsAction="never"/> |
|
20 |
+ |
|
21 |
+ <item android:id="@+id/action_exit" |
|
22 |
+ android:title="@string/option_exit" |
|
23 |
+ android:orderInCategory="600" |
|
24 |
+ app:showAsAction="never"/> |
|
25 |
+</menu> |
|
0 | 26 |
\ No newline at end of file |
... | ... |
@@ -4,7 +4,11 @@ |
4 | 4 |
<color name="colorPrimaryLight">#FCAE2E</color> |
5 | 5 |
<color name="colorPrimaryDark">#F4792E</color> |
6 | 6 |
<color name="colorSecondary">#2226AC</color> |
7 |
- <color name="colorAccent">#F1F047</color> |
|
7 |
+ <color name="colorAccent">#F4792E</color> |
|
8 |
+ <!--<color name="colorER">#F1F047</color>--> |
|
9 |
+ <color name="colorER">#d6120f</color> |
|
10 |
+ <color name="colorERdark">#acab2e</color> |
|
11 |
+ <color name="colorERback">#cc7927</color> |
|
8 | 12 |
<color name="background_old">#353739</color> |
9 | 13 |
<color name="background">#353739</color> |
10 | 14 |
<color name="dark">#484a4f</color> |
... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
<resources> |
2 |
- <string name="app_name">MCOP MCPTT Client</string> |
|
2 |
+ <string name="app_name">MCOP MCPTT Demo Client</string> |
|
3 | 3 |
|
4 | 4 |
<!-- Buttons --> |
5 | 5 |
<string name="btn_register">REGISTER</string> |
... | ... |
@@ -10,12 +10,33 @@ |
10 | 10 |
<string name="btn_token">TOKEN</string> |
11 | 11 |
<string name="btn_speaker_off">Speaker OFF</string> |
12 | 12 |
<string name="btn_speaker_on">Speaker ON</string> |
13 |
- <string name="btn_aux2">AUX2</string> |
|
13 |
+ <string name="btn_er">Emergency</string> |
|
14 | 14 |
<string name="switch_private">Private Call</string> |
15 | 15 |
<string name="switch_group">Group Call</string> |
16 | 16 |
<string name="text_status">Status: </string> |
17 |
+ <string name="text_eMBMS">eMBMS: </string> |
|
18 |
+ <string name="OK">OK</string> |
|
19 |
+ <string name="Cancel">Cancel</string> |
|
20 |
+ <string name="Emergency">EMERGENCY</string> |
|
17 | 21 |
|
18 | 22 |
<!-- Messages --> |
19 | 23 |
<string name="text_talking">Talking: </string> |
20 | 24 |
<string name="Error_in_authetication">Authetication error</string> |
25 |
+ <string name="option_SDK">Select SDK</string> |
|
26 |
+ <string name="option_eMBMS">Select eMBMS MW</string> |
|
27 |
+ <string name="option_registration">Select IdMS/CMS</string> |
|
28 |
+ <string name="option_auto_reg">Auto-Registration</string> |
|
29 |
+ <string name="option_about">About</string> |
|
30 |
+ <string name="option_exit">Exit</string> |
|
31 |
+ |
|
32 |
+ <!-- Menus --> |
|
33 |
+ <string name="reg_idms">IdMS</string> |
|
34 |
+ <string name="reg_cms">CMS</string> |
|
35 |
+ |
|
36 |
+ <!-- About --> |
|
37 |
+ <string name="Build_version">Build version</string> |
|
38 |
+ <string name="Developed_by">Developed by</string> |
|
39 |
+ <string name="web">\nwww.mcopenplatform.org</string> |
|
40 |
+ <string name="copyright">\u00a9 2019 All rights reserved</string> |
|
41 |
+ |
|
21 | 42 |
</resources> |
... | ... |
@@ -1,11 +1,20 @@ |
1 | 1 |
<resources> |
2 | 2 |
|
3 | 3 |
<!-- Base application theme. --> |
4 |
- <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> |
|
4 |
+ <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> |
|
5 | 5 |
<!-- Customize your theme here. --> |
6 | 6 |
<item name="colorPrimary">@color/colorPrimary</item> |
7 | 7 |
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> |
8 | 8 |
<item name="colorAccent">@color/colorAccent</item> |
9 | 9 |
</style> |
10 | 10 |
|
11 |
+ <style name="AppTheme.NoActionBar"> |
|
12 |
+ <item name="windowActionBar">false</item> |
|
13 |
+ <item name="windowNoTitle">true</item> |
|
14 |
+ </style> |
|
15 |
+ |
|
16 |
+ <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> |
|
17 |
+ |
|
18 |
+ <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> |
|
19 |
+ |
|
11 | 20 |
</resources> |
... | ... |
@@ -4,4 +4,8 @@ |
4 | 4 |
<item name="colorControlActivated">@color/colorPrimaryDark</item> |
5 | 5 |
<item name="thumbTint">@color/colorPrimaryLight</item> |
6 | 6 |
</style> |
7 |
+ <style name="SwitchERTheme" > |
|
8 |
+ <item name="colorControlActivated">@color/colorER</item> |
|
9 |
+ <item name="thumbTint">@color/colorER</item> |
|
10 |
+ </style> |
|
7 | 11 |
</resources> |
8 | 12 |
\ No newline at end of file |
... | ... |
@@ -7,7 +7,7 @@ buildscript { |
7 | 7 |
jcenter() |
8 | 8 |
} |
9 | 9 |
dependencies { |
10 |
- classpath 'com.android.tools.build:gradle:3.0.1' |
|
10 |
+ classpath 'com.android.tools.build:gradle:3.2.1' |
|
11 | 11 |
|
12 | 12 |
|
13 | 13 |
// NOTE: Do not place your application dependencies here; they belong |
... | ... |
@@ -29,8 +29,8 @@ allprojects { |
29 | 29 |
} |
30 | 30 |
ext { |
31 | 31 |
gradleVersion="3.0.1" |
32 |
- buildToolsVersion = "25.0.3" |
|
33 |
- supportLibVersion = "25.4.0" |
|
32 |
+ buildToolsVersion = "27.1.3" |
|
33 |
+ supportLibVersion = "27.1.0" |
|
34 | 34 |
runnerVersion = "1.0.1" |
35 | 35 |
rulesVersion = "1.0.1" |
36 | 36 |
espressoVersion = "3.0.1" |
... | ... |
@@ -1,6 +1,6 @@ |
1 | 1 |
> *Refer to* [*README*](../README.md) *for main instruction file* |
2 | 2 |
|
3 |
-# MCOP MCPTT Client |
|
3 |
+# MCOP MCPTT Client v2.0 |
|
4 | 4 |
|
5 | 5 |
##Â Installation |
6 | 6 |
|
... | ... |
@@ -8,9 +8,7 @@ |
8 | 8 |
|
9 | 9 |
* [**MCOP SDK**](https://demo.mcopenplatform.org/gitlist/mcop/MCOP-SDK.git/blob/master/docs/MCOP_SDK_Installation.md) installed on the device. |
10 | 10 |
|
11 |
- * [**Profiles**](Profiles.md) with the network/user configuration. |
|
12 |
- |
|
13 |
-* [**Mock App**](Mock.md) to bypass the the SIM authentication. |
|
11 |
+* [**Provisioning Tool App**](ProvisioningTool.md) to configure the users and bypass the the SIM authentication. |
|
14 | 12 |
|
15 | 13 |
### Download the MCOP MCPTT Demo Client |
16 | 14 |
|
... | ... |
@@ -30,7 +28,7 @@ Enter the password: Iephieb8 |
30 | 30 |
|
31 | 31 |
Import the project in Android Studio by selecting **File --> Open:** Select the **MCOP-MCPTT-Client** project folder. |
32 | 32 |
|
33 |
-Android **SKD Platform 27** is defined as compilation version. If not installed, a message is shown in Android Studio to *"Install missing platform(s) and sync project"*. |
|
33 |
+Android **SKD Platform 28** is defined as compilation version. If not installed, a message is shown in Android Studio to *"Install missing platform(s) and sync project"*. |
|
34 | 34 |
|
35 | 35 |
Connect a phone to the computer via USB cable. **USB debugging** mode must be previously activated, on phone *Settings --> Developer Options*. Once connected, click OK on *"Allow USB debugging?"* message. |
36 | 36 |
|
... | ... |
@@ -48,24 +46,36 @@ Once installed, allow requested permissions: |
48 | 48 |
|
49 | 49 |
### Usage |
50 | 50 |
|
51 |
-* Everytime the client app is started, a list of user profiles is displayed, in order to select the one to register with. By default some test profiles are loaded. |
|
51 |
+* As mentioned in the requirements above, the MCOP MCPTT Client needs both [**MCOP SDK**](https://demo.mcopenplatform.org/gitlist/mcop/MCOP-SDK.git/blob/master/docs/MCOP_SDK_Installation.md) and [**Provisioning Tool**](ProvisioningTool.md) installed to work. |
|
52 |
+ |
|
53 |
+* **IMPORTANT**: In order to test the MCOP MCPTT Client against our [demo.mcopenplatform.org](https://demo.mcopenplatform.org) testing platform, edit the configuration in the Provisioning Tool with the provided credentials, and activate the client to be registered with. **Full detailed information is available in the [Provisioning Tool](ProvisioningTool.md) documentation**. |
|
54 |
+ |
|
55 |
+* Once started, the MCOP MCPTT Client will show a quick message informing that it has correctly binded to the **MCOP SDK**. |
|
56 |
+ |
|
57 |
+* The client will load the configuration of the client made active in the **Provisioning Tool**. |
|
52 | 58 |
|
53 |
-* **IMPORTANT**: In order to test the MCOP MCPTT Client against our [demo.mcopenplatform.org](https://demo.mcopenplatform.org) testing platform, this profile files need to be configured in the **MCOP SDK** first, and then referenced in the Client. **Full detailed information is available in [Profiles](Profiles.md) documentation**. |
|
59 |
+* By default, auto-registration feature is disabled, so **REGISTER** button needs to be pressed to start the registration. Click on the menu button at the top right corner, and choose **Auto-Registration** to change this configuration. |
|
54 | 60 |
|
55 |
-* After selecting the the initial configure profile, the client will try to automatically register. |
|
61 |
+* To use **IdMS/CMS** for registration, disabled by default, select the **IdMS/CMS** option of the menu. If enabled, an IdMS login window will show up when registering. In case of the [**MCOP Online Testing Platform**](https://demo.mcopenplatform.org/), this credentials will be provided by email when requesting a testing slot. |
|
56 | 62 |
|
57 |
-* Once registered, the rest of the button are enabled, and the client is ready to receive and make private or prearranged groups calls. |
|
63 |
+* Once succesfully registered, the Status button on the top right will turn green and show the **Display Name** of the registered user. The rest of the buttons of the graphic interface will also be enabled, making the client ready to receive and make calls. |
|
58 | 64 |
|
59 |
-* The swith button allows to select between private and. prearrange group calls. When pressing (or keeping it pressed) the middle MCOP logo button, a call will be made according to the selected option. |
|
65 |
+* The swith button allows to select between private and prearranged group calls. When pressing (or keeping it pressed) the middle MCOP logo button, a call will be made according to the selected option. |
|
60 | 66 |
|
61 |
-* This middle MCOP logo button also works as push to talk button while on a call, changing the color to show whether the token is taken, granted or idle. |
|
67 |
+* This middle MCOP logo button also works as push to talk button while on a call, changing the color to show whether the token is taken (red), granted (green) or idle (grey) during the call. |
|
62 | 68 |
|
63 |
-* The spinner button below shows a list of clients or groups to call. The list changes depending on the switch button that activates private or group calls. |
|
69 |
+* The spinner button below shows a list of clients or groups to call. The list changes depending on the switch button that activates private or group calls. Both lists are hardcoded on the **MainActivity.java** file, and can be edited to match the clients ids of your configuration. In case of the group calls, the client will update the default list with the one received from the GMS. |
|
64 | 70 |
|
65 | 71 |
* The speaker button allows to enable or dissable the speaker. |
66 | 72 |
|
73 |
+* The **Emergency** button enables the Emergency state. While in Emergency, all made calls will be made as emergency calls, and the receiver(s) will change their state to Emergency while the call lasts. The caller will remain in Emergency state till it is manually disabled. |
|
74 |
+ |
|
67 | 75 |
* Check [MCOP MCPTT App Development](MCOP_App_developing_steps.md) guide for more info on app development using the MCOP SDK. |
68 | 76 |
|
77 |
+### Screenshots |
|
78 |
+ |
|
79 |
+![MCOP Demo Client v2](../images/MCOP_Demo_Client_v2.png) |
|
80 |
+ |
|
69 | 81 |
### Possible Errors |
70 | 82 |
|
71 | 83 |
* If you have SIP related problems, maybe your carrier is SBC/filtering VoIP traffic. Please check the [Troubleshooting - Network Issues](Troubleshooting.md) section for more information. |
72 | 84 |
deleted file mode 100644 |
... | ... |
@@ -1,49 +0,0 @@ |
1 |
-> *Refer to* [*README*](../README.md) *for main instruction file* |
|
2 |
- |
|
3 |
-# MCOP MOCK |
|
4 |
- |
|
5 |
-The MCOP Mock app is used to bypass the SIM authentication in order to test the **MCOP SDK** in those devices that don't have a proper SIM plugin due to privilege constraints. |
|
6 |
- |
|
7 |
-It uses **AKAv2** (*Authentication and Key Agreement*, [*RFC 3310*](https://tools.ietf.org/html/rfc3310)) for authentication. AKA is a challenge-response based mechanism that uses symmetric cryptography. |
|
8 |
- |
|
9 |
-## Parameters |
|
10 |
- |
|
11 |
-* **IMPI**: The IP Multimedia Private Identity used to authenticate. |
|
12 |
- |
|
13 |
- e.g. mcptt-test-A@organization.org |
|
14 |
- |
|
15 |
-* **DOMAIN**: domain. |
|
16 |
- |
|
17 |
- e.g. organization.org |
|
18 |
- |
|
19 |
-* **PASSWORD**: A shared secret key for the authentication process. |
|
20 |
- |
|
21 |
- e.g. 0123456789 |
|
22 |
- |
|
23 |
-## Usage |
|
24 |
- |
|
25 |
-Open the **Mock app** and enter the IMPI, DOMAIN and PASSWORD values. After that, it can be even closed. |
|
26 |
- |
|
27 |
-The **MCOP SDK** or **MCOP MCPTT** Client need to be opened after the data has been entered in the Mock App. |
|
28 |
- |
|
29 |
-## Installation |
|
30 |
- |
|
31 |
-Download the **Mock apk** from [here](https://demo.mcopenplatform.org/gitlist/mcop/MCOP-SDK.git/raw/master/mock/mockAPP.apk). |
|
32 |
- |
|
33 |
-It can be installed directly from an Android device, or using [Android ADB](https://developer.android.com/studio/command-line/adb) from a computer. |
|
34 |
- |
|
35 |
-## Screenshot |
|
36 |
- |
|
37 |
-![MOCK](../images/images_mockAuth.png) |
|
38 |
- |
|
39 |
-## Response |
|
40 |
- |
|
41 |
-The Mock app provides a response according to the standard specified in [ETSI TS 131 102](http://www.etsi.org/deliver/etsi_ts/131100_131199/131102/14.04.00_60/ts_131102v140400p.pdf) on section *7.1.2.1 GSM/3G security context*, in base64 format. |
|
42 |
- |
|
43 |
-## Disclaimer |
|
44 |
- |
|
45 |
-The Mock App internally uses **amf = 0x0000 (hex)** and **OP = 0x00000000000000000000000000000000 (hex)**. |
|
46 |
- |
|
47 |
- |
|
48 |
- |
|
49 |
- |
50 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,65 +0,0 @@ |
1 |
-> *Refer to* [*README*](../README.md) *for main instruction file* |
|
2 |
- |
|
3 |
-# Profiles |
|
4 |
- |
|
5 |
-The profiles *XML* file contains a list of *NgnSipPreferences* elements under main root *<Profiles>* tag. It can be found in **android-ngn-stak/res/raw/profiles/** folder on the **MCOP SDK** project. Each *NgnSipPreferences* element contains the configuration of a MCPTT user. The configuration properties and their tags are described in the **Elements** section below. If a value isn't set, the application uses the default value stored in the code for that field. |
|
6 |
- |
|
7 |
-After defining a new NgnSipPreferences, it needs to be referenced in the application, adding its name to the **clients HasMap**. |
|
8 |
- |
|
9 |
-*e.g. for profile name:* |
|
10 |
- |
|
11 |
- <NgnSipPrefrences name="MyProfile_UserA"> |
|
12 |
- |
|
13 |
-*add the following line to clients HasMap:* |
|
14 |
- |
|
15 |
- clients.put("MyProfile_UserA", new String[]{"MyProfile_UserA","MyProfile_UserA","MyProfile_UserA"}); |
|
16 |
- |
|
17 |
-The client HashMap is defined in the **MainActivity.java** file for both **MCOP SDK** and **MCOP MCPTT Client**. To quickly find it in Android Studio, go to *Edit --> Find --> Find in path* and search for **clients = new HashMap<>()**, and add the *clients.put* line after it. |
|
18 |
- |
|
19 |
-## demo.mcopenplatform.org |
|
20 |
- |
|
21 |
-The [**demo.mcopenplatform.org**](https://demo.mcopenplatform.org/) platform can be used for testing purposes. |
|
22 |
- |
|
23 |
-Click on [**Request Access**](https://demo.mcopenplatform.org/reserve) and check the calendar there for an empty slot, and you'll receive credentials for five test users (with suffixes A to E). |
|
24 |
- |
|
25 |
-The **Name** field (max. 10 characters) in the form will determine the name of the client ID. Check the **Example** section below for a specific example. |
|
26 |
- |
|
27 |
-## Example Example **profiles** file with just one user configuration. |
|
28 |
- |
|
29 |
-**For configuration from the [MCOP demo platform](https://demo.mcopenplatform.org/), replace "test" with the "Name" field submitted in the form.** The specific information is also provided by email after requesting a slot. <Profiles> |
|
30 |
- <NgnSipPrefrences name="TEST_A"> |
|
31 |
- <DisplayName>TEST A</DisplayName> |
|
32 |
- <IMPI>mcptt-test-A@organization.org</IMPI> |
|
33 |
- <IMPU>sip:mcptt-test-A@organization.org</IMPU> |
|
34 |
- <Password></Password> |
|
35 |
- <IPVersion>ipv4</IPVersion> |
|
36 |
- <Transport>UDP</Transport> |
|
37 |
- <IPsecSecAgree>false</IPsecSecAgree> |
|
38 |
- <McpttAnswerMode>true</McpttAnswerMode> |
|
39 |
- <McpttGranted>true</McpttGranted> |
|
40 |
- <McpttId>sip:mcptt_id_test_A@organization.org</McpttId> |
|
41 |
- <McpttClientId>sip:mcptt_id_test_A@organization.org</McpttClientId> |
|
42 |
- <McpttImplicit>true</McpttImplicit> |
|
43 |
- <McpttIsEnableAffiliation>true</McpttIsEnableAffiliation> |
|
44 |
- <McpttNameSpace>true</McpttNameSpace> |
|
45 |
- <McpttPriority>7</McpttPriority> |
|
46 |
- <McpttPrivAnswerMode>false</McpttPrivAnswerMode> |
|
47 |
- <McpttPsiAffiliation>sip:mcptt-server-orig-part.organization.org</McpttPsiAffiliation> |
|
48 |
- <McpttPsiCallGroup>sip:mcptt-server-orig-part.organization.org</McpttPsiCallGroup> |
|
49 |
- <McpttPsiCallPreestablished>sip:mcptt-server-orig-part.organization.org</McpttPsiCallPreestablished> |
|
50 |
- <McpttPsiCallPrivate>sip:mcptt-server-orig-part.organization.org</McpttPsiCallPrivate> |
|
51 |
- <McpttPsiAuthentication>sip:mcptt-server-orig-part.organization.org</McpttPsiAuthentication> |
|
52 |
- <Realm>organization.org</Realm> |
|
53 |
- <PcscfPort>5070</PcscfPort> |
|
54 |
- <PcscfHost>demo.mcopenplatform.org</PcscfHost> |
|
55 |
- </NgnSipPrefrences> |
|
56 |
- </Profiles> |
|
57 |
- |
|
58 |
-**Note: In case of any typo or error in the profile resulting in not being able to parse it, the SDK will use its default values instead**. |
|
59 |
- |
|
60 |
-## Elements |
|
61 |
- |
|
62 |
-Brief description and example of the configuration elements: * **DisplayName**: Display name. e.g. Test A * **IMPI**: IP Multimedia Private Identity. e.g. mcptt-test-A@organization.org * **IMPU**: IP Multimedia Public Identity. e.g. sip:mcptt-test-A@organization.org * **Password**: Password. e.g. password * **IPVersion**: IPV version. e.g. ipv4 |
|
63 |
- |
|
64 |
-* **Transport**: Transport protocol. e.g. UDP * **McpttAnswerMode**: "true" for auto answer mode, and "false" for manual answer mode. e.g. true * **McpttGranted**: To insert GRANTED in the Invite message. e.g. true * **McpttId**: MCPTT identifier. e.g. sip:mcptt_id_test_A@organization.org * **McpttClientId**: MCPTT Client identifier. e.g. sip:mcptt_id_test_A@organization.org * **McpttImplicit**: To insert IMPLICIT in the Invite message. e.g. true * **McpttIsEnableAffiliation**: To enable MCPTT affiliation features. e.g. true * **McpttPriority**: Priority level for Private or Group MCPTT calls. From 1 (lowest), to 15 (highest). e.g. 7 * **McpttPrivAnswerMode**: "true" for automatic answer mode, and "false" for manual answer mode. e.g. false * **McpttPsiAffiliation**: Public Service Identity for Affiliations. e.g. sip:mcptt-server-orig-part.organization.org * **McpttPsiCallGroup**: Public Service Identity for Group Calls. e.g. sip:mcptt-server-orig-part.organization.org * **McpttPsiCallPreestablished**: Public Service Identity for Preestablished Calls. e.g. sip:mcptt-server-orig-part.organization.org * **McpttPsiCallPrivate**: Public Service Identity for Private calls. e.g. sip:mcptt-server-orig-part.organization.org * **McpttPsiAuthentication**: Public Service Identity for Authentication. e.g. sip:mcptt-server-orig-part.organization.org * **Realm**: domain. e.g. organization.org * **McpttEnableMbms**: To enable MBMS (Multimedia Broadcast Multicast Services). e.g. true * **PcscfHost**: Host name or ip address of the P-CSCF (Proxy-Call Session Control Function). e.g. 192.168.16.193 * **PcscfPort**: Port number of the P-CSCF. e.g. 5060 |
|
65 |
- |
66 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,68 @@ |
0 |
+> *Refer to* [*README*](../README.md) *for main instruction file* |
|
1 |
+ |
|
2 |
+# MCOP Provisioning Tool |
|
3 |
+ |
|
4 |
+The MCOP Provisioning Tool has two main goals: bypass the SIM authentication and enter the MCPTT configuration. |
|
5 |
+ |
|
6 |
+## SIM Authentication |
|
7 |
+ |
|
8 |
+The MCOP Provisioning Tool is used to bypass the SIM authentication in order to test the **MCOP SDK** in those devices that don't have a proper SIM plugin due to privilege constraints. |
|
9 |
+ |
|
10 |
+It uses **AKAv2** (*Authentication and Key Agreement*, [*RFC 3310*](https://tools.ietf.org/html/rfc3310)) for authentication. AKA is a challenge-response based mechanism that uses symmetric cryptography. |
|
11 |
+ |
|
12 |
+### Response |
|
13 |
+ |
|
14 |
+The Provisioning Tool provides a response according to the standard specified in [ETSI TS 131 102](http://www.etsi.org/deliver/etsi_ts/131100_131199/131102/14.04.00_60/ts_131102v140400p.pdf) on section *7.1.2.1 GSM/3G security context*, in base64 format. |
|
15 |
+ |
|
16 |
+### Disclaimer |
|
17 |
+ |
|
18 |
+The Provisioning Tool internally uses **amf = 0x0000 (hex)** and **OP = 0x00000000000000000000000000000000 (hex)**. |
|
19 |
+ |
|
20 |
+## MCPTT Configuration |
|
21 |
+ |
|
22 |
+### Usage |
|
23 |
+ |
|
24 |
+Open the **MCOP Provisioning Tool** and select any of the preconfigured user profiles. Click on the Edit button to modify any of the parameters on any user. Then the desired profile can be activated. |
|
25 |
+ |
|
26 |
+The **MCOP SDK** or **MCOP MCPTT Client** will use the configuration on the activated profile the next time is opened. |
|
27 |
+ |
|
28 |
+## demo.mcopenplatform.org |
|
29 |
+ |
|
30 |
+The [**demo.mcopenplatform.org**](https://demo.mcopenplatform.org/) platform can be used for testing purposes. |
|
31 |
+ |
|
32 |
+Click on [**Request Access**](https://demo.mcopenplatform.org/reserve) and check the calendar there for an empty slot, and you'll receive credentials for five test users (with suffixes A to E). Update the profiles in the Provisioning Tool with the provided configuration in order to test MCOP with our Online Testing Platform. |
|
33 |
+ |
|
34 |
+The **Name** field (max. 10 characters) in the form will determine the name of the client ID. Check the **Parameters** section below for a specific example. |
|
35 |
+ |
|
36 |
+### Parameters |
|
37 |
+ |
|
38 |
+* **IMPU**: IP Multimedia Public Identity. e.g. sip:mcptt-DEMO-A@organization.org |
|
39 |
+ |
|
40 |
+* **IMPI**: The IP Multimedia Private Identity used to authenticate. |
|
41 |
+ |
|
42 |
+ e.g. mcptt-DEMO-A@organization.org |
|
43 |
+ |
|
44 |
+* **PASSWORD**: A shared secret key for the authentication process. |
|
45 |
+ |
|
46 |
+ e.g. 0123456789 |
|
47 |
+ |
|
48 |
+* **Realm**: Domain. |
|
49 |
+ |
|
50 |
+ e.g. organization.org |
|
51 |
+ |
|
52 |
+* **PcscfHost**: Host name or ip address of the P-CSCF (Proxy-Call Session Control Function). e.g. demo.mcopenplatform.org * **PcscfPort**: Port number of the P-CSCF. e.g. 5070 |
|
53 |
+ |
|
54 |
+* **Transport**: Transport protocol. e.g. TCP |
|
55 |
+ |
|
56 |
+* **McpttId**: MCPTT identifier. e.g. sip:mcptt_id_DEMO_A@organization.org * **McpttClientId**: MCPTT Client identifier. e.g. sip:mcptt_id_DEMO_A@organization.org |
|
57 |
+ |
|
58 |
+## Installation |
|
59 |
+ |
|
60 |
+Download the **MCOP Provisioning Tool apk** from [here](https://demo.mcopenplatform.org/gitlist/mcop/MCOP-SDK.git/raw/master/provisioning/MCOP_ProvisioningTool.apk). |
|
61 |
+ |
|
62 |
+It can be installed directly from an Android device, or using [Android ADB](https://developer.android.com/studio/command-line/adb) from a computer. |
|
63 |
+ |
|
64 |
+## Screenshot |
|
65 |
+ |
|
66 |
+![MCOP Provisioning Tool](../images/provisioning_tool.png) |
|
67 |
+ |
... | ... |
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME |
3 | 3 |
distributionPath=wrapper/dists |
4 | 4 |
zipStoreBase=GRADLE_USER_HOME |
5 | 5 |
zipStorePath=wrapper/dists |
6 |
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip |
|
6 |
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip |