Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 768cddd9 authored by Evan Severson's avatar Evan Severson Committed by Android (Google) Code Review
Browse files

Merge changes from topics "remove_bg_mic_cam_public", "remove_role_exempt" into sc-dev

* changes:
  Remove role exempt flag
  Remove background microphone and camera from public api
parents edc573f0 c5d33bfd
Loading
Loading
Loading
Loading
+0 −4
Original line number Original line Diff line number Diff line
@@ -21,7 +21,6 @@ package android {
    field public static final String ACTIVITY_RECOGNITION = "android.permission.ACTIVITY_RECOGNITION";
    field public static final String ACTIVITY_RECOGNITION = "android.permission.ACTIVITY_RECOGNITION";
    field public static final String ADD_VOICEMAIL = "com.android.voicemail.permission.ADD_VOICEMAIL";
    field public static final String ADD_VOICEMAIL = "com.android.voicemail.permission.ADD_VOICEMAIL";
    field public static final String ANSWER_PHONE_CALLS = "android.permission.ANSWER_PHONE_CALLS";
    field public static final String ANSWER_PHONE_CALLS = "android.permission.ANSWER_PHONE_CALLS";
    field public static final String BACKGROUND_CAMERA = "android.permission.BACKGROUND_CAMERA";
    field public static final String BATTERY_STATS = "android.permission.BATTERY_STATS";
    field public static final String BATTERY_STATS = "android.permission.BATTERY_STATS";
    field public static final String BIND_ACCESSIBILITY_SERVICE = "android.permission.BIND_ACCESSIBILITY_SERVICE";
    field public static final String BIND_ACCESSIBILITY_SERVICE = "android.permission.BIND_ACCESSIBILITY_SERVICE";
    field public static final String BIND_APPWIDGET = "android.permission.BIND_APPWIDGET";
    field public static final String BIND_APPWIDGET = "android.permission.BIND_APPWIDGET";
@@ -134,7 +133,6 @@ package android {
    field public static final String RECEIVE_SMS = "android.permission.RECEIVE_SMS";
    field public static final String RECEIVE_SMS = "android.permission.RECEIVE_SMS";
    field public static final String RECEIVE_WAP_PUSH = "android.permission.RECEIVE_WAP_PUSH";
    field public static final String RECEIVE_WAP_PUSH = "android.permission.RECEIVE_WAP_PUSH";
    field public static final String RECORD_AUDIO = "android.permission.RECORD_AUDIO";
    field public static final String RECORD_AUDIO = "android.permission.RECORD_AUDIO";
    field public static final String RECORD_BACKGROUND_AUDIO = "android.permission.RECORD_BACKGROUND_AUDIO";
    field public static final String REORDER_TASKS = "android.permission.REORDER_TASKS";
    field public static final String REORDER_TASKS = "android.permission.REORDER_TASKS";
    field public static final String REQUEST_COMPANION_PROFILE_WATCH = "android.permission.REQUEST_COMPANION_PROFILE_WATCH";
    field public static final String REQUEST_COMPANION_PROFILE_WATCH = "android.permission.REQUEST_COMPANION_PROFILE_WATCH";
    field public static final String REQUEST_COMPANION_RUN_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND";
    field public static final String REQUEST_COMPANION_RUN_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND";
@@ -12563,7 +12561,6 @@ package android.content.pm {
    field public static final String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct";
    field public static final String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct";
    field public static final String FEATURE_WIFI_PASSPOINT = "android.hardware.wifi.passpoint";
    field public static final String FEATURE_WIFI_PASSPOINT = "android.hardware.wifi.passpoint";
    field public static final String FEATURE_WIFI_RTT = "android.hardware.wifi.rtt";
    field public static final String FEATURE_WIFI_RTT = "android.hardware.wifi.rtt";
    field public static final int FLAG_PERMISSION_ALLOWLIST_ROLE = 8; // 0x8
    field public static final int FLAG_PERMISSION_WHITELIST_INSTALLER = 2; // 0x2
    field public static final int FLAG_PERMISSION_WHITELIST_INSTALLER = 2; // 0x2
    field public static final int FLAG_PERMISSION_WHITELIST_SYSTEM = 1; // 0x1
    field public static final int FLAG_PERMISSION_WHITELIST_SYSTEM = 1; // 0x1
    field public static final int FLAG_PERMISSION_WHITELIST_UPGRADE = 4; // 0x4
    field public static final int FLAG_PERMISSION_WHITELIST_UPGRADE = 4; // 0x4
@@ -12702,7 +12699,6 @@ package android.content.pm {
    field public static final int FLAG_HARD_RESTRICTED = 4; // 0x4
    field public static final int FLAG_HARD_RESTRICTED = 4; // 0x4
    field public static final int FLAG_IMMUTABLY_RESTRICTED = 16; // 0x10
    field public static final int FLAG_IMMUTABLY_RESTRICTED = 16; // 0x10
    field public static final int FLAG_INSTALLED = 1073741824; // 0x40000000
    field public static final int FLAG_INSTALLED = 1073741824; // 0x40000000
    field public static final int FLAG_INSTALLER_EXEMPT_IGNORED = 32; // 0x20
    field public static final int FLAG_SOFT_RESTRICTED = 8; // 0x8
    field public static final int FLAG_SOFT_RESTRICTED = 8; // 0x8
    field public static final int PROTECTION_DANGEROUS = 1; // 0x1
    field public static final int PROTECTION_DANGEROUS = 1; // 0x1
    field public static final int PROTECTION_FLAG_APPOP = 64; // 0x40
    field public static final int PROTECTION_FLAG_APPOP = 64; // 0x40
+2 −1
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@ package android {
    field public static final String ALLOW_ANY_CODEC_FOR_PLAYBACK = "android.permission.ALLOW_ANY_CODEC_FOR_PLAYBACK";
    field public static final String ALLOW_ANY_CODEC_FOR_PLAYBACK = "android.permission.ALLOW_ANY_CODEC_FOR_PLAYBACK";
    field public static final String AMBIENT_WALLPAPER = "android.permission.AMBIENT_WALLPAPER";
    field public static final String AMBIENT_WALLPAPER = "android.permission.AMBIENT_WALLPAPER";
    field public static final String APPROVE_INCIDENT_REPORTS = "android.permission.APPROVE_INCIDENT_REPORTS";
    field public static final String APPROVE_INCIDENT_REPORTS = "android.permission.APPROVE_INCIDENT_REPORTS";
    field public static final String BACKGROUND_CAMERA = "android.permission.BACKGROUND_CAMERA";
    field public static final String BACKUP = "android.permission.BACKUP";
    field public static final String BACKUP = "android.permission.BACKUP";
    field public static final String BATTERY_PREDICTION = "android.permission.BATTERY_PREDICTION";
    field public static final String BATTERY_PREDICTION = "android.permission.BATTERY_PREDICTION";
    field public static final String BIND_ATTENTION_SERVICE = "android.permission.BIND_ATTENTION_SERVICE";
    field public static final String BIND_ATTENTION_SERVICE = "android.permission.BIND_ATTENTION_SERVICE";
@@ -215,6 +216,7 @@ package android {
    field public static final String RECEIVE_DEVICE_CUSTOMIZATION_READY = "android.permission.RECEIVE_DEVICE_CUSTOMIZATION_READY";
    field public static final String RECEIVE_DEVICE_CUSTOMIZATION_READY = "android.permission.RECEIVE_DEVICE_CUSTOMIZATION_READY";
    field public static final String RECEIVE_EMERGENCY_BROADCAST = "android.permission.RECEIVE_EMERGENCY_BROADCAST";
    field public static final String RECEIVE_EMERGENCY_BROADCAST = "android.permission.RECEIVE_EMERGENCY_BROADCAST";
    field public static final String RECEIVE_WIFI_CREDENTIAL_CHANGE = "android.permission.RECEIVE_WIFI_CREDENTIAL_CHANGE";
    field public static final String RECEIVE_WIFI_CREDENTIAL_CHANGE = "android.permission.RECEIVE_WIFI_CREDENTIAL_CHANGE";
    field public static final String RECORD_BACKGROUND_AUDIO = "android.permission.RECORD_BACKGROUND_AUDIO";
    field public static final String RECOVERY = "android.permission.RECOVERY";
    field public static final String RECOVERY = "android.permission.RECOVERY";
    field public static final String RECOVER_KEYSTORE = "android.permission.RECOVER_KEYSTORE";
    field public static final String RECOVER_KEYSTORE = "android.permission.RECOVER_KEYSTORE";
    field public static final String REGISTER_CALL_PROVIDER = "android.permission.REGISTER_CALL_PROVIDER";
    field public static final String REGISTER_CALL_PROVIDER = "android.permission.REGISTER_CALL_PROVIDER";
@@ -2570,7 +2572,6 @@ package android.content.pm {
    field public static final int FLAG_PERMISSION_ONE_TIME = 65536; // 0x10000
    field public static final int FLAG_PERMISSION_ONE_TIME = 65536; // 0x10000
    field public static final int FLAG_PERMISSION_POLICY_FIXED = 4; // 0x4
    field public static final int FLAG_PERMISSION_POLICY_FIXED = 4; // 0x4
    field public static final int FLAG_PERMISSION_RESTRICTION_INSTALLER_EXEMPT = 2048; // 0x800
    field public static final int FLAG_PERMISSION_RESTRICTION_INSTALLER_EXEMPT = 2048; // 0x800
    field public static final int FLAG_PERMISSION_RESTRICTION_ROLE_EXEMPT = 262144; // 0x40000
    field public static final int FLAG_PERMISSION_RESTRICTION_SYSTEM_EXEMPT = 4096; // 0x1000
    field public static final int FLAG_PERMISSION_RESTRICTION_SYSTEM_EXEMPT = 4096; // 0x1000
    field public static final int FLAG_PERMISSION_RESTRICTION_UPGRADE_EXEMPT = 8192; // 0x2000
    field public static final int FLAG_PERMISSION_RESTRICTION_UPGRADE_EXEMPT = 8192; // 0x2000
    field public static final int FLAG_PERMISSION_REVIEW_REQUIRED = 64; // 0x40
    field public static final int FLAG_PERMISSION_REVIEW_REQUIRED = 64; // 0x40
+2 −0
Original line number Original line Diff line number Diff line
@@ -5,6 +5,7 @@ package android {
    field public static final String ACCESS_NOTIFICATIONS = "android.permission.ACCESS_NOTIFICATIONS";
    field public static final String ACCESS_NOTIFICATIONS = "android.permission.ACCESS_NOTIFICATIONS";
    field public static final String ACTIVITY_EMBEDDING = "android.permission.ACTIVITY_EMBEDDING";
    field public static final String ACTIVITY_EMBEDDING = "android.permission.ACTIVITY_EMBEDDING";
    field public static final String APPROVE_INCIDENT_REPORTS = "android.permission.APPROVE_INCIDENT_REPORTS";
    field public static final String APPROVE_INCIDENT_REPORTS = "android.permission.APPROVE_INCIDENT_REPORTS";
    field public static final String BACKGROUND_CAMERA = "android.permission.BACKGROUND_CAMERA";
    field public static final String BIND_CELL_BROADCAST_SERVICE = "android.permission.BIND_CELL_BROADCAST_SERVICE";
    field public static final String BIND_CELL_BROADCAST_SERVICE = "android.permission.BIND_CELL_BROADCAST_SERVICE";
    field public static final String BRIGHTNESS_SLIDER_USAGE = "android.permission.BRIGHTNESS_SLIDER_USAGE";
    field public static final String BRIGHTNESS_SLIDER_USAGE = "android.permission.BRIGHTNESS_SLIDER_USAGE";
    field public static final String BROADCAST_CLOSE_SYSTEM_DIALOGS = "android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS";
    field public static final String BROADCAST_CLOSE_SYSTEM_DIALOGS = "android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS";
@@ -30,6 +31,7 @@ package android {
    field public static final String QUERY_USERS = "android.permission.QUERY_USERS";
    field public static final String QUERY_USERS = "android.permission.QUERY_USERS";
    field public static final String READ_CELL_BROADCASTS = "android.permission.READ_CELL_BROADCASTS";
    field public static final String READ_CELL_BROADCASTS = "android.permission.READ_CELL_BROADCASTS";
    field public static final String READ_PRIVILEGED_PHONE_STATE = "android.permission.READ_PRIVILEGED_PHONE_STATE";
    field public static final String READ_PRIVILEGED_PHONE_STATE = "android.permission.READ_PRIVILEGED_PHONE_STATE";
    field public static final String RECORD_BACKGROUND_AUDIO = "android.permission.RECORD_BACKGROUND_AUDIO";
    field public static final String REMOVE_TASKS = "android.permission.REMOVE_TASKS";
    field public static final String REMOVE_TASKS = "android.permission.REMOVE_TASKS";
    field public static final String RESET_APP_ERRORS = "android.permission.RESET_APP_ERRORS";
    field public static final String RESET_APP_ERRORS = "android.permission.RESET_APP_ERRORS";
    field public static final String START_TASKS_FROM_RECENTS = "android.permission.START_TASKS_FROM_RECENTS";
    field public static final String START_TASKS_FROM_RECENTS = "android.permission.START_TASKS_FROM_RECENTS";
+2 −33
Original line number Original line Diff line number Diff line
@@ -4074,16 +4074,6 @@ public abstract class PackageManager {
    @SystemApi
    @SystemApi
    public static final int FLAG_PERMISSION_AUTO_REVOKED = 1 << 17;
    public static final int FLAG_PERMISSION_AUTO_REVOKED = 1 << 17;


    /**
     * Permission flag: The permission is restricted but the app is exempt
     * from the restriction and is allowed to hold this permission in its
     * full form and the exemption is provided by the held roles.
     *
     * @hide
     */
    @SystemApi
    public static final int FLAG_PERMISSION_RESTRICTION_ROLE_EXEMPT =  1 << 18;

    /**
    /**
     * Permission flag: This location permission is selected as the level of granularity of
     * Permission flag: This location permission is selected as the level of granularity of
     * location accuracy.
     * location accuracy.
@@ -4113,8 +4103,7 @@ public abstract class PackageManager {
    public static final int FLAGS_PERMISSION_RESTRICTION_ANY_EXEMPT =
    public static final int FLAGS_PERMISSION_RESTRICTION_ANY_EXEMPT =
            FLAG_PERMISSION_RESTRICTION_INSTALLER_EXEMPT
            FLAG_PERMISSION_RESTRICTION_INSTALLER_EXEMPT
                    | FLAG_PERMISSION_RESTRICTION_SYSTEM_EXEMPT
                    | FLAG_PERMISSION_RESTRICTION_SYSTEM_EXEMPT
                    | FLAG_PERMISSION_RESTRICTION_UPGRADE_EXEMPT
                    | FLAG_PERMISSION_RESTRICTION_UPGRADE_EXEMPT;
                    | FLAG_PERMISSION_RESTRICTION_ROLE_EXEMPT;


    /**
    /**
     * Mask for all permission flags.
     * Mask for all permission flags.
@@ -4199,20 +4188,11 @@ public abstract class PackageManager {
     */
     */
    public static final int FLAG_PERMISSION_WHITELIST_UPGRADE = 1 << 2;
    public static final int FLAG_PERMISSION_WHITELIST_UPGRADE = 1 << 2;


    /**
     * Permission allowlist flag: permissions exempted by the system
     * when being granted a role.
     * Permissions can also be exempted by the installer, the system, or on
     * upgrade.
     */
    public static final int FLAG_PERMISSION_ALLOWLIST_ROLE = 1 << 3;

    /** @hide */
    /** @hide */
    @IntDef(flag = true, prefix = {"FLAG_PERMISSION_WHITELIST_"}, value = {
    @IntDef(flag = true, prefix = {"FLAG_PERMISSION_WHITELIST_"}, value = {
            FLAG_PERMISSION_WHITELIST_SYSTEM,
            FLAG_PERMISSION_WHITELIST_SYSTEM,
            FLAG_PERMISSION_WHITELIST_INSTALLER,
            FLAG_PERMISSION_WHITELIST_INSTALLER,
            FLAG_PERMISSION_WHITELIST_UPGRADE,
            FLAG_PERMISSION_WHITELIST_UPGRADE
            FLAG_PERMISSION_ALLOWLIST_ROLE
    })
    })
    @Retention(RetentionPolicy.SOURCE)
    @Retention(RetentionPolicy.SOURCE)
    public @interface PermissionWhitelistFlags {}
    public @interface PermissionWhitelistFlags {}
@@ -5244,10 +5224,6 @@ public abstract class PackageManager {
     * This list corresponds to the {@link #FLAG_PERMISSION_WHITELIST_INSTALLER} flag.
     * This list corresponds to the {@link #FLAG_PERMISSION_WHITELIST_INSTALLER} flag.
     * Can be accessed by pre-installed holders of a dedicated permission or the
     * Can be accessed by pre-installed holders of a dedicated permission or the
     * installer on record.
     * installer on record.
     *
     * <li>one for cases where the system exempts the permission when granting a role.
     * This list corresponds to the {@link #FLAG_PERMISSION_ALLOWLIST_ROLE} flag. Can
     * be accessed by pre-installed holders of a dedicated permission.
     * </ol>
     * </ol>
     *
     *
     * <p>
     * <p>
@@ -5266,7 +5242,6 @@ public abstract class PackageManager {
     * @see #FLAG_PERMISSION_WHITELIST_SYSTEM
     * @see #FLAG_PERMISSION_WHITELIST_SYSTEM
     * @see #FLAG_PERMISSION_WHITELIST_UPGRADE
     * @see #FLAG_PERMISSION_WHITELIST_UPGRADE
     * @see #FLAG_PERMISSION_WHITELIST_INSTALLER
     * @see #FLAG_PERMISSION_WHITELIST_INSTALLER
     * @see #FLAG_PERMISSION_ALLOWLIST_ROLE
     *
     *
     * @throws SecurityException if you try to access a whitelist that you have no access to.
     * @throws SecurityException if you try to access a whitelist that you have no access to.
     */
     */
@@ -5306,10 +5281,6 @@ public abstract class PackageManager {
     * This list corresponds to the {@link #FLAG_PERMISSION_WHITELIST_INSTALLER} flag.
     * This list corresponds to the {@link #FLAG_PERMISSION_WHITELIST_INSTALLER} flag.
     * Can be modified by pre-installed holders of a dedicated permission or the installer
     * Can be modified by pre-installed holders of a dedicated permission or the installer
     * on record.
     * on record.
     *
     * <li>one for cases where the system exempts the permission when permission when
     * granting a role. This list corresponds to the {@link #FLAG_PERMISSION_ALLOWLIST_ROLE}
     * flag. Can be modified by pre-installed holders of a dedicated permission.
     * </ol>
     * </ol>
     *
     *
     * <p>You need to specify the whitelists for which to set the whitelisted permissions
     * <p>You need to specify the whitelists for which to set the whitelisted permissions
@@ -5333,7 +5304,6 @@ public abstract class PackageManager {
     * @see #FLAG_PERMISSION_WHITELIST_SYSTEM
     * @see #FLAG_PERMISSION_WHITELIST_SYSTEM
     * @see #FLAG_PERMISSION_WHITELIST_UPGRADE
     * @see #FLAG_PERMISSION_WHITELIST_UPGRADE
     * @see #FLAG_PERMISSION_WHITELIST_INSTALLER
     * @see #FLAG_PERMISSION_WHITELIST_INSTALLER
     * @see #FLAG_PERMISSION_ALLOWLIST_ROLE
     *
     *
     * @throws SecurityException if you try to modify a whitelist that you have no access to.
     * @throws SecurityException if you try to modify a whitelist that you have no access to.
     */
     */
@@ -5403,7 +5373,6 @@ public abstract class PackageManager {
     * @see #FLAG_PERMISSION_WHITELIST_SYSTEM
     * @see #FLAG_PERMISSION_WHITELIST_SYSTEM
     * @see #FLAG_PERMISSION_WHITELIST_UPGRADE
     * @see #FLAG_PERMISSION_WHITELIST_UPGRADE
     * @see #FLAG_PERMISSION_WHITELIST_INSTALLER
     * @see #FLAG_PERMISSION_WHITELIST_INSTALLER
     * @see #FLAG_PERMISSION_ALLOWLIST_ROLE
     *
     *
     * @throws SecurityException if you try to modify a whitelist that you have no access to.
     * @throws SecurityException if you try to modify a whitelist that you have no access to.
     */
     */
+0 −13
Original line number Original line Diff line number Diff line
@@ -410,14 +410,6 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
     */
     */
    public static final int FLAG_IMMUTABLY_RESTRICTED = 1<<4;
    public static final int FLAG_IMMUTABLY_RESTRICTED = 1<<4;


    /**
     * Flag for {@link #flags}, corresponding to <code>installerExemptIgnored</code>
     * value of {@link android.R.attr#permissionFlags}.
     *
     * <p> Modifier for permission restriction. This permission cannot be exempted by the installer.
     */
    public static final int FLAG_INSTALLER_EXEMPT_IGNORED = 1 << 5;

    /**
    /**
     * Flag for {@link #flags}, indicating that this permission has been
     * Flag for {@link #flags}, indicating that this permission has been
     * installed into the system's globally defined permissions.
     * installed into the system's globally defined permissions.
@@ -723,11 +715,6 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
        return isHardRestricted() || isSoftRestricted();
        return isHardRestricted() || isSoftRestricted();
    }
    }


    /** @hide */
    public boolean isInstallerExemptIgnored() {
        return (flags & PermissionInfo.FLAG_INSTALLER_EXEMPT_IGNORED) != 0;
    }

    /** @hide */
    /** @hide */
    public boolean isAppOp() {
    public boolean isAppOp() {
        return (protectionLevel & PermissionInfo.PROTECTION_FLAG_APPOP) != 0;
        return (protectionLevel & PermissionInfo.PROTECTION_FLAG_APPOP) != 0;
Loading