From 3c6f6bef4084052463c8665cfdc340e5cdf46162 Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Wed, 10 Jun 2015 17:04:17 -0700 Subject: DO NOT MERGE Change to add STK_PERMISSION for stk related commands. And make stk commands protected. Bug: 21697171 Change-Id: I7649c7341428194963ac74e9ae622dfa76ea738b Conflicts: src/java/com/android/internal/telephony/cat/CatService.java --- src/java/com/android/internal/telephony/cat/AppInterface.java | 3 +++ src/java/com/android/internal/telephony/cat/CatService.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/java/com/android/internal/telephony/cat/AppInterface.java b/src/java/com/android/internal/telephony/cat/AppInterface.java index 299e140..cbdc84c 100644 --- a/src/java/com/android/internal/telephony/cat/AppInterface.java +++ b/src/java/com/android/internal/telephony/cat/AppInterface.java @@ -32,6 +32,9 @@ public interface AppInterface { public static final String CAT_SESSION_END_ACTION = "android.intent.action.stk.session_end"; + // Permission required by STK command receiver + public static final String STK_PERMISSION = "android.permission.RECEIVE_STK_COMMANDS"; + /* * Callback function from app to telephony to pass a result code and user's * input back to the ICC. diff --git a/src/java/com/android/internal/telephony/cat/CatService.java b/src/java/com/android/internal/telephony/cat/CatService.java index 3dcf4da..f7bd859 100644 --- a/src/java/com/android/internal/telephony/cat/CatService.java +++ b/src/java/com/android/internal/telephony/cat/CatService.java @@ -370,7 +370,7 @@ public class CatService extends Handler implements AppInterface { mCurrntCmd = cmdMsg; Intent intent = new Intent(AppInterface.CAT_CMD_ACTION); intent.putExtra("STK CMD", cmdMsg); - mContext.sendBroadcast(intent); + mContext.sendBroadcast(intent, AppInterface.STK_PERMISSION); } /** @@ -382,7 +382,7 @@ public class CatService extends Handler implements AppInterface { mCurrntCmd = mMenuCmd; Intent intent = new Intent(AppInterface.CAT_SESSION_END_ACTION); - mContext.sendBroadcast(intent); + mContext.sendBroadcast(intent, AppInterface.STK_PERMISSION); } private void sendTerminalResponse(CommandDetails cmdDet, -- cgit v1.1