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

Commit d5d0d5cc authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12037182 from bf99a790 to 24Q4-release

Change-Id: I06aa8d322626fe8d1548063273e38d3a9b863c4a
parents ce88fd7b bf99a790
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3524,6 +3524,7 @@ package android.companion.virtual {
    field @Deprecated public static final int NAVIGATION_POLICY_DEFAULT_BLOCKED = 1; // 0x1
    field @FlaggedApi("android.companion.virtual.flags.dynamic_policy") public static final int POLICY_TYPE_ACTIVITY = 3; // 0x3
    field public static final int POLICY_TYPE_AUDIO = 1; // 0x1
    field @FlaggedApi("android.companion.virtualdevice.flags.activity_control_api") public static final int POLICY_TYPE_BLOCKED_ACTIVITY_BEHAVIOR = 6; // 0x6
    field @FlaggedApi("android.companion.virtual.flags.virtual_camera") public static final int POLICY_TYPE_CAMERA = 5; // 0x5
    field @FlaggedApi("android.companion.virtual.flags.cross_device_clipboard") public static final int POLICY_TYPE_CLIPBOARD = 4; // 0x4
    field public static final int POLICY_TYPE_RECENTS = 2; // 0x2
+23 −24
Original line number Diff line number Diff line
@@ -499,32 +499,31 @@ public class NotificationManager {

    /**
     * Activity Action: Launch an Automatic Zen Rule configuration screen
     * <p>
     * Input: Optionally, {@link #EXTRA_AUTOMATIC_RULE_ID}, if the configuration screen for an
     *
     * <p> Input: Optionally, {@link #EXTRA_AUTOMATIC_RULE_ID}, if the configuration screen for an
     * existing rule should be displayed. If the rule id is missing or null, apps should display
     * a configuration screen where users can create a new instance of the rule.
     * <p>
     * Output: Nothing
     * <p>
     *     You can have multiple activities handling this intent, if you support multiple
     *
     * <p> Output: Nothing
     *
     * <p> You can have multiple activities handling this intent, if you support multiple
     * {@link AutomaticZenRule rules}. In order for the system to properly display all of your
     * rule types so that users can create new instances or configure existing ones, you need
     * to add some extra metadata ({@link #META_DATA_AUTOMATIC_RULE_TYPE})
     * to your activity tag in your manifest. If you'd like to limit the number of rules a user
     * can create from this flow, you can additionally optionally include
     *     {@link #META_DATA_RULE_INSTANCE_LIMIT}.
     *
     *     For example,
     *     &lt;meta-data
     *         android:name="android.app.zen.automatic.ruleType"
     *         android:value="@string/my_condition_rule">
     *     &lt;/meta-data>
     *     &lt;meta-data
     *         android:name="android.app.zen.automatic.ruleInstanceLimit"
     *         android:value="1">
     *     &lt;/meta-data>
     * </p>
     * </p>
     * {@link #META_DATA_RULE_INSTANCE_LIMIT}. For example,
     *
     * <pre>
     *     {@code
     *     <meta-data
     *         android:name="android.service.zen.automatic.ruleType"
     *         android:value="@string/my_condition_rule" />
     *     <meta-data
     *         android:name="android.service.zen.automatic.ruleInstanceLimit"
     *         android:value="1" />
     *     }
     * </pre>
     *
     * @see #addAutomaticZenRule(AutomaticZenRule)
     */
+21 −1
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ public final class VirtualDeviceParams implements Parcelable {
     * @hide
     */
    @IntDef(prefix = "POLICY_TYPE_", value = {POLICY_TYPE_RECENTS, POLICY_TYPE_ACTIVITY,
            POLICY_TYPE_CLIPBOARD})
            POLICY_TYPE_CLIPBOARD, POLICY_TYPE_BLOCKED_ACTIVITY_BEHAVIOR})
    @Retention(RetentionPolicy.SOURCE)
    @Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})
    public @interface DynamicPolicyType {}
