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

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

Snap for 14064202 from 948aa77a to 25Q4-release

Change-Id: I8794b1aefd7ed6c86426d233d7b62bcf21c3078d
parents 231b24b6 948aa77a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14138,7 +14138,7 @@ package android.content.pm {
    field @RequiresPermission(allOf={android.Manifest.permission.FOREGROUND_SERVICE_CAMERA}, anyOf={android.Manifest.permission.CAMERA}, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_CAMERA = 64; // 0x40
    field @RequiresPermission(allOf={android.Manifest.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE}, anyOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.CHANGE_NETWORK_STATE, android.Manifest.permission.CHANGE_WIFI_STATE, android.Manifest.permission.CHANGE_WIFI_MULTICAST_STATE, android.Manifest.permission.NFC, android.Manifest.permission.TRANSMIT_IR, android.Manifest.permission.UWB_RANGING, android.Manifest.permission.RANGING}, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE = 16; // 0x10
    field @RequiresPermission(value=android.Manifest.permission.FOREGROUND_SERVICE_DATA_SYNC, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_DATA_SYNC = 1; // 0x1
    field @FlaggedApi("android.permission.flags.replace_body_sensor_permission_enabled") @RequiresPermission(allOf={android.Manifest.permission.FOREGROUND_SERVICE_HEALTH}, anyOf={android.Manifest.permission.ACTIVITY_RECOGNITION, android.Manifest.permission.HIGH_SAMPLING_RATE_SENSORS, android.health.connect.HealthPermissions.READ_HEART_RATE, android.health.connect.HealthPermissions.READ_SKIN_TEMPERATURE, android.health.connect.HealthPermissions.READ_OXYGEN_SATURATION}) public static final int FOREGROUND_SERVICE_TYPE_HEALTH = 256; // 0x100
    field @RequiresPermission(allOf={android.Manifest.permission.FOREGROUND_SERVICE_HEALTH}, anyOf={android.Manifest.permission.ACTIVITY_RECOGNITION, android.Manifest.permission.HIGH_SAMPLING_RATE_SENSORS, android.health.connect.HealthPermissions.READ_HEART_RATE, android.health.connect.HealthPermissions.READ_SKIN_TEMPERATURE, android.health.connect.HealthPermissions.READ_OXYGEN_SATURATION}) public static final int FOREGROUND_SERVICE_TYPE_HEALTH = 256; // 0x100
    field @RequiresPermission(allOf={android.Manifest.permission.FOREGROUND_SERVICE_LOCATION}, anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_LOCATION = 8; // 0x8
    field public static final int FOREGROUND_SERVICE_TYPE_MANIFEST = -1; // 0xffffffff
    field @RequiresPermission(value=android.Manifest.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK = 2; // 0x2
+56 −0
Original line number Diff line number Diff line
@@ -6312,6 +6312,38 @@ public class ActivityManager {
     * See {@link android.app.ActivityManager#getAppTasks()}
     */
    public static class AppTask {

        /**
         * The windowing layer is not specified. The system will use a
         * {@link #WINDOWING_LAYER_NORMAL_APP} layer.
         * @hide
         */
        public static final int WINDOWING_LAYER_UNDEFINED = 0;
        /**
         * The windowing layer for normal application windows.
         * @hide
         */
        public static final int WINDOWING_LAYER_NORMAL_APP = 1;
        /**
         * The windowing layer for pinned windows, these windows are typically displayed above
         * normal application windows.
         * @hide
         */
        public static final int WINDOWING_LAYER_PINNED = 2;

        /**
         * Defines the windowing layer for a task, which can affect its Z-ordering.
         * @hide
         */
        @IntDef(prefix = { "WINDOWING_LAYER_" }, value = {
                WINDOWING_LAYER_UNDEFINED,
                WINDOWING_LAYER_NORMAL_APP,
                WINDOWING_LAYER_PINNED,
        })
        @Retention(RetentionPolicy.SOURCE)
        public @interface WindowingLayer {
        }

        private IAppTask mAppTaskImpl;

        /** @hide */
@@ -6458,6 +6490,30 @@ public class ActivityManager {
                throw e.rethrowFromSystemServer();
            }
        }

        /**
         * Requests the windowing layer for this task. This can be used to affect the Z-ordering
         * of the activity's window relative to other windows.
         *
         * <p>
         * The task will be moved to the requested layer if possible.
         *
         * @param layer the {@link WindowingLayer} to move task to.
         * @param executor an Executor used to invoke the callback
         * @param callback a callback to receive the result of the request
         * @hide
         */
        // TODO(b/442807136): Complete javadoc, add all requirements and detals needed
        public void requestWindowingLayer(
                @WindowingLayer int layer,
                @NonNull @CallbackExecutor Executor executor,
                @NonNull OutcomeReceiver<Void, Exception> callback) {
            Objects.requireNonNull(executor, "executor cannot be null");
            Objects.requireNonNull(callback, "callback cannot be null");
            TaskWindowingLayerRequestHandler.requestWindowingLayer(
                    layer, executor, callback, mAppTaskImpl
            );
        }
    }

    /**
+36 −1
Original line number Diff line number Diff line
@@ -1740,9 +1740,17 @@ public class AppOpsManager {
     */
    public static final int OP_COMPUTER_CONTROL = AppOpEnums.APP_OP_COMPUTER_CONTROL;

    /**
     * Allow the app to read SMS messages that contain One Time Passwords (OTPs). This app op does
     * not remove the need for the READ_SMS app op to be granted.
     *
     * @hide
     */
    public static final int OP_READ_OTP_SMS = AppOpEnums.APP_OP_READ_OTP_SMS;

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

    /**
     * All app ops represented as strings.
@@ -1914,6 +1922,7 @@ public class AppOpsManager {
            OPSTR_READ_CELL_IDENTITY,
            OPSTR_READ_CELL_INFO,
            OPSTR_COMPUTER_CONTROL,
            OPSTR_READ_OTP_SMS,
    })
    public @interface AppOpString {}

@@ -2726,6 +2735,9 @@ public class AppOpsManager {
    /** @hide Control other applications. */
    public static final String OPSTR_COMPUTER_CONTROL = "android:computer_control";

    /** @hide Read OTP SMS messages */
    public static final String OPSTR_READ_OTP_SMS = "android:read_otp_sms";

    /** {@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} */
@@ -3406,6 +3418,8 @@ public class AppOpsManager {
        new AppOpInfo.Builder(OP_COMPUTER_CONTROL, OPSTR_COMPUTER_CONTROL, "COMPUTER_CONTROL")
                .setDefaultMode(AppOpsManager.MODE_IGNORED)
                .build(),
        new AppOpInfo.Builder(OP_READ_OTP_SMS, OPSTR_READ_OTP_SMS, "READ_OTP_SMS")
                .build(),
    };

    // The number of longs needed to form a full bitmask of app ops
@@ -10796,6 +10810,27 @@ public class AppOpsManager {
        }
    }

    /**
     * Gets a list of packages that have a particular app op set to a particular mode, if that mode
     * is not the default mode for the op.
     *
     * @param op The op to check state for.
     * @param mode The mode the op must have for a package to be included. This mode must not be
     *             the default mode of the op, or the method will throw an IllegalArgumenException.
     * @return A list of all packages whose app op mode matches the given mode for the given app op.
     *
     * @throws IllegalArgumentException if the specified mode is the default mode for the op
     * @hide
     */
    @RequiresPermission(Manifest.permission.QUERY_ALL_PACKAGES)
    public @NonNull List<String> getPackagesWithNonDefaultUidMode(int op, int mode) {
        try {
            return mService.getPackagesWithNonDefaultUidMode(op, mode, mContext.getUserId());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Start collection of noted appops on this thread.
     *
+1 −0
Original line number Diff line number Diff line
@@ -33,4 +33,5 @@ interface IAppTask {
    int startActivity(IBinder whoThread, String callingPackage, String callingFeatureId,
            in Intent intent, String resolvedType, in Bundle options);
    void setExcludeFromRecents(boolean exclude);
    void requestWindowingLayer(in int layer, in IRemoteCallback outcomeCallback);
}
+12 −1
Original line number Diff line number Diff line
@@ -340,6 +340,9 @@ public class ResourcesManager {
        @Nullable
        public WeakReference<Resources> resources;

        /** Whether this resource is created for the token itself. */
        boolean isBaseResource;

        private ActivityResource() {}
    }

@@ -946,6 +949,9 @@ public class ResourcesManager {
        activityResource.overrideConfig.setTo(initialOverrideConfig);
        activityResource.overrideDisplayId = overrideDisplayId;
        activityResources.activityResources.add(activityResource);
        if (activityResources.activityResources.size() == 1) {
            activityResource.isBaseResource = true;
        }
        if (DEBUG) {
            Slog.d(TAG, "- creating new ref=" + resources);
            Slog.d(TAG, "- setting ref=" + resources + " with impl=" + impl);
@@ -1476,8 +1482,13 @@ public class ResourcesManager {
        // Ensure the new key keeps the expected override display instead of the new token display.
        displayId = overrideDisplayId != null ? overrideDisplayId : displayId;

        // Do not use token identify if it is a derived resource (isBaseResource == false) because
        // if the window configuration is different, the key for derived resource should not find
        // the ResourcesImpl instance of token resource.
        final int tokenIdentity = activityResource.isBaseResource
                ? System.identityHashCode(activityToken) : 0;
        // Create the new ResourcesKey with the rebased override config.
        final ResourcesKey newKey = new ResourcesKey(System.identityHashCode(activityToken),
        final ResourcesKey newKey = new ResourcesKey(tokenIdentity,
                oldKey.mResDir, oldKey.mSplitResDirs, oldKey.mOverlayPaths, oldKey.mLibDirs,
                displayId, rebasedOverrideConfig, oldKey.mCompatInfo, oldKey.mLoaders);

Loading