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

Commit f4ac063f authored by Winson Chung's avatar Winson Chung
Browse files

Update PiP AppOps flag to enforce all PiP functionality.

- Previously it only enforced whether an app could enter PiP as it was
  hiding.
- Also updating metrics constant name to reflect the change.
- Adding public OPSTR for apps to check if it the user has disabled PiP

Bug: 35957404
Test: android.server.cts.ActivityManagerPinnedStackTests
Change-Id: I979b5c6d4c85946623999ced1cfb197d830ccecb
parent d7bc388f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4165,6 +4165,7 @@ package android.app {
    field public static final java.lang.String OPSTR_MOCK_LOCATION = "android:mock_location";
    field public static final java.lang.String OPSTR_MONITOR_HIGH_POWER_LOCATION = "android:monitor_location_high_power";
    field public static final java.lang.String OPSTR_MONITOR_LOCATION = "android:monitor_location";
    field public static final java.lang.String OPSTR_PICTURE_IN_PICTURE = "android:picture_in_picture";
    field public static final java.lang.String OPSTR_PROCESS_OUTGOING_CALLS = "android:process_outgoing_calls";
    field public static final java.lang.String OPSTR_READ_CALENDAR = "android:read_calendar";
    field public static final java.lang.String OPSTR_READ_CALL_LOG = "android:read_call_log";
@@ -45423,7 +45424,7 @@ package android.view {
    method public void setActivated(boolean);
    method public void setAlpha(float);
    method public void setAnimation(android.view.animation.Animation);
    method public void setAutofillHint(java.lang.String[]);
    method public void setAutofillHint(java.lang.String...);
    method public void setAutofillMode(int);
    method public void setBackground(android.graphics.drawable.Drawable);
    method public void setBackgroundColor(int);
+2 −1
Original line number Diff line number Diff line
@@ -4308,6 +4308,7 @@ package android.app {
    field public static final java.lang.String OPSTR_MOCK_LOCATION = "android:mock_location";
    field public static final java.lang.String OPSTR_MONITOR_HIGH_POWER_LOCATION = "android:monitor_location_high_power";
    field public static final java.lang.String OPSTR_MONITOR_LOCATION = "android:monitor_location";
    field public static final java.lang.String OPSTR_PICTURE_IN_PICTURE = "android:picture_in_picture";
    field public static final java.lang.String OPSTR_PROCESS_OUTGOING_CALLS = "android:process_outgoing_calls";
    field public static final java.lang.String OPSTR_READ_CALENDAR = "android:read_calendar";
    field public static final java.lang.String OPSTR_READ_CALL_LOG = "android:read_call_log";
@@ -48889,7 +48890,7 @@ package android.view {
    method public void setActivated(boolean);
    method public void setAlpha(float);
    method public void setAnimation(android.view.animation.Animation);
    method public void setAutofillHint(java.lang.String[]);
    method public void setAutofillHint(java.lang.String...);
    method public void setAutofillMode(int);
    method public void setBackground(android.graphics.drawable.Drawable);
    method public void setBackgroundColor(int);
+2 −1
Original line number Diff line number Diff line
@@ -4175,6 +4175,7 @@ package android.app {
    field public static final java.lang.String OPSTR_MOCK_LOCATION = "android:mock_location";
    field public static final java.lang.String OPSTR_MONITOR_HIGH_POWER_LOCATION = "android:monitor_location_high_power";
    field public static final java.lang.String OPSTR_MONITOR_LOCATION = "android:monitor_location";
    field public static final java.lang.String OPSTR_PICTURE_IN_PICTURE = "android:picture_in_picture";
    field public static final java.lang.String OPSTR_PROCESS_OUTGOING_CALLS = "android:process_outgoing_calls";
    field public static final java.lang.String OPSTR_READ_CALENDAR = "android:read_calendar";
    field public static final java.lang.String OPSTR_READ_CALL_LOG = "android:read_call_log";
@@ -45786,7 +45787,7 @@ package android.view {
    method public void setActivated(boolean);
    method public void setAlpha(float);
    method public void setAnimation(android.view.animation.Animation);
    method public void setAutofillHint(java.lang.String[]);
    method public void setAutofillHint(java.lang.String...);
    method public void setAutofillMode(int);
    method public void setBackground(android.graphics.drawable.Drawable);
    method public void setBackgroundColor(int);
+10 −7
Original line number Diff line number Diff line
@@ -245,8 +245,8 @@ public class AppOpsManager {
    public static final int OP_READ_PHONE_NUMBER = 65;
    /** @hide Request package installs through package installer */
    public static final int OP_REQUEST_INSTALL_PACKAGES = 66;
    /** @hide Enter picture-in-picture when hidden. */
    public static final int OP_ENTER_PICTURE_IN_PICTURE_ON_HIDE = 67;
    /** @hide Enter picture-in-picture. */
    public static final int OP_PICTURE_IN_PICTURE = 67;
    /** @hide Instant app start foreground service. */
    public static final int OP_INSTANT_APP_START_FOREGROUND = 68;
    /** @hide Answer incoming phone calls */
@@ -355,6 +355,9 @@ public class AppOpsManager {
            = "android:get_accounts";
    public static final String OPSTR_READ_PHONE_NUMBER
            = "android:read_phone_number";
    /** Access to picture-in-picture. */
    public static final String OPSTR_PICTURE_IN_PICTURE
            = "android:picture_in_picture";
    /** @hide */
    public static final String OPSTR_INSTANT_APP_START_FOREGROUND
            = "android:instant_app_start_foreground";
@@ -484,7 +487,7 @@ public class AppOpsManager {
            OP_AUDIO_ACCESSIBILITY_VOLUME,
            OP_READ_PHONE_NUMBER,
            OP_REQUEST_INSTALL_PACKAGES,
            OP_ENTER_PICTURE_IN_PICTURE_ON_HIDE,
            OP_PICTURE_IN_PICTURE,
            OP_INSTANT_APP_START_FOREGROUND,
            OP_ANSWER_PHONE_CALLS
    };
@@ -561,7 +564,7 @@ public class AppOpsManager {
            null, // OP_AUDIO_ACCESSIBILITY_VOLUME
            OPSTR_READ_PHONE_NUMBER,
            null, // OP_REQUEST_INSTALL_PACKAGES
            null,
            OPSTR_PICTURE_IN_PICTURE,
            OPSTR_INSTANT_APP_START_FOREGROUND,
            OPSTR_ANSWER_PHONE_CALLS,
    };
@@ -638,7 +641,7 @@ public class AppOpsManager {
            "AUDIO_ACCESSIBILITY_VOLUME",
            "READ_PHONE_NUMBER",
            "REQUEST_INSTALL_PACKAGES",
            "OP_ENTER_PICTURE_IN_PICTURE_ON_HIDE",
            "PICTURE_IN_PICTURE",
            "INSTANT_APP_START_FOREGROUND",
            "ANSWER_PHONE_CALLS",
    };
@@ -946,7 +949,7 @@ public class AppOpsManager {
            AppOpsManager.MODE_ALLOWED,  // OP_AUDIO_ACCESSIBILITY_VOLUME
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_DEFAULT,  // OP_REQUEST_INSTALL_PACKAGES
            AppOpsManager.MODE_ALLOWED,  // OP_ENTER_PICTURE_IN_PICTURE_ON_HIDE
            AppOpsManager.MODE_ALLOWED,  // OP_PICTURE_IN_PICTURE
            AppOpsManager.MODE_DEFAULT,  // OP_INSTANT_APP_START_FOREGROUND
            AppOpsManager.MODE_ALLOWED, // ANSWER_PHONE_CALLS
    };
@@ -1026,7 +1029,7 @@ public class AppOpsManager {
            false, // OP_AUDIO_ACCESSIBILITY_VOLUME
            false,
            false, // OP_REQUEST_INSTALL_PACKAGES
            false, // OP_ENTER_PICTURE_IN_PICTURE_ON_HIDE
            false, // OP_PICTURE_IN_PICTURE
            false,
            false, // ANSWER_PHONE_CALLS
    };
+4 −4
Original line number Diff line number Diff line
@@ -3339,11 +3339,11 @@ message MetricsEvent {
    // CATEGORY: SETTINGS
    SETTINGS_MANAGE_PICTURE_IN_PICTURE = 812;

    // ACTION: Allow "Enable picture-in-picture on hide" for an app
    APP_PICTURE_IN_PICTURE_ON_HIDE_ALLOW = 813;
    // ACTION: Allow "Enable picture-in-picture" for an app
    APP_PICTURE_IN_PICTURE_ALLOW = 813;

    // ACTION: Deny "Enable picture-in-picture on hide" for an app
    APP_PICTURE_IN_PICTURE_ON_HIDE_DENY = 814;
    // ACTION: Deny "Enable picture-in-picture" for an app
    APP_PICTURE_IN_PICTURE_DENY = 814;

    // OPEN: Settings > Language & input > Text-to-speech output -> Speech rate & pitch
    // CATEGORY: SETTINGS
Loading