Loading api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2178,6 +2178,7 @@ package android.content.pm { public class PermissionInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable { field public static final int FLAG_REMOVED = 2; // 0x2 field public static final int PROTECTION_FLAG_APP_PREDICTOR = 2097152; // 0x200000 field public static final int PROTECTION_FLAG_COMPANION = 8388608; // 0x800000 field public static final int PROTECTION_FLAG_CONFIGURATOR = 524288; // 0x80000 field public static final int PROTECTION_FLAG_DOCUMENTER = 262144; // 0x40000 field public static final int PROTECTION_FLAG_INCIDENT_REPORT_APPROVER = 1048576; // 0x100000 Loading api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -813,6 +813,7 @@ package android.content.pm { public class PermissionInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable { field public static final int FLAG_REMOVED = 2; // 0x2 field public static final int PROTECTION_FLAG_APP_PREDICTOR = 2097152; // 0x200000 field public static final int PROTECTION_FLAG_COMPANION = 8388608; // 0x800000 field public static final int PROTECTION_FLAG_CONFIGURATOR = 524288; // 0x80000 field public static final int PROTECTION_FLAG_DOCUMENTER = 262144; // 0x40000 field public static final int PROTECTION_FLAG_INCIDENT_REPORT_APPROVER = 1048576; // 0x100000 Loading core/java/android/content/pm/PermissionInfo.java +12 −0 Original line number Diff line number Diff line Loading @@ -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 <code>companion</code> value of * {@link android.R.attr#protectionLevel}. * * @hide */ @SystemApi @TestApi public static final int PROTECTION_FLAG_COMPANION = 0x800000; /** @hide */ @IntDef(flag = true, prefix = { "PROTECTION_FLAG_" }, value = { PROTECTION_FLAG_PRIVILEGED, Loading @@ -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_COMPANION, }) @Retention(RetentionPolicy.SOURCE) public @interface ProtectionFlags {} Loading core/java/com/android/internal/util/ArrayUtils.java +43 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,13 @@ public class ArrayUtils { return (T[]) cache; } /** * Returns the same array or an empty one if it's null. */ public static @NonNull <T> T[] emptyIfNull(@Nullable T[] items, Class<T> kind) { return items != null ? items : emptyArray(kind); } /** * Checks if given array is null or has zero elements. */ Loading Loading @@ -751,6 +758,42 @@ public class ArrayUtils { return result; } /** * Returns an array containing elements from the given one that match the given predicate. */ public static @Nullable <T> T[] filter(@Nullable T[] items, @NonNull IntFunction<T[]> arrayConstructor, @NonNull java.util.function.Predicate<T> predicate) { if (isEmpty(items)) { return items; } int matchesCount = 0; int size = size(items); for (int i = 0; i < size; i++) { if (predicate.test(items[i])) { matchesCount++; } } if (matchesCount == 0) { return items; } if (matchesCount == items.length) { return items; } if (matchesCount == 0) { return null; } T[] result = arrayConstructor.apply(matchesCount); int outIdx = 0; for (int i = 0; i < size; i++) { if (predicate.test(items[i])) { result[outIdx++] = items[i]; } } return result; } public static boolean startsWith(byte[] cur, byte[] val) { if (cur == null || val == null) return false; if (cur.length < val.length) return false; Loading core/res/AndroidManifest.xml +8 −0 Original line number Diff line number Diff line Loading @@ -1629,6 +1629,14 @@ <permission android:name="android.permission.NETWORK_SETTINGS" android:protectionLevel="signature|telephony" /> <!-- Allows holder to request bluetooth/wifi scan bypassing global "use location" setting and location permissions. <p>Not for use by third-party or privileged applications. @hide --> <permission android:name="android.permission.RADIO_SCAN_WITHOUT_LOCATION" android:protectionLevel="signature|companion" /> <!-- Allows SetupWizard to call methods in Networking services <p>Not for use by any other third-party or privileged applications. @SystemApi Loading Loading
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2178,6 +2178,7 @@ package android.content.pm { public class PermissionInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable { field public static final int FLAG_REMOVED = 2; // 0x2 field public static final int PROTECTION_FLAG_APP_PREDICTOR = 2097152; // 0x200000 field public static final int PROTECTION_FLAG_COMPANION = 8388608; // 0x800000 field public static final int PROTECTION_FLAG_CONFIGURATOR = 524288; // 0x80000 field public static final int PROTECTION_FLAG_DOCUMENTER = 262144; // 0x40000 field public static final int PROTECTION_FLAG_INCIDENT_REPORT_APPROVER = 1048576; // 0x100000 Loading
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -813,6 +813,7 @@ package android.content.pm { public class PermissionInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable { field public static final int FLAG_REMOVED = 2; // 0x2 field public static final int PROTECTION_FLAG_APP_PREDICTOR = 2097152; // 0x200000 field public static final int PROTECTION_FLAG_COMPANION = 8388608; // 0x800000 field public static final int PROTECTION_FLAG_CONFIGURATOR = 524288; // 0x80000 field public static final int PROTECTION_FLAG_DOCUMENTER = 262144; // 0x40000 field public static final int PROTECTION_FLAG_INCIDENT_REPORT_APPROVER = 1048576; // 0x100000 Loading
core/java/android/content/pm/PermissionInfo.java +12 −0 Original line number Diff line number Diff line Loading @@ -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 <code>companion</code> value of * {@link android.R.attr#protectionLevel}. * * @hide */ @SystemApi @TestApi public static final int PROTECTION_FLAG_COMPANION = 0x800000; /** @hide */ @IntDef(flag = true, prefix = { "PROTECTION_FLAG_" }, value = { PROTECTION_FLAG_PRIVILEGED, Loading @@ -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_COMPANION, }) @Retention(RetentionPolicy.SOURCE) public @interface ProtectionFlags {} Loading
core/java/com/android/internal/util/ArrayUtils.java +43 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,13 @@ public class ArrayUtils { return (T[]) cache; } /** * Returns the same array or an empty one if it's null. */ public static @NonNull <T> T[] emptyIfNull(@Nullable T[] items, Class<T> kind) { return items != null ? items : emptyArray(kind); } /** * Checks if given array is null or has zero elements. */ Loading Loading @@ -751,6 +758,42 @@ public class ArrayUtils { return result; } /** * Returns an array containing elements from the given one that match the given predicate. */ public static @Nullable <T> T[] filter(@Nullable T[] items, @NonNull IntFunction<T[]> arrayConstructor, @NonNull java.util.function.Predicate<T> predicate) { if (isEmpty(items)) { return items; } int matchesCount = 0; int size = size(items); for (int i = 0; i < size; i++) { if (predicate.test(items[i])) { matchesCount++; } } if (matchesCount == 0) { return items; } if (matchesCount == items.length) { return items; } if (matchesCount == 0) { return null; } T[] result = arrayConstructor.apply(matchesCount); int outIdx = 0; for (int i = 0; i < size; i++) { if (predicate.test(items[i])) { result[outIdx++] = items[i]; } } return result; } public static boolean startsWith(byte[] cur, byte[] val) { if (cur == null || val == null) return false; if (cur.length < val.length) return false; Loading
core/res/AndroidManifest.xml +8 −0 Original line number Diff line number Diff line Loading @@ -1629,6 +1629,14 @@ <permission android:name="android.permission.NETWORK_SETTINGS" android:protectionLevel="signature|telephony" /> <!-- Allows holder to request bluetooth/wifi scan bypassing global "use location" setting and location permissions. <p>Not for use by third-party or privileged applications. @hide --> <permission android:name="android.permission.RADIO_SCAN_WITHOUT_LOCATION" android:protectionLevel="signature|companion" /> <!-- Allows SetupWizard to call methods in Networking services <p>Not for use by any other third-party or privileged applications. @SystemApi Loading