From 7931b2efffaeb4d3bdd6c91e57ad51e7393ae7c0 Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Wed, 11 Mar 2020 16:09:35 -0700 Subject: [PATCH] Remove telephony protection level. Test: manual sanity & TH Bug: 148482594 Change-Id: Iae57fddd400ca7549f32d755d478ee225a5375c5 --- api/system-current.txt | 1 - api/test-current.txt | 2 -- .../app/ApplicationPackageManager.java | 9 ----- .../android/content/pm/IPackageManager.aidl | 2 -- .../android/content/pm/PackageManager.java | 12 ------- .../android/content/pm/PermissionInfo.java | 15 -------- core/res/AndroidManifest.xml | 34 +++++++++---------- core/res/res/values/attrs_manifest.xml | 3 -- core/res/res/values/config.xml | 9 ----- core/res/res/values/symbols.xml | 1 - .../content/pm/PackageManagerInternal.java | 2 -- .../server/pm/PackageManagerService.java | 14 -------- .../server/pm/permission/BasePermission.java | 3 -- .../permission/PermissionManagerService.java | 7 ---- 14 files changed, 17 insertions(+), 97 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index 88aa2a7b1e358..a8ffc243c85f6 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -2322,7 +2322,6 @@ package android.content.pm { field public static final int PROTECTION_FLAG_OEM = 16384; // 0x4000 field public static final int PROTECTION_FLAG_RETAIL_DEMO = 16777216; // 0x1000000 field public static final int PROTECTION_FLAG_SYSTEM_TEXT_CLASSIFIER = 65536; // 0x10000 - field public static final int PROTECTION_FLAG_TELEPHONY = 4194304; // 0x400000 field public static final int PROTECTION_FLAG_WELLBEING = 131072; // 0x20000 field @Nullable public final String backgroundPermission; field @StringRes public int requestRes; diff --git a/api/test-current.txt b/api/test-current.txt index 4f4c82b43e706..23c3c983d8db9 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -949,7 +949,6 @@ package android.content.pm { method @NonNull public abstract String getServicesSystemSharedLibraryPackageName(); method @NonNull public abstract String getSharedSystemSharedLibraryPackageName(); method @Nullable public String getSystemTextClassifierPackageName(); - method @Nullable public String[] getTelephonyPackageNames(); method @Nullable public String getWellbeingPackageName(); method @RequiresPermission("android.permission.GRANT_RUNTIME_PERMISSIONS") public abstract void grantRuntimePermission(@NonNull String, @NonNull String, @NonNull android.os.UserHandle); method @RequiresPermission("android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS") public abstract void removeOnPermissionsChangeListener(@NonNull android.content.pm.PackageManager.OnPermissionsChangedListener); @@ -992,7 +991,6 @@ package android.content.pm { field public static final int PROTECTION_FLAG_OEM = 16384; // 0x4000 field public static final int PROTECTION_FLAG_RETAIL_DEMO = 16777216; // 0x1000000 field public static final int PROTECTION_FLAG_SYSTEM_TEXT_CLASSIFIER = 65536; // 0x10000 - field public static final int PROTECTION_FLAG_TELEPHONY = 4194304; // 0x400000 field public static final int PROTECTION_FLAG_VENDOR_PRIVILEGED = 32768; // 0x8000 field public static final int PROTECTION_FLAG_WELLBEING = 131072; // 0x20000 field @Nullable public final String backgroundPermission; diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java index 87d33a9804383..60134733665b8 100644 --- a/core/java/android/app/ApplicationPackageManager.java +++ b/core/java/android/app/ApplicationPackageManager.java @@ -3275,15 +3275,6 @@ public class ApplicationPackageManager extends PackageManager { } } - @Override - public String[] getTelephonyPackageNames() { - try { - return mPM.getTelephonyPackageNames(); - } catch (RemoteException e) { - throw e.rethrowAsRuntimeException(); - } - } - @Override public String getSystemCaptionsServicePackageName() { try { diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl index 8c3eef27dd580..1e10f08ddde43 100644 --- a/core/java/android/content/pm/IPackageManager.aidl +++ b/core/java/android/content/pm/IPackageManager.aidl @@ -680,8 +680,6 @@ interface IPackageManager { String getWellbeingPackageName(); - String[] getTelephonyPackageNames(); - String getAppPredictionServicePackageName(); String getSystemCaptionsServicePackageName(); diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 7600a08a256c9..3e9ad012db691 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -7748,18 +7748,6 @@ public abstract class PackageManager { "getAppPredictionServicePackageName not implemented in subclass"); } - /** - * @return the system defined telephony package names, or null if there's none. - * - * @hide - */ - @Nullable - @TestApi - public String[] getTelephonyPackageNames() { - throw new UnsupportedOperationException( - "getTelephonyPackageNames not implemented in subclass"); - } - /** * @return the system defined content capture service package name, or null if there's none. * diff --git a/core/java/android/content/pm/PermissionInfo.java b/core/java/android/content/pm/PermissionInfo.java index 3aa1a6d3f8fff..c6c288239d1fc 100644 --- a/core/java/android/content/pm/PermissionInfo.java +++ b/core/java/android/content/pm/PermissionInfo.java @@ -237,17 +237,6 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { @TestApi public static final int PROTECTION_FLAG_APP_PREDICTOR = 0x200000; - /** - * Additional flag for {@link #protectionLevel}, corresponding - * to the telephony value of - * {@link android.R.attr#protectionLevel}. - * - * @hide - */ - @SystemApi - @TestApi - public static final int PROTECTION_FLAG_TELEPHONY = 0x400000; - /** * Additional flag for {@link #protectionLevel}, corresponding * to the companion value of @@ -291,7 +280,6 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { PROTECTION_FLAG_CONFIGURATOR, PROTECTION_FLAG_INCIDENT_REPORT_APPROVER, PROTECTION_FLAG_APP_PREDICTOR, - PROTECTION_FLAG_TELEPHONY, PROTECTION_FLAG_COMPANION, PROTECTION_FLAG_RETAIL_DEMO, }) @@ -537,9 +525,6 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { if ((level & PermissionInfo.PROTECTION_FLAG_APP_PREDICTOR) != 0) { protLevel += "|appPredictor"; } - if ((level & PermissionInfo.PROTECTION_FLAG_TELEPHONY) != 0) { - protLevel += "|telephony"; - } if ((level & PermissionInfo.PROTECTION_FLAG_RETAIL_DEMO) != 0) { protLevel += "|retailDemo"; } diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index a52349226a6f2..ec5159cb7d66b 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -737,7 +737,7 @@ + android:protectionLevel="signature" /> + android:protectionLevel="signature" /> + android:protectionLevel="signature" /> + android:protectionLevel="signature" /> + android:protectionLevel="signature" /> + android:protectionLevel="signature" /> + android:protectionLevel="signature" /> @@ -2673,7 +2673,7 @@ @hide --> + android:protectionLevel="signature" /> + android:protectionLevel="signature" /> + android:protectionLevel="signature" /> + android:protectionLevel="signature" /> + android:protectionLevel="signature" /> + android:protectionLevel="signature" /> + android:protectionLevel="signature" /> - - diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 617949df865ca..48f0ef7c222bf 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -3637,15 +3637,6 @@ --> - - "com.android.phone,com.android.stk,com.android.providers.telephony,com.android.ons" -