Modify some TelephonyManager APIs in PhoneInterfaceManager.
am: ee13a9b149
* commit 'ee13a9b14976efd7404816891aecab50a0451966':
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;