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

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

Snap for 9311025 from fa290397 to tm-qpr2-release

Change-Id: I5b7faf8f788cb3a5be8cbd5b25b05e52dbdd10fc
parents 2fd9f7b2 fa290397
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -188,17 +188,17 @@ final class DisabledWallpaperManager extends WallpaperManager {
    }

    @Override
    public WallpaperInfo getWallpaperInfo(int userId) {
    public WallpaperInfo getWallpaperInfoForUser(int userId) {
        return unsupported();
    }

    @Override
    public WallpaperInfo getWallpaperInfoWithFlags(@SetWallpaperFlags int which) {
    public WallpaperInfo getWallpaperInfo(@SetWallpaperFlags int which) {
        return unsupported();
    }

    @Override
    public WallpaperInfo getWallpaperInfoWithFlags(@SetWallpaperFlags int which, int userId) {
    public WallpaperInfo getWallpaperInfo(@SetWallpaperFlags int which, int userId) {
        return unsupported();
    }

+15 −9
Original line number Diff line number Diff line
@@ -1324,7 +1324,7 @@ public class WallpaperManager {
     * wallpaper component. Otherwise, if the wallpaper is a static image, this returns null.
     */
    public WallpaperInfo getWallpaperInfo() {
        return getWallpaperInfo(mContext.getUserId());
        return getWallpaperInfoForUser(mContext.getUserId());
    }

    /**
@@ -1334,7 +1334,7 @@ public class WallpaperManager {
     * @param userId Owner of the wallpaper.
     * @hide
     */
    public WallpaperInfo getWallpaperInfo(int userId) {
    public WallpaperInfo getWallpaperInfoForUser(int userId) {
        try {
            if (sGlobals.mService == null) {
                Log.w(TAG, "WallpaperService not running");
@@ -1349,25 +1349,31 @@ public class WallpaperManager {

    /**
     * Returns the information about the home screen wallpaper if its current wallpaper is a live
     * wallpaper component. Otherwise, if the wallpaper is a static image, this returns null.
     * wallpaper component. Otherwise, if the wallpaper is a static image or is not set, this
     * returns null.
     *
     * @param which Specifies wallpaper destination (home or lock).
     * @param which Specifies wallpaper to request (home or lock).
     * @throws IllegalArgumentException if {@code which} is not exactly one of
     * {{@link #FLAG_SYSTEM},{@link #FLAG_LOCK}}.
     * @hide
     */
    public WallpaperInfo getWallpaperInfoWithFlags(@SetWallpaperFlags int which) {
    public WallpaperInfo getWallpaperInfo(@SetWallpaperFlags int which) {
        return getWallpaperInfo();
    }

    /**
     * Returns the information about the designated wallpaper if its current wallpaper is a live
     * wallpaper component. Otherwise, if the wallpaper is a static image, this returns null.
     * wallpaper component. Otherwise, if the wallpaper is a static image or is not set, this
     * returns null.
     *
     * @param which Specifies wallpaper destination (home or lock).
     * @param which Specifies wallpaper to request (home or lock).
     * @param userId Owner of the wallpaper.
     * @throws IllegalArgumentException if {@code which} is not exactly one of
     * {{@link #FLAG_SYSTEM},{@link #FLAG_LOCK}}.
     * @hide
     */
    public WallpaperInfo getWallpaperInfoWithFlags(@SetWallpaperFlags int which, int userId) {
        return getWallpaperInfo(userId);
    public WallpaperInfo getWallpaperInfo(@SetWallpaperFlags int which, int userId) {
        return getWallpaperInfoForUser(userId);
    }

    /**
+16 −0
Original line number Diff line number Diff line
@@ -52,6 +52,22 @@ public final class DeviceStateManager {
    /** The maximum allowed device state identifier. */
    public static final int MAXIMUM_DEVICE_STATE = 255;

    /**
     * Intent needed to launch the rear display overlay activity from SysUI
     *
     * @hide
     */
    public static final String ACTION_SHOW_REAR_DISPLAY_OVERLAY =
            "com.android.intent.action.SHOW_REAR_DISPLAY_OVERLAY";

    /**
     * Intent extra sent to the rear display overlay activity of the current base state
     *
     * @hide
     */
    public static final String EXTRA_ORIGINAL_DEVICE_BASE_STATE =
            "original_device_base_state";

    private final DeviceStateManagerGlobal mGlobal;

    /** @hide */
+17 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ public final class DeviceStateManagerGlobal {
     * connection with the device state service couldn't be established.
     */
    @Nullable
    static DeviceStateManagerGlobal getInstance() {
    public static DeviceStateManagerGlobal getInstance() {
        synchronized (DeviceStateManagerGlobal.class) {
            if (sInstance == null) {
                IBinder b = ServiceManager.getService(Context.DEVICE_STATE_SERVICE);
@@ -259,6 +259,22 @@ public final class DeviceStateManagerGlobal {
        }
    }

    /**
     * Provides notification to the system server that a device state feature overlay
     * was dismissed. This should only be called from the {@link android.app.Activity} that
     * was showing the overlay corresponding to the feature.
     *
     * Validation of there being an overlay visible and pending state request is handled on the
     * system server.
     */
    public void onStateRequestOverlayDismissed(boolean shouldCancelRequest) {
        try {
            mDeviceStateManager.onStateRequestOverlayDismissed(shouldCancelRequest);
        } catch (RemoteException ex) {
            throw ex.rethrowFromSystemServer();
        }
    }

    private void registerCallbackIfNeededLocked() {
        if (mCallback == null) {
            mCallback = new DeviceStateManagerCallback();
+11 −0
Original line number Diff line number Diff line
@@ -103,4 +103,15 @@ interface IDeviceStateManager {
    @JavaPassthrough(annotation=
        "@android.annotation.RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_STATE)")
    void cancelBaseStateOverride();

    /**
    * Notifies the system service that the educational overlay that was launched
    * before entering a requested state was dismissed or closed, and provides
    * the system information on if the pairing mode should be canceled or not.
    *
    * This should only be called from the overlay itself.
    */
    @JavaPassthrough(annotation=
        "@android.annotation.RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_STATE)")
    void onStateRequestOverlayDismissed(boolean shouldCancelRequest);
}
Loading