Revert "Removing OrSelf check when checking for PRIVILEGED_PHONE_STATE perm."
Svetoslav Ganov [Thu, 30 Jul 2015 20:04:37 +0000 (20:04 +0000)]
This reverts commit b872941b01c651df631b4b4700f3493b2f517f7b.

Change-Id: Idcc5c7817ab405cec136884528238b51ef762273

src/java/com/android/internal/telephony/PhoneSubInfo.java
src/java/com/android/internal/telephony/SubscriptionController.java

index 5b88cbf..91909a2 100755 (executable)
@@ -367,10 +367,10 @@ public class PhoneSubInfo {
 
     private boolean checkReadPhoneState(String callingPackage, String message) {
         try {
-            mContext.enforceCallingPermission(
+            mContext.enforceCallingOrSelfPermission(
                     android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, message);
 
-            // SKIP checking run-time OP_READ_PHONE_STATE since using PRIVILEGED
+            // SKIP checking run-time OP_READ_PHONE_STATE since self or using PRIVILEGED
             return true;
         } catch (SecurityException e) {
             mContext.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE,
index 63f2948..f8b78a9 100644 (file)
@@ -208,10 +208,10 @@ public class SubscriptionController extends ISub.Stub {
      */
     private boolean canReadPhoneState(String callingPackage, String message) {
         try {
-            mContext.enforceCallingPermission(
+            mContext.enforceCallingOrSelfPermission(
                     android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, message);
 
-            // SKIP checking run-time permission since using PRIVILEDGED permission
+            // SKIP checking run-time permission since self or using PRIVILEDGED permission
             return true;
         } catch (SecurityException e) {
             mContext.enforceCallingOrSelfPermission(android.Manifest.permission.READ_PHONE_STATE,