diff options
author | Preeti Ahuja <preetia@codeaurora.org> | 2014-04-18 15:48:12 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2016-08-24 08:17:51 -0600 |
commit | 84c4d220ac2bc3e472f3e1700502ec58ee3bdfed (patch) | |
tree | bff3927ef7da4d6ded93b846706f8f980766c18c | |
parent | 55301060f3b1adc224556428cc99ebc4e6933252 (diff) | |
download | android_packages_apps_Stk-84c4d220ac2bc3e472f3e1700502ec58ee3bdfed.tar.gz android_packages_apps_Stk-84c4d220ac2bc3e472f3e1700502ec58ee3bdfed.tar.bz2 android_packages_apps_Stk-84c4d220ac2bc3e472f3e1700502ec58ee3bdfed.zip |
Stk: Add support for Activate cmd and HCI connectivity event
Add support for Activate proactive command defined in ETSI TS
102 223 [6.4.40] and HCI connectivity event defined in ETSI TS
102 223 [7.5.18].
Change-Id: I349a68e1a7c9e93349de0290d1795f1774460983
CRs-Fixed: 618962
-rw-r--r-- | AndroidManifest.xml | 7 | ||||
-rw-r--r-- | res/values/strings.xml | 3 | ||||
-rwxr-xr-x | src/com/android/stk/StkAppService.java | 27 | ||||
-rw-r--r-- | src/com/android/stk/StkCmdReceiver.java | 11 |
4 files changed, 47 insertions, 1 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 95c8cf2..5951f90 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -22,9 +22,15 @@ <original-package android:name="com.android.stk" /> + <permission android:name="android.permission.SEND_RECEIVE_STK_INTENT" + android:label="@string/stk_intent_permission" + android:protectionLevel="signature"> + </permission> + <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.GET_TASKS"/> <uses-permission android:name="android.permission.RECEIVE_STK_COMMANDS" /> + <uses-permission android:name="android.permission.SEND_RECEIVE_STK_INTENT"/> <application android:icon="@drawable/ic_launcher_sim_toolkit" android:label="@string/app_name" @@ -102,6 +108,7 @@ <action android:name= "android.intent.action.stk.icc_status_change" /> <action android:name= "android.intent.action.stk.alpha_notify" /> <action android:name= "android.intent.action.LOCALE_CHANGED" /> + <action android:name= "org.codeaurora.intent.action.stk.hci_connectivity" /> </intent-filter> </receiver> diff --git a/res/values/strings.xml b/res/values/strings.xml index ea50e85..d76ac37 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -62,4 +62,7 @@ <string name="stk_dialog_accept">YES</string> <string name="stk_dialog_reject">NO</string> <string name="no_sim_card_inserted">Please insert SIM to launch SIM Toolkit.</string> + + <!-- Permission required for receiving intents from StkAppService--> + <string name="stk_intent_permission">Allow STK Intents </string> </resources> diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java index a46c5fd..3e45b37 100755 --- a/src/com/android/stk/StkAppService.java +++ b/src/com/android/stk/StkAppService.java @@ -89,7 +89,8 @@ import static com.android.internal.telephony.cat.CatCmdMessage. SetupEventListConstants.IDLE_SCREEN_AVAILABLE_EVENT; import static com.android.internal.telephony.cat.CatCmdMessage. SetupEventListConstants.LANGUAGE_SELECTION_EVENT; - +import static com.android.internal.telephony.cat.CatCmdMessage. + SetupEventListConstants.HCI_CONNECTIVITY_EVENT; /** * SIM toolkit application level service. Interacts with Telephopny messages, * application's launch and user input from STK UI elements. @@ -207,6 +208,7 @@ public class StkAppService extends Service implements Runnable { static final int OP_LOCALE_CHANGED = 11; static final int OP_ALPHA_NOTIFY = 12; static final int OP_IDLE_SCREEN = 13; + static final int OP_HCI_CONNECTIVITY = 14; //Invalid SetupEvent static final int INVALID_SETUP_EVENT = 0xFF; @@ -349,6 +351,9 @@ public class StkAppService extends Service implements Runnable { case OP_END_SESSION: case OP_BOOT_COMPLETED: break; + case OP_HCI_CONNECTIVITY: + msg.obj = args; + break; default: return; } @@ -596,6 +601,10 @@ public class StkAppService extends Service implements Runnable { } } break; + case OP_HCI_CONNECTIVITY: + CatLog.d(this, "Received HCI CONNECTIVITY"); + checkForSetupEvent(HCI_CONNECTIVITY_EVENT, (Bundle) msg.obj, slotId); + break; } } @@ -712,6 +721,7 @@ public class StkAppService extends Service implements Runnable { case RECEIVE_DATA: case SEND_DATA: case SET_UP_EVENT_LIST: + case ACTIVATE: return false; } @@ -988,6 +998,11 @@ public class StkAppService extends Service implements Runnable { checkForSetupEvent(IDLE_SCREEN_AVAILABLE_EVENT, null, slotId); } break; + case ACTIVATE: + waitForUsersResponse = false; + CatLog.d(this, "Broadcasting STK ACTIVATE intent"); + broadcastActivateIntent(slotId); + break; } if (!waitForUsersResponse) { @@ -999,6 +1014,13 @@ public class StkAppService extends Service implements Runnable { } } + private void broadcastActivateIntent(int slotId) { + Intent intent = new Intent(AppInterface.CAT_ACTIVATE_NOTIFY_ACTION); + intent.putExtra("STK_CMD", "ACTIVATE"); + intent.putExtra(SLOT_ID, slotId); + mContext.sendBroadcast(intent, "android.permission.SEND_RECEIVE_STK_INTENT"); + } + private void handleCmdResponse(Bundle args, int slotId) { CatLog.d(LOG_TAG, "handleCmdResponse, sim id: " + slotId); if (mStkContext[slotId].mCurrentCmd == null) { @@ -1399,6 +1421,9 @@ public class StkAppService extends Service implements Runnable { addedInfo = GsmAlphabet.stringToGsm8BitPacked(language); sendSetUpEventResponse(event, addedInfo, slotId); break; + case HCI_CONNECTIVITY_EVENT: + sendSetUpEventResponse(event, addedInfo, slotId); + break; default: break; } diff --git a/src/com/android/stk/StkCmdReceiver.java b/src/com/android/stk/StkCmdReceiver.java index 508e7f8..8505c73 100644 --- a/src/com/android/stk/StkCmdReceiver.java +++ b/src/com/android/stk/StkCmdReceiver.java @@ -48,6 +48,8 @@ public class StkCmdReceiver extends BroadcastReceiver { handleAction(context, intent, StkAppService.OP_ALPHA_NOTIFY); } else if (action.equals(Intent.ACTION_SCREEN_OFF)) { handleIdleScreen(context); + } else if (action.equals(AppInterface.CAT_HCI_CONNECTIVITY_ACTION)) { + handleHciConnectivity(context, intent); } } @@ -99,4 +101,13 @@ public class StkCmdReceiver extends BroadcastReceiver { context.startService(new Intent(context, StkAppService.class) .putExtras(args)); } + + private void handleHciConnectivity(Context context, Intent intent) { + Bundle args = new Bundle(); + int slotId = intent.getIntExtra("SLOT_ID", 0); + args.putInt(StkAppService.SLOT_ID, slotId); + args.putInt(StkAppService.OPCODE, StkAppService.OP_HCI_CONNECTIVITY); + context.startService(new Intent(context, StkAppService.class) + .putExtras(args)); + } } |