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

Commit 1e4ea140 authored by Nate Myren's avatar Nate Myren Committed by Android (Google) Code Review
Browse files

Merge "Add OP_ENABLE_MOBILE_DATA_BY_USER" into main

parents c55479c9 b39c0b4e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -415,6 +415,7 @@ java_aconfig_library {
    defaults: ["framework-minus-apex-aconfig-java-defaults"],
    min_sdk_version: "30",
    apex_available: [
        "//apex_available:platform",
        "com.android.permission",
    ],

+1 −0
Original line number Diff line number Diff line
@@ -632,6 +632,7 @@ package android.app {
    field public static final String OPSTR_CAPTURE_CONSENTLESS_BUGREPORT_ON_USERDEBUG_BUILD = "android:capture_consentless_bugreport_on_userdebug_build";
    field public static final String OPSTR_CHANGE_WIFI_STATE = "android:change_wifi_state";
    field @FlaggedApi("android.view.contentprotection.flags.create_accessibility_overlay_app_op_enabled") public static final String OPSTR_CREATE_ACCESSIBILITY_OVERLAY = "android:create_accessibility_overlay";
    field @FlaggedApi("android.permission.flags.op_enable_mobile_data_by_user") public static final String OPSTR_ENABLE_MOBILE_DATA_BY_USER = "android:enable_mobile_data_by_user";
    field public static final String OPSTR_ESTABLISH_VPN_MANAGER = "android:establish_vpn_manager";
    field public static final String OPSTR_ESTABLISH_VPN_SERVICE = "android:establish_vpn_service";
    field public static final String OPSTR_GET_ACCOUNTS = "android:get_accounts";
+19 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.app;

import static android.view.contentprotection.flags.Flags.FLAG_CREATE_ACCESSIBILITY_OVERLAY_APP_OP_ENABLED;
import static android.permission.flags.Flags.FLAG_OP_ENABLE_MOBILE_DATA_BY_USER;

import static java.lang.Long.max;

@@ -1507,6 +1508,12 @@ public class AppOpsManager {
     */
    public static final int OP_CREATE_ACCESSIBILITY_OVERLAY =
            AppProtoEnums.APP_OP_CREATE_ACCESSIBILITY_OVERLAY;
    /**
     * Indicate that the user has enabled or disabled mobile data
     * @hide
     */
    public static final int OP_ENABLE_MOBILE_DATA_BY_USER =
            AppProtoEnums.APP_OP_ENABLE_MOBILE_DATA_BY_USER;

    /**
     * See {@link #OPSTR_MEDIA_ROUTING_CONTROL}.
@@ -1516,7 +1523,7 @@ public class AppOpsManager {

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

    /**
     * All app ops represented as strings.
@@ -1663,6 +1670,7 @@ public class AppOpsManager {
            OPSTR_RECEIVE_SANDBOXED_DETECTION_TRAINING_DATA,
            OPSTR_CREATE_ACCESSIBILITY_OVERLAY,
            OPSTR_MEDIA_ROUTING_CONTROL,
            OPSTR_ENABLE_MOBILE_DATA_BY_USER,
    })
    public @interface AppOpString {}

@@ -2313,6 +2321,14 @@ public class AppOpsManager {
    @FlaggedApi(FLAG_CREATE_ACCESSIBILITY_OVERLAY_APP_OP_ENABLED)
    public static final String OPSTR_CREATE_ACCESSIBILITY_OVERLAY =
            "android:create_accessibility_overlay";
    /**
     * Indicate that the user has enabled or disabled mobile data
     * @hide
     */
    @SystemApi
    @FlaggedApi(FLAG_OP_ENABLE_MOBILE_DATA_BY_USER)
    public static final String OPSTR_ENABLE_MOBILE_DATA_BY_USER =
            "android:enable_mobile_data_by_user";

    /** {@link #sAppOpsToNote} not initialized yet for this op */
    private static final byte SHOULD_COLLECT_NOTE_OP_NOT_INITIALIZED = 0;
@@ -2872,6 +2888,8 @@ public class AppOpsManager {
        new AppOpInfo.Builder(OP_MEDIA_ROUTING_CONTROL, OPSTR_MEDIA_ROUTING_CONTROL,
                "MEDIA_ROUTING_CONTROL")
                .setPermission(Manifest.permission.MEDIA_ROUTING_CONTROL).build(),
        new AppOpInfo.Builder(OP_ENABLE_MOBILE_DATA_BY_USER, OPSTR_ENABLE_MOBILE_DATA_BY_USER,
                "ENABLE_MOBILE_DATA_BY_USER").setDefaultMode(AppOpsManager.MODE_ALLOWED).build(),
    };

    // The number of longs needed to form a full bitmask of app ops
+7 −0
Original line number Diff line number Diff line
@@ -42,3 +42,10 @@ flag {
  description: "enable AttributionSource(int, int, String, String, IBinder, String[], AttributionSource)"
  bug: "304478648"
}

flag {
  name: "op_enable_mobile_data_by_user"
  namespace: "permissions"
  description: "enables logging of the OP_ENABLE_MOBILE_DATA_BY_USER"
  bug: "222650148"
}
 No newline at end of file