summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPreeti Ahuja <preetia@codeaurora.org>2014-04-18 15:48:12 -0700
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:29:35 -0600
commit6c62c66331dfa97ad11013ce816512a3a7f7c29f (patch)
treef0fb457c9559d54206e7a60d468ff09d4dc65fdb
parent9f0f676fb5c5710fdac21e141f56e3bcc4a072ba (diff)
downloadandroid_packages_apps_Stk-6c62c66331dfa97ad11013ce816512a3a7f7c29f.tar.gz
android_packages_apps_Stk-6c62c66331dfa97ad11013ce816512a3a7f7c29f.tar.bz2
android_packages_apps_Stk-6c62c66331dfa97ad11013ce816512a3a7f7c29f.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.xml7
-rw-r--r--res/values/strings.xml3
-rwxr-xr-xsrc/com/android/stk/StkAppService.java27
-rw-r--r--src/com/android/stk/StkCmdReceiver.java11
4 files changed, 47 insertions, 1 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index acd1e5c..c10c2a7 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"
@@ -109,6 +115,7 @@
<action android:name= "android.intent.action.stk.alpha_notify" />
<action android:name= "android.intent.action.LOCALE_CHANGED" />
<action android:name= "org.codeaurora.action.stk.idle_screen"/>
+ <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 c33b98f..770b75c 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -64,4 +64,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 5760599..97ee9a5 100755
--- a/src/com/android/stk/StkAppService.java
+++ b/src/com/android/stk/StkAppService.java
@@ -92,7 +92,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.
@@ -214,6 +215,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;
@@ -377,6 +379,9 @@ public class StkAppService extends Service implements Runnable {
msg.obj = args;
msg.what = STOP_TONE_WHAT;
break;
+ case OP_HCI_CONNECTIVITY:
+ msg.obj = args;
+ break;
default:
return;
}
@@ -627,6 +632,10 @@ public class StkAppService extends Service implements Runnable {
CatLog.d(this, "Stop tone");
handleStopTone(msg, slotId);
break;
+ case OP_HCI_CONNECTIVITY:
+ CatLog.d(this, "Received HCI CONNECTIVITY");
+ checkForSetupEvent(HCI_CONNECTIVITY_EVENT, (Bundle) msg.obj, slotId);
+ break;
}
}
@@ -753,6 +762,7 @@ public class StkAppService extends Service implements Runnable {
case RECEIVE_DATA:
case SEND_DATA:
case SET_UP_EVENT_LIST:
+ case ACTIVATE:
return false;
}
@@ -1038,6 +1048,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) {
@@ -1049,6 +1064,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) {
@@ -1442,6 +1464,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 217f7b7..a4bfff2 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(StkAppService.CAT_IDLE_SCREEN_ACTION)) {
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));
+ }
}