Loading src/java/com/android/internal/telephony/cat/AppInterface.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.telephony.cat; import android.content.ComponentName; /** * Interface for communication between STK App and CAT Telephony * Loading Loading @@ -48,6 +50,11 @@ public interface AppInterface { // Permission required by STK command receiver public static final String STK_PERMISSION = "android.permission.RECEIVE_STK_COMMANDS"; // Only forwards cat broadcast to the system default stk app public static ComponentName getDefaultSTKApplication() { return ComponentName.unflattenFromString("com.android.stk/.StkCmdReceiver"); } /* * Callback function from app to telephony to pass a result code and user's * input back to the ICC. Loading src/java/com/android/internal/telephony/cat/CatService.java +4 −0 Original line number Diff line number Diff line Loading @@ -513,6 +513,7 @@ public class CatService extends Handler implements AppInterface { Intent intent = new Intent(AppInterface.CAT_CMD_ACTION); intent.putExtra("STK CMD", cmdMsg); intent.putExtra("SLOT_ID", mSlotId); intent.setComponent(AppInterface.getDefaultSTKApplication()); CatLog.d(this, "Sending CmdMsg: " + cmdMsg+ " on slotid:" + mSlotId); mContext.sendBroadcast(intent, AppInterface.STK_PERMISSION); } Loading @@ -527,6 +528,7 @@ public class CatService extends Handler implements AppInterface { mCurrntCmd = mMenuCmd; Intent intent = new Intent(AppInterface.CAT_SESSION_END_ACTION); intent.putExtra("SLOT_ID", mSlotId); intent.setComponent(AppInterface.getDefaultSTKApplication()); mContext.sendBroadcast(intent, AppInterface.STK_PERMISSION); } Loading Loading @@ -878,6 +880,7 @@ public class CatService extends Handler implements AppInterface { // This sends an intent with CARD_ABSENT (0 - false) /CARD_PRESENT (1 - true). intent.putExtra(AppInterface.CARD_STATUS, cardPresent); intent.setComponent(AppInterface.getDefaultSTKApplication()); CatLog.d(this, "Sending Card Status: " + cardState + " " + "cardPresent: " + cardPresent); mContext.sendBroadcast(intent, AppInterface.STK_PERMISSION); Loading @@ -889,6 +892,7 @@ public class CatService extends Handler implements AppInterface { intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(AppInterface.ALPHA_STRING, alphaString); intent.putExtra("SLOT_ID", mSlotId); intent.setComponent(AppInterface.getDefaultSTKApplication()); mContext.sendBroadcast(intent, AppInterface.STK_PERMISSION); } Loading Loading
src/java/com/android/internal/telephony/cat/AppInterface.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.telephony.cat; import android.content.ComponentName; /** * Interface for communication between STK App and CAT Telephony * Loading Loading @@ -48,6 +50,11 @@ public interface AppInterface { // Permission required by STK command receiver public static final String STK_PERMISSION = "android.permission.RECEIVE_STK_COMMANDS"; // Only forwards cat broadcast to the system default stk app public static ComponentName getDefaultSTKApplication() { return ComponentName.unflattenFromString("com.android.stk/.StkCmdReceiver"); } /* * Callback function from app to telephony to pass a result code and user's * input back to the ICC. Loading
src/java/com/android/internal/telephony/cat/CatService.java +4 −0 Original line number Diff line number Diff line Loading @@ -513,6 +513,7 @@ public class CatService extends Handler implements AppInterface { Intent intent = new Intent(AppInterface.CAT_CMD_ACTION); intent.putExtra("STK CMD", cmdMsg); intent.putExtra("SLOT_ID", mSlotId); intent.setComponent(AppInterface.getDefaultSTKApplication()); CatLog.d(this, "Sending CmdMsg: " + cmdMsg+ " on slotid:" + mSlotId); mContext.sendBroadcast(intent, AppInterface.STK_PERMISSION); } Loading @@ -527,6 +528,7 @@ public class CatService extends Handler implements AppInterface { mCurrntCmd = mMenuCmd; Intent intent = new Intent(AppInterface.CAT_SESSION_END_ACTION); intent.putExtra("SLOT_ID", mSlotId); intent.setComponent(AppInterface.getDefaultSTKApplication()); mContext.sendBroadcast(intent, AppInterface.STK_PERMISSION); } Loading Loading @@ -878,6 +880,7 @@ public class CatService extends Handler implements AppInterface { // This sends an intent with CARD_ABSENT (0 - false) /CARD_PRESENT (1 - true). intent.putExtra(AppInterface.CARD_STATUS, cardPresent); intent.setComponent(AppInterface.getDefaultSTKApplication()); CatLog.d(this, "Sending Card Status: " + cardState + " " + "cardPresent: " + cardPresent); mContext.sendBroadcast(intent, AppInterface.STK_PERMISSION); Loading @@ -889,6 +892,7 @@ public class CatService extends Handler implements AppInterface { intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); intent.putExtra(AppInterface.ALPHA_STRING, alphaString); intent.putExtra("SLOT_ID", mSlotId); intent.setComponent(AppInterface.getDefaultSTKApplication()); mContext.sendBroadcast(intent, AppInterface.STK_PERMISSION); } Loading