diff options
author | Zach Johnson <zachoverflow@google.com> | 2015-05-19 00:02:27 -0700 |
---|---|---|
committer | Zach Johnson <zachoverflow@google.com> | 2015-06-08 13:49:13 -0700 |
commit | b4b9ca7580c75f07330e5222cbd9ccc93b12935e (patch) | |
tree | 99c18c384cf567d01d9771533608cee0c158a4d5 /telephony/java/android | |
parent | 7631697793a8b82bb2a1cd3adced1b140d266427 (diff) | |
download | frameworks_base-b4b9ca7580c75f07330e5222cbd9ccc93b12935e.zip frameworks_base-b4b9ca7580c75f07330e5222cbd9ccc93b12935e.tar.gz frameworks_base-b4b9ca7580c75f07330e5222cbd9ccc93b12935e.tar.bz2 |
Ignore carrier apps when checking for idleness
Also introduce a way to check if a package has
carrier privileges for any active phone.
Change-Id: If5c5fe07f05ffc90fc21431eb27cf48030c0175b
Diffstat (limited to 'telephony/java/android')
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 86f7ec3..5d792d3 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -3658,11 +3658,11 @@ public class TelephonyManager { /** @hide */ @SystemApi - public int checkCarrierPrivilegesForPackage(String pkgname) { + public int checkCarrierPrivilegesForPackage(String pkgName) { try { ITelephony telephony = getITelephony(); if (telephony != null) - return telephony.checkCarrierPrivilegesForPackage(pkgname); + return telephony.checkCarrierPrivilegesForPackage(pkgName); } catch (RemoteException ex) { Rlog.e(TAG, "checkCarrierPrivilegesForPackage RemoteException", ex); } catch (NullPointerException ex) { @@ -3673,6 +3673,21 @@ public class TelephonyManager { /** @hide */ @SystemApi + public int checkCarrierPrivilegesForPackageAnyPhone(String pkgName) { + try { + ITelephony telephony = getITelephony(); + if (telephony != null) + return telephony.checkCarrierPrivilegesForPackageAnyPhone(pkgName); + } catch (RemoteException ex) { + Rlog.e(TAG, "checkCarrierPrivilegesForPackageAnyPhone RemoteException", ex); + } catch (NullPointerException ex) { + Rlog.e(TAG, "checkCarrierPrivilegesForPackageAnyPhone NPE", ex); + } + return CARRIER_PRIVILEGE_STATUS_NO_ACCESS; + } + + /** @hide */ + @SystemApi public List<String> getCarrierPackageNamesForIntent(Intent intent) { return getCarrierPackageNamesForIntentAndPhone(intent, getDefaultPhone()); } |