summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Brown <dab@google.com>2011-06-17 01:33:36 -0700
committerDavid Brown <dab@google.com>2011-06-17 01:36:20 -0700
commite510fa4c0b56814aadd938596847aec9ab0290cc (patch)
treeead6ef3777857a027597656b192ca6cedd27f118
parent25b93adeae84e98a7af8d963b04776e4b755a32a (diff)
downloadframeworks_base-e510fa4c0b56814aadd938596847aec9ab0290cc.zip
frameworks_base-e510fa4c0b56814aadd938596847aec9ab0290cc.tar.gz
frameworks_base-e510fa4c0b56814aadd938596847aec9ab0290cc.tar.bz2
Fix permissions check in IccSmsInterfaceManager.sendText()
In android.internal.telephony.IccSmsInterfaceManager, we currently use enforceCallingPermission() rather than enforceCallingOrSelfPermission() to enforce the SEND_SMS permission. The difference is that enforceCallingPermission() will ALWAYS throw a SecurityException if you're not handling an IPC, i.e. if the request is from the same process as the telephony framework. In other words, the current code prevents the phone app from ever using SmsManager.sendTextMessage() :-( This change fixes IccSmsInterfaceManager.sendText() to use enforceCallingOrSelfPermission(), and I confirmed I can now send SMSes from the phone app. NOTE there are a bunch of other uses of enforceCallingPermission() in the telephony framework (all SMS-related) that we probably want to fix too, although I'm fixing just this one for now since it's blocking a hi-pri phone UI feature. I opened bug 4686733 to cover the rest of the cleanup, though. Bug: 4686733 Change-Id: Iaffcf62c54493fa4961fb20894c974697f26e3a7
-rw-r--r--telephony/java/com/android/internal/telephony/IccSmsInterfaceManager.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/telephony/java/com/android/internal/telephony/IccSmsInterfaceManager.java b/telephony/java/com/android/internal/telephony/IccSmsInterfaceManager.java
index 5fef6de..9763265 100644
--- a/telephony/java/com/android/internal/telephony/IccSmsInterfaceManager.java
+++ b/telephony/java/com/android/internal/telephony/IccSmsInterfaceManager.java
@@ -112,7 +112,7 @@ public abstract class IccSmsInterfaceManager extends ISms.Stub {
*/
public void sendText(String destAddr, String scAddr,
String text, PendingIntent sentIntent, PendingIntent deliveryIntent) {
- mPhone.getContext().enforceCallingPermission(
+ mPhone.getContext().enforceCallingOrSelfPermission(
"android.permission.SEND_SMS",
"Sending SMS message");
if (Log.isLoggable("SMS", Log.VERBOSE)) {