diff --git a/api/system-current.txt b/api/system-current.txt index a0071ad794920..7d3d3e903547d 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -1756,6 +1756,7 @@ package android.content.pm { 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 public static final int PROTECTION_FLAG_WIFI = 8388608; // 0x800000 field @Nullable public final String backgroundPermission; field @StringRes public int requestRes; } diff --git a/api/test-current.txt b/api/test-current.txt index 2ed88adf8d879..0d8808f6558c5 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -773,6 +773,7 @@ package android.content.pm { 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 public static final int PROTECTION_FLAG_WIFI = 8388608; // 0x800000 field @Nullable public final String backgroundPermission; } diff --git a/core/java/android/content/pm/PermissionInfo.java b/core/java/android/content/pm/PermissionInfo.java index c77c53f387e22..aa6f58e82bcf9 100644 --- a/core/java/android/content/pm/PermissionInfo.java +++ b/core/java/android/content/pm/PermissionInfo.java @@ -248,6 +248,17 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { @TestApi public static final int PROTECTION_FLAG_TELEPHONY = 0x400000; + /** + * Additional flag for {@link #protectionLevel}, corresponding + * to the wifi value of + * {@link android.R.attr#protectionLevel}. + * + * @hide + */ + @SystemApi + @TestApi + public static final int PROTECTION_FLAG_WIFI = 0x800000; + /** @hide */ @IntDef(flag = true, prefix = { "PROTECTION_FLAG_" }, value = { PROTECTION_FLAG_PRIVILEGED, @@ -270,6 +281,7 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { PROTECTION_FLAG_INCIDENT_REPORT_APPROVER, PROTECTION_FLAG_APP_PREDICTOR, PROTECTION_FLAG_TELEPHONY, + PROTECTION_FLAG_WIFI, }) @Retention(RetentionPolicy.SOURCE) public @interface ProtectionFlags {} @@ -516,6 +528,9 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable { if ((level & PermissionInfo.PROTECTION_FLAG_TELEPHONY) != 0) { protLevel += "|telephony"; } + if ((level & PermissionInfo.PROTECTION_FLAG_WIFI) != 0) { + protLevel += "|wifi"; + } return protLevel; } diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index b3372a6eea068..5c1e13b27f9d3 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -2955,7 +2955,7 @@ @hide --> + android:protectionLevel="signature|telephony|wifi" /> + + diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 531023fb41bf1..56052464af06e 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -3687,7 +3687,6 @@ --> - "com.android.phone,com.android.stk,com.android.providers.telephony,com.android.ons" + + "com.android.wifi" +