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

Commit 83fbf240 authored by Iavor-Valentin Iftime's avatar Iavor-Valentin Iftime Committed by Android (Google) Code Review
Browse files

Merge "Add RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO AppOp"

parents 1ff67245 8f7ee077
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -587,6 +587,7 @@ package android.app {
    field public static final String OPSTR_READ_MEDIA_VIDEO = "android:read_media_video";
    field public static final String OPSTR_RECEIVE_AMBIENT_TRIGGER_AUDIO = "android:receive_ambient_trigger_audio";
    field public static final String OPSTR_RECEIVE_EMERGENCY_BROADCAST = "android:receive_emergency_broadcast";
    field public static final String OPSTR_RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO = "android:receive_explicit_user_interaction_audio";
    field public static final String OPSTR_REQUEST_DELETE_PACKAGES = "android:request_delete_packages";
    field public static final String OPSTR_REQUEST_INSTALL_PACKAGES = "android:request_install_packages";
    field public static final String OPSTR_RUN_ANY_IN_BACKGROUND = "android:run_any_in_background";
+29 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
@@ -1342,9 +1343,19 @@ public class AppOpsManager {
    public static final int OP_RECEIVE_AMBIENT_TRIGGER_AUDIO =
            AppProtoEnums.APP_OP_RECEIVE_AMBIENT_TRIGGER_AUDIO;

     /**
      * Receive audio from near-field mic (ie. TV remote)
      * Allows audio recording regardless of sensor privacy state,
      *  as it is an intentional user interaction: hold-to-talk
      *
      * @hide
      */
    public static final int OP_RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO =
            AppProtoEnums.APP_OP_RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO;

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

    /** Access to coarse location information. */
    public static final String OPSTR_COARSE_LOCATION = "android:coarse_location";
@@ -1816,6 +1827,18 @@ public class AppOpsManager {
    public static final String OPSTR_RECEIVE_AMBIENT_TRIGGER_AUDIO =
            "android:receive_ambient_trigger_audio";

    /**
     * Record audio from near-field microphone (ie. TV remote)
     * Allows audio recording regardless of sensor privacy state,
     *  as it is an intentional user interaction: hold-to-talk
     *
     * @hide
     */
    @SystemApi
    @SuppressLint("IntentName")
    public static final String OPSTR_RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO =
            "android:receive_explicit_user_interaction_audio";

    /** {@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} */
@@ -2285,7 +2308,11 @@ public class AppOpsManager {
            .setDisableReset(true).setRestrictRead(true).build(),
        new AppOpInfo.Builder(OP_RECEIVE_AMBIENT_TRIGGER_AUDIO, OPSTR_RECEIVE_AMBIENT_TRIGGER_AUDIO,
                "RECEIVE_SOUNDTRIGGER_AUDIO").setDefaultMode(AppOpsManager.MODE_ALLOWED)
                .setForceCollectNotes(true).build()
                .setForceCollectNotes(true).build(),
        new AppOpInfo.Builder(OP_RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO,
                OPSTR_RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO,
                "RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO").setDefaultMode(
                AppOpsManager.MODE_ALLOWED).build()
    };

    /**
+12 −0
Original line number Diff line number Diff line
@@ -16043,6 +16043,18 @@ public final class Settings {
        public static final String KEY_CHORD_POWER_VOLUME_UP =
                "key_chord_power_volume_up";
        /**
         * Record audio from near-field microphone (ie. TV remote)
         * Allows audio recording regardless of sensor privacy state,
         * as it is an intentional user interaction: hold-to-talk
         *
         * Type: int (0 to disable, 1 to enable)
         *
         * @hide
         */
        public static final String RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO_ENABLED =
                "receive_explicit_user_interaction_audio_enabled";
        /**
         * Keyguard should be on the left hand side of the screen, for wide screen layouts.
         *
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ public class GlobalSettings {
        Settings.Global.USER_PREFERRED_RESOLUTION_HEIGHT,
        Settings.Global.USER_PREFERRED_RESOLUTION_WIDTH,
        Settings.Global.POWER_BUTTON_LONG_PRESS,
        Settings.Global.RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO_ENABLED,
        Settings.Global.Wearable.SMART_REPLIES_ENABLED,
        Settings.Global.Wearable.CLOCKWORK_AUTO_TIME,
        Settings.Global.Wearable.CLOCKWORK_AUTO_TIME_ZONE,
+2 −0
Original line number Diff line number Diff line
@@ -329,6 +329,8 @@ public class GlobalSettingsValidators {
        VALIDATORS.put(Global.USER_PREFERRED_REFRESH_RATE, NON_NEGATIVE_FLOAT_VALIDATOR);
        VALIDATORS.put(Global.USER_PREFERRED_RESOLUTION_HEIGHT, ANY_INTEGER_VALIDATOR);
        VALIDATORS.put(Global.USER_PREFERRED_RESOLUTION_WIDTH, ANY_INTEGER_VALIDATOR);
        VALIDATORS.put(Global.RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO_ENABLED,
                       new DiscreteValueValidator(new String[]{"0", "1"}));
        VALIDATORS.put(Global.Wearable.WET_MODE_ON, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Global.Wearable.COOLDOWN_MODE_ON, BOOLEAN_VALIDATOR);
        VALIDATORS.put(
Loading