@@ -263,6 +263,22 @@ public final class VirtualDeviceParams implements Parcelable {
    @FlaggedApi(Flags.FLAG_VIRTUAL_CAMERA)
    public static final int POLICY_TYPE_CAMERA = 5;

    /**
     * Tells the virtual device framework how to handle activity launches that were blocked due to
     * the current activity policy.
     *
     * <ul>
     *     <li>{@link #DEVICE_POLICY_DEFAULT}: Show UI informing the user of the blocked activity
     *     launch on the virtual display that the activity was originally launched on.
     *     <li>{@link #DEVICE_POLICY_CUSTOM}: Does not inform the user of the blocked activity
     *     launch. The virtual device owner can use this policy together with
     *     {@link VirtualDeviceManager.ActivityListener#onActivityLaunchBlocked} to provide custom
     *     experience on the virtual device.
     * </ul>
     */
    @FlaggedApi(android.companion.virtualdevice.flags.Flags.FLAG_ACTIVITY_CONTROL_API)
    public static final int POLICY_TYPE_BLOCKED_ACTIVITY_BEHAVIOR = 6;

    private final int mLockState;
    @NonNull private final ArraySet<UserHandle> mUsersWithMatchingAccounts;
    @NavigationPolicy
@@ -1174,6 +1190,10 @@ public final class VirtualDeviceParams implements Parcelable {
                mDevicePolicies.delete(POLICY_TYPE_CAMERA);
            }

            if (!android.companion.virtualdevice.flags.Flags.activityControlApi()) {
                mDevicePolicies.delete(POLICY_TYPE_BLOCKED_ACTIVITY_BEHAVIOR);
            }

            if ((mAudioPlaybackSessionId != AUDIO_SESSION_ID_GENERATE
                    || mAudioRecordingSessionId != AUDIO_SESSION_ID_GENERATE)
                    && mDevicePolicies.get(POLICY_TYPE_AUDIO, DEVICE_POLICY_DEFAULT)
+4 −0
Original line number Diff line number Diff line
@@ -9025,6 +9025,10 @@ public abstract class BatteryStats {

            final int uid = consumer.getUid();
            final Uid u = uidStats.get(uid);
            if (u == null) {
                continue;
            }

            final long rxPackets = u.getNetworkActivityPackets(
                    BatteryStats.NETWORK_MOBILE_RX_DATA, STATS_SINCE_CHARGED);
            final long txPackets = u.getNetworkActivityPackets(
+15 −5
Original line number Diff line number Diff line
@@ -159,6 +159,8 @@ public class Environment {
    @UnsupportedAppUsage
    private static UserEnvironment sCurrentUser;
    private static boolean sUserRequired;
    private static Boolean sLegacyStorageAppOp;
    private static Boolean sNoIsolatedStorageAppOp;

    static {
        initForCurrentUser();
@@ -1459,16 +1461,24 @@ public class Environment {
        final AppOpsManager appOps = context.getSystemService(AppOpsManager.class);
        final String opPackageName = context.getOpPackageName();

        if (appOps.noteOpNoThrow(AppOpsManager.OP_LEGACY_STORAGE, uid,
                opPackageName) == AppOpsManager.MODE_ALLOWED) {
            return true;
        if (sLegacyStorageAppOp == null) {
            sLegacyStorageAppOp =
              appOps.checkOpNoThrow(AppOpsManager.OP_LEGACY_STORAGE, uid, opPackageName) ==
                              AppOpsManager.MODE_ALLOWED;
        }
        if (sLegacyStorageAppOp) {
            return sLegacyStorageAppOp;
        }

        // Legacy external storage access is granted to instrumentations invoked with
        // "--no-isolated-storage" flag.
        return appOps.noteOpNoThrow(AppOpsManager.OP_NO_ISOLATED_STORAGE, uid,
        if (sNoIsolatedStorageAppOp == null) {
            sNoIsolatedStorageAppOp =
              appOps.checkOpNoThrow(AppOpsManager.OP_NO_ISOLATED_STORAGE, uid,
                                    opPackageName) == AppOpsManager.MODE_ALLOWED;
        }
        return sNoIsolatedStorageAppOp;
    }

    private static boolean isScopedStorageEnforced(boolean defaultScopedStorage,
            boolean forceEnableScopedStorage) {
Loading