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

Commit ff4e5ca9 authored by Alex Johnston's avatar Alex Johnston Committed by Android (Google) Code Review
Browse files

Merge "Clean up unused system exempt appop"

parents f6d8380e 15be2ee0
Loading
Loading
Loading
Loading
+23 −71
Original line number Diff line number Diff line
@@ -1371,14 +1371,14 @@ public class AppOpsManager {
            AppProtoEnums.APP_OP_READ_MEDIA_VISUAL_USER_SELECTED;

    /**
     * Prevent an app from being placed into app standby buckets.
     * Prevent an app from being suspended.
     *
     * Only to be used by the system.
     *
     * @hide
     */
    public static final int OP_SYSTEM_EXEMPT_FROM_APP_STANDBY =
            AppProtoEnums.APP_OP_SYSTEM_EXEMPT_FROM_APP_STANDBY;
    public static final int OP_SYSTEM_EXEMPT_FROM_SUSPENSION =
            AppProtoEnums.APP_OP_SYSTEM_EXEMPT_FROM_SUSPENSION;

    /**
     * Prevent an app from dismissible notifications. Starting from Android U, notifications with
@@ -1421,16 +1421,14 @@ public class AppOpsManager {
            AppProtoEnums.APP_OP_SYSTEM_EXEMPT_FROM_POWER_RESTRICTIONS;

    /**
     * Exempt from start foreground service from background with while in user permission
     * restriction.
     * Prevent an app from being placed into hibernation.
     *
     * Only to be used by the system.
     *
     * @hide
     */
    public static final int OP_SYSTEM_EXEMPT_FROM_FGS_BG_START_WHILE_IN_USE_PERMISSION_RESTRICTION =
            AppProtoEnums
                    .APP_OP_SYSTEM_EXEMPT_FROM_FGS_BG_START_WHILE_IN_USE_PERMISSION_RESTRICTION;
    public static final int OP_SYSTEM_EXEMPT_FROM_HIBERNATION =
            AppProtoEnums.APP_OP_SYSTEM_EXEMPT_FROM_HIBERNATION;

    /**
     * Allows an application to start an activity while running in the background.
@@ -1462,25 +1460,9 @@ public class AppOpsManager {
     */
    public static final int OP_USE_FULL_SCREEN_INTENT = AppProtoEnums.APP_OP_USE_FULL_SCREEN_INTENT;

    /**
     * Prevent an app from being placed into hibernation.
     *
     * @hide
     */
    public static final int OP_SYSTEM_EXEMPT_FROM_HIBERNATION =
            AppProtoEnums.APP_OP_SYSTEM_EXEMPT_FROM_HIBERNATION;

    /**
     * Prevent an app from being suspended.
     *
     * @hide
     */
    public static final int OP_SYSTEM_EXEMPT_FROM_SUSPENSION =
            AppProtoEnums.APP_OP_SYSTEM_EXEMPT_FROM_SUSPENSION;

    /** @hide */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    public static final int _NUM_OP = 136;
    public static final int _NUM_OP = 134;

    /** Access to coarse location information. */
    public static final String OPSTR_COARSE_LOCATION = "android:coarse_location";
@@ -1989,14 +1971,14 @@ public class AppOpsManager {
    public static final String OPSTR_RUN_USER_INITIATED_JOBS = "android:run_user_initiated_jobs";

    /**
     * Prevent an app from being placed into app standby buckets.
     * Prevent an app from being suspended.
     *
     * Only to be used by the system.
     *
     * @hide
     */
    public static final String OPSTR_SYSTEM_EXEMPT_FROM_APP_STANDBY =
            "android:system_exempt_from_app_standby";
    public static final String OPSTR_SYSTEM_EXEMPT_FROM_SUSPENSION =
            "android:system_exempt_from_suspension";

    /**
     * Allow an application to create non-dismissible notifications. Starting from Android U,
@@ -2032,16 +2014,15 @@ public class AppOpsManager {
            "android:system_exempt_from_power_restrictions";

    /**
     * Exempt from start foreground service from background with while in user permission
     * restriction.
     * Prevent an app from being placed into hibernation.
     *
     * Only to be used by the system.
     *
     * @hide
     */
    public static final String
            OPSTR_SYSTEM_EXEMPT_FROM_FGS_BG_START_WHILE_IN_USE_PERMISSION_RESTRICTION =
            "android:system_exempt_from_fgs_bg_start_while_in_use_permission_restriction";
    @SystemApi
    public static final String OPSTR_SYSTEM_EXEMPT_FROM_HIBERNATION =
            "android:system_exempt_from_hibernation";

    /**
     * Allows an application to start an activity while running in the background.
@@ -2074,27 +2055,6 @@ public class AppOpsManager {
     */
    public static final String OPSTR_USE_FULL_SCREEN_INTENT = "android:use_full_screen_intent";

    /**
     * Prevent an app from being placed into hibernation.
     *
     * Only to be used by the system.
     *
     * @hide
     */
    @SystemApi
    public static final String OPSTR_SYSTEM_EXEMPT_FROM_HIBERNATION =
            "android:system_exempt_from_hibernation";

    /**
     * Prevent an app from being suspended.
     *
     * Only to be used by the system.
     *
     * @hide
     */
    public static final String OPSTR_SYSTEM_EXEMPT_FROM_SUSPENSION =
            "android:system_exempt_from_suspension";

    /** {@link #sAppOpsToNote} not initialized yet for this op */
    private static final byte SHOULD_COLLECT_NOTE_OP_NOT_INITIALIZED = 0;
    /** Should not collect noting of this app-op in {@link #sAppOpsToNote} */
@@ -2582,9 +2542,10 @@ public class AppOpsManager {
                    OPSTR_READ_MEDIA_VISUAL_USER_SELECTED, "READ_MEDIA_VISUAL_USER_SELECTED")
                    .setPermission(Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED)
                    .setDefaultMode(AppOpsManager.MODE_ALLOWED).build(),
        new AppOpInfo.Builder(OP_SYSTEM_EXEMPT_FROM_APP_STANDBY,
                OPSTR_SYSTEM_EXEMPT_FROM_APP_STANDBY,
                "SYSTEM_EXEMPT_FROM_APP_STANDBY").build(),
        new AppOpInfo.Builder(OP_SYSTEM_EXEMPT_FROM_SUSPENSION,
                OPSTR_SYSTEM_EXEMPT_FROM_SUSPENSION,
                "SYSTEM_EXEMPT_FROM_SUSPENSION")
                .setDisableReset(true).build(),
        new AppOpInfo.Builder(OP_SYSTEM_EXEMPT_FROM_DISMISSIBLE_NOTIFICATIONS,
                OPSTR_SYSTEM_EXEMPT_FROM_DISMISSIBLE_NOTIFICATIONS,
                "SYSTEM_EXEMPT_FROM_DISMISSIBLE_NOTIFICATIONS")
@@ -2598,11 +2559,10 @@ public class AppOpsManager {
                OPSTR_SYSTEM_EXEMPT_FROM_POWER_RESTRICTIONS,
                "SYSTEM_EXEMPT_FROM_POWER_RESTRICTIONS")
                .setDisableReset(true).build(),
        new AppOpInfo.Builder(
                OP_SYSTEM_EXEMPT_FROM_FGS_BG_START_WHILE_IN_USE_PERMISSION_RESTRICTION,
                OPSTR_SYSTEM_EXEMPT_FROM_FGS_BG_START_WHILE_IN_USE_PERMISSION_RESTRICTION,
                "SYSTEM_EXEMPT_FROM_FGS_BG_START_WHILE_IN_USE_PERMISSION_RESTRICTION")
                .build(),
        new AppOpInfo.Builder(OP_SYSTEM_EXEMPT_FROM_HIBERNATION,
                OPSTR_SYSTEM_EXEMPT_FROM_HIBERNATION,
                "SYSTEM_EXEMPT_FROM_HIBERNATION")
                .setDisableReset(true).build(),
        new AppOpInfo.Builder(OP_SYSTEM_EXEMPT_FROM_ACTIVITY_BG_START_RESTRICTION,
                OPSTR_SYSTEM_EXEMPT_FROM_ACTIVITY_BG_START_RESTRICTION,
                "SYSTEM_EXEMPT_FROM_ACTIVITY_BG_START_RESTRICTION")
@@ -2620,15 +2580,7 @@ public class AppOpsManager {
                .setDefaultMode(AppOpsManager.MODE_ALLOWED).build(),
        new AppOpInfo.Builder(OP_USE_FULL_SCREEN_INTENT, OPSTR_USE_FULL_SCREEN_INTENT,
                "USE_FULL_SCREEN_INTENT").setPermission(Manifest.permission.USE_FULL_SCREEN_INTENT)
                .build(),
        new AppOpInfo.Builder(OP_SYSTEM_EXEMPT_FROM_HIBERNATION,
                OPSTR_SYSTEM_EXEMPT_FROM_HIBERNATION,
                "SYSTEM_EXEMPT_FROM_HIBERNATION")
                .setDisableReset(true).build(),
        new AppOpInfo.Builder(OP_SYSTEM_EXEMPT_FROM_SUSPENSION,
                OPSTR_SYSTEM_EXEMPT_FROM_SUSPENSION,
                "SYSTEM_EXEMPT_FROM_SUSPENSION")
                .setDisableReset(true).build()
                .build()
    };

    // The number of longs needed to form a full bitmask of app ops