Loading services/usage/java/com/android/server/usage/AppStandbyController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1356,7 +1356,7 @@ public class AppStandbyController { private void fetchCarrierPrivilegedAppsLocked() { TelephonyManager telephonyManager = mContext.getSystemService(TelephonyManager.class); mCarrierPrivilegedApps = telephonyManager.getPackagesWithCarrierPrivileges(); mCarrierPrivilegedApps = telephonyManager.getPackagesWithCarrierPrivilegesForAllPhones(); mHaveCarrierPrivilegedApps = true; if (DEBUG) { Slog.d(TAG, "apps with carrier privilege " + mCarrierPrivilegedApps); Loading telephony/java/android/telephony/TelephonyManager.java +18 −2 Original line number Diff line number Diff line Loading @@ -7475,7 +7475,7 @@ public class TelephonyManager { try { ITelephony telephony = getITelephony(); if (telephony != null) return telephony.checkCarrierPrivilegesForPackage(pkgName); return telephony.checkCarrierPrivilegesForPackage(getSubId(), pkgName); } catch (RemoteException ex) { Rlog.e(TAG, "checkCarrierPrivilegesForPackage RemoteException", ex); } catch (NullPointerException ex) { Loading Loading @@ -7526,7 +7526,7 @@ public class TelephonyManager { try { ITelephony telephony = getITelephony(); if (telephony != null) { return telephony.getPackagesWithCarrierPrivileges(); return telephony.getPackagesWithCarrierPrivileges(getPhoneId()); } } catch (RemoteException ex) { Rlog.e(TAG, "getPackagesWithCarrierPrivileges RemoteException", ex); Loading @@ -7536,6 +7536,22 @@ public class TelephonyManager { return Collections.EMPTY_LIST; } /** @hide */ public List<String> getPackagesWithCarrierPrivilegesForAllPhones() { try { ITelephony telephony = getITelephony(); if (telephony != null) { return telephony.getPackagesWithCarrierPrivilegesForAllPhones(); } } catch (RemoteException ex) { Rlog.e(TAG, "getPackagesWithCarrierPrivilegesForAllPhones RemoteException", ex); } catch (NullPointerException ex) { Rlog.e(TAG, "getPackagesWithCarrierPrivilegesForAllPhones NPE", ex); } return Collections.EMPTY_LIST; } /** @hide */ @SystemApi @SuppressLint("Doclava125") Loading telephony/java/com/android/internal/telephony/ITelephony.aidl +8 −3 Original line number Diff line number Diff line Loading @@ -1000,7 +1000,7 @@ interface ITelephony { /** * Similar to above, but check for the package whose name is pkgName. */ int checkCarrierPrivilegesForPackage(String pkgName); int checkCarrierPrivilegesForPackage(int subId, String pkgName); /** * Similar to above, but check across all phones. Loading Loading @@ -1356,10 +1356,15 @@ interface ITelephony { void setVoicemailVibrationEnabled(String callingPackage, in PhoneAccountHandle phoneAccountHandle, boolean enabled); /** * Returns a list of packages that have carrier privileges for the specific phone. */ List<String> getPackagesWithCarrierPrivileges(int phoneId); /** * Returns a list of packages that have carrier privileges. */ List<String> getPackagesWithCarrierPrivileges(); List<String> getPackagesWithCarrierPrivilegesForAllPhones(); /** * Return the application ID for the app type. Loading Loading
services/usage/java/com/android/server/usage/AppStandbyController.java +1 −1 Original line number Diff line number Diff line Loading @@ -1356,7 +1356,7 @@ public class AppStandbyController { private void fetchCarrierPrivilegedAppsLocked() { TelephonyManager telephonyManager = mContext.getSystemService(TelephonyManager.class); mCarrierPrivilegedApps = telephonyManager.getPackagesWithCarrierPrivileges(); mCarrierPrivilegedApps = telephonyManager.getPackagesWithCarrierPrivilegesForAllPhones(); mHaveCarrierPrivilegedApps = true; if (DEBUG) { Slog.d(TAG, "apps with carrier privilege " + mCarrierPrivilegedApps); Loading
telephony/java/android/telephony/TelephonyManager.java +18 −2 Original line number Diff line number Diff line Loading @@ -7475,7 +7475,7 @@ public class TelephonyManager { try { ITelephony telephony = getITelephony(); if (telephony != null) return telephony.checkCarrierPrivilegesForPackage(pkgName); return telephony.checkCarrierPrivilegesForPackage(getSubId(), pkgName); } catch (RemoteException ex) { Rlog.e(TAG, "checkCarrierPrivilegesForPackage RemoteException", ex); } catch (NullPointerException ex) { Loading Loading @@ -7526,7 +7526,7 @@ public class TelephonyManager { try { ITelephony telephony = getITelephony(); if (telephony != null) { return telephony.getPackagesWithCarrierPrivileges(); return telephony.getPackagesWithCarrierPrivileges(getPhoneId()); } } catch (RemoteException ex) { Rlog.e(TAG, "getPackagesWithCarrierPrivileges RemoteException", ex); Loading @@ -7536,6 +7536,22 @@ public class TelephonyManager { return Collections.EMPTY_LIST; } /** @hide */ public List<String> getPackagesWithCarrierPrivilegesForAllPhones() { try { ITelephony telephony = getITelephony(); if (telephony != null) { return telephony.getPackagesWithCarrierPrivilegesForAllPhones(); } } catch (RemoteException ex) { Rlog.e(TAG, "getPackagesWithCarrierPrivilegesForAllPhones RemoteException", ex); } catch (NullPointerException ex) { Rlog.e(TAG, "getPackagesWithCarrierPrivilegesForAllPhones NPE", ex); } return Collections.EMPTY_LIST; } /** @hide */ @SystemApi @SuppressLint("Doclava125") Loading
telephony/java/com/android/internal/telephony/ITelephony.aidl +8 −3 Original line number Diff line number Diff line Loading @@ -1000,7 +1000,7 @@ interface ITelephony { /** * Similar to above, but check for the package whose name is pkgName. */ int checkCarrierPrivilegesForPackage(String pkgName); int checkCarrierPrivilegesForPackage(int subId, String pkgName); /** * Similar to above, but check across all phones. Loading Loading @@ -1356,10 +1356,15 @@ interface ITelephony { void setVoicemailVibrationEnabled(String callingPackage, in PhoneAccountHandle phoneAccountHandle, boolean enabled); /** * Returns a list of packages that have carrier privileges for the specific phone. */ List<String> getPackagesWithCarrierPrivileges(int phoneId); /** * Returns a list of packages that have carrier privileges. */ List<String> getPackagesWithCarrierPrivileges(); List<String> getPackagesWithCarrierPrivilegesForAllPhones(); /** * Return the application ID for the app type. Loading