Modify some TelephonyManager APIs in PhoneInterfaceManager. am: ee13a9b149 am: 74fa1b4687
am: 825127391a

* commit '825127391a0c78c66621880d9a62f9a2a648145b':
  Modify some TelephonyManager APIs in PhoneInterfaceManager.
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 1963d34..d9c5f0f 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -1436,7 +1436,8 @@
             return null;
         }
 
-        if (checkIfCallerIsSelfOrForegroundUser()) {
+        if (checkIfCallerIsSelfOrForegroundUser() ||
+                checkCallerInteractAcrossUsersFull()) {
             if (DBG_LOC) log("getCellLocation: is active user");
             Bundle data = new Bundle();
             Phone phone = getPhone(mSubscriptionController.getDefaultDataSubId());
@@ -1511,7 +1512,8 @@
             return null;
         }
 
-        if (checkIfCallerIsSelfOrForegroundUser()) {
+        if (checkIfCallerIsSelfOrForegroundUser() ||
+                checkCallerInteractAcrossUsersFull()) {
             if (DBG_LOC) log("getNeighboringCellInfo: is active user");
 
             ArrayList<NeighboringCellInfo> cells = null;
@@ -1541,7 +1543,8 @@
             return null;
         }
 
-        if (checkIfCallerIsSelfOrForegroundUser()) {
+        if (checkIfCallerIsSelfOrForegroundUser() ||
+                checkCallerInteractAcrossUsersFull()) {
             if (DBG_LOC) log("getAllCellInfo: is active user");
             List<CellInfo> cellInfos = new ArrayList<CellInfo>();
             for (Phone phone : PhoneFactory.getPhones()) {
@@ -1564,6 +1567,15 @@
     // Internal helper methods.
     //
 
+    /**
+     * Returns true if the caller holds INTERACT_ACROSS_USERS_FULL.
+     */
+    private boolean checkCallerInteractAcrossUsersFull() {
+        return mPhone.getContext().checkCallingOrSelfPermission(
+                android.Manifest.permission.INTERACT_ACROSS_USERS_FULL)
+                == PackageManager.PERMISSION_GRANTED;
+    }
+
     private static boolean checkIfCallerIsSelfOrForegroundUser() {
         boolean ok;