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

Commit 712b1cfb authored by Zoey Chen's avatar Zoey Chen Committed by Android (Google) Code Review
Browse files

Merge "[ToA] New AppOp and permission" into main

parents 376a6a6a e2f8849a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -295,6 +295,7 @@ package android {
    field public static final String READ_RUNTIME_PROFILES = "android.permission.READ_RUNTIME_PROFILES";
    field public static final String READ_SAFETY_CENTER_STATUS = "android.permission.READ_SAFETY_CENTER_STATUS";
    field public static final String READ_SEARCH_INDEXABLES = "android.permission.READ_SEARCH_INDEXABLES";
    field @FlaggedApi("android.app.system_terms_of_address_enabled") public static final String READ_SYSTEM_GRAMMATICAL_GENDER = "android.permission.READ_SYSTEM_GRAMMATICAL_GENDER";
    field public static final String READ_SYSTEM_UPDATE_INFO = "android.permission.READ_SYSTEM_UPDATE_INFO";
    field public static final String READ_WALLPAPER_INTERNAL = "android.permission.READ_WALLPAPER_INTERNAL";
    field public static final String READ_WIFI_CREDENTIAL = "android.permission.READ_WIFI_CREDENTIAL";
+21 −1
Original line number Diff line number Diff line
@@ -1540,9 +1540,16 @@ public class AppOpsManager {
    public static final int OP_RAPID_CLEAR_NOTIFICATIONS_BY_LISTENER =
            AppProtoEnums.APP_OP_RAPID_CLEAR_NOTIFICATIONS_BY_LISTENER;

    /**
     * See {@link #OPSTR_READ_SYSTEM_GRAMMATICAL_GENDER}.
     * @hide
     */
    public static final int OP_READ_SYSTEM_GRAMMATICAL_GENDER =
            AppProtoEnums.APP_OP_READ_SYSTEM_GRAMMATICAL_GENDER;

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

    /**
     * All app ops represented as strings.
@@ -2375,6 +2382,14 @@ public class AppOpsManager {
    public static final String OPSTR_RAPID_CLEAR_NOTIFICATIONS_BY_LISTENER =
            "android:rapid_clear_notifications_by_listener";

    /**
     * Allows an application to read the system grammatical gender.
     *
     * @hide
     */
    public static final String OPSTR_READ_SYSTEM_GRAMMATICAL_GENDER =
            "android:read_system_grammatical_gender";

    /** {@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} */
@@ -2486,6 +2501,7 @@ public class AppOpsManager {
            OP_RECEIVE_SANDBOX_TRIGGER_AUDIO,
            OP_RECEIVE_SANDBOXED_DETECTION_TRAINING_DATA,
            OP_MEDIA_ROUTING_CONTROL,
            OP_READ_SYSTEM_GRAMMATICAL_GENDER,
    };

    static final AppOpInfo[] sAppOpInfos = new AppOpInfo[]{
@@ -2938,6 +2954,10 @@ public class AppOpsManager {
                OPSTR_RAPID_CLEAR_NOTIFICATIONS_BY_LISTENER,
                "RAPID_CLEAR_NOTIFICATIONS_BY_LISTENER")
                .setDefaultMode(AppOpsManager.MODE_ALLOWED).build(),
        new AppOpInfo.Builder(OP_READ_SYSTEM_GRAMMATICAL_GENDER,
                OPSTR_READ_SYSTEM_GRAMMATICAL_GENDER, "READ_SYSTEM_GRAMMATICAL_GENDER")
                .setPermission(Manifest.permission.READ_SYSTEM_GRAMMATICAL_GENDER)
                .build(),
    };

    // The number of longs needed to form a full bitmask of app ops
+8 −0
Original line number Diff line number Diff line
@@ -7908,6 +7908,14 @@
    <permission android:name="android.permission.GET_BACKGROUND_INSTALLED_PACKAGES"
        android:protectionLevel="signature|role" />

    <!-- @SystemApi Allows an application to read the system grammatical gender.
         @FlaggedApi("android.app.system_terms_of_address_enabled")
         <p>Protection level: signature|privileged|appop
         @hide
    -->
    <permission android:name="android.permission.READ_SYSTEM_GRAMMATICAL_GENDER"
                android:protectionLevel="signature|privileged|appop"/>

    <!-- Attribution for Geofencing service. -->
    <attribution android:tag="GeofencingService" android:label="@string/geofencing_service"/>
    <!-- Attribution for Country Detector. -->