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

Commit 41d41c36 authored by Christopher Tate's avatar Christopher Tate Committed by android-build-merger
Browse files

Merge "Add API to clear a specific wallpaper" into nyc-dev am: d493ed6c

am: 06cfa553

* commit '06cfa553':
  Add API to clear a specific wallpaper
parents ceb9be39 06cfa553
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5712,6 +5712,7 @@ package android.app {
  public class WallpaperManager {
    method public void clear() throws java.io.IOException;
    method public void clear(int) throws java.io.IOException;
    method public void clearWallpaperOffsets(android.os.IBinder);
    method public void forgetLoadedWallpaper();
    method public android.graphics.drawable.Drawable getBuiltInDrawable();
+1 −0
Original line number Diff line number Diff line
@@ -5844,6 +5844,7 @@ package android.app {
  public class WallpaperManager {
    method public void clear() throws java.io.IOException;
    method public void clear(int) throws java.io.IOException;
    method public void clearWallpaper();
    method public void clearWallpaper(int, int);
    method public void clearWallpaperOffsets(android.os.IBinder);
+1 −0
Original line number Diff line number Diff line
@@ -5716,6 +5716,7 @@ package android.app {
  public class WallpaperManager {
    method public void clear() throws java.io.IOException;
    method public void clear(int) throws java.io.IOException;
    method public void clearWallpaperOffsets(android.os.IBinder);
    method public void forgetLoadedWallpaper();
    method public android.graphics.drawable.Drawable getBuiltInDrawable();
+19 −0
Original line number Diff line number Diff line
@@ -1432,6 +1432,25 @@ public class WallpaperManager {
        setStream(openDefaultWallpaper(mContext));
    }

    /**
     * Remove one or more currently set wallpapers, reverting to the system default
     * display for each one.  If {@link #FLAG_SET_SYSTEM} is set in the {@code which}
     * parameter, the intent {@link Intent#ACTION_WALLPAPER_CHANGED} will be broadcast
     * upon success.
     *
     * @param which A bitwise combination of {@link #FLAG_SET_SYSTEM} or
     *   {@link #FLAG_SET_LOCK}
     * @throws IOException If an error occurs reverting to the built-in wallpaper.
     */
    public void clear(int which) throws IOException {
        if ((which & FLAG_SET_SYSTEM) != 0) {
            clear();
        }
        if ((which & FLAG_SET_LOCK) != 0) {
            clearWallpaper(FLAG_SET_LOCK, mContext.getUserId());
        }
    }

    /**
     * Open stream representing the default static image wallpaper.
     *
+8 −0
Original line number Diff line number Diff line
@@ -882,6 +882,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
            wallpaper = mLockWallpaperMap.get(userId);
            if (wallpaper == null) {
                // It's already gone; we're done.
                if (DEBUG) {
                    Slog.i(TAG, "Lock wallpaper already cleared");
                }
                return;
            }
        } else {
@@ -902,14 +905,19 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
                wallpaper.wallpaperFile.delete();
                wallpaper.cropFile.delete();
                if (which == FLAG_SET_LOCK) {
                    mLockWallpaperMap.remove(userId);
                    final IWallpaperManagerCallback cb = mKeyguardListener;
                    if (cb != null) {
                        if (DEBUG) {
                            Slog.i(TAG, "Notifying keyguard of lock wallpaper clear");
                        }
                        try {
                            cb.onWallpaperChanged();
                        } catch (RemoteException e) {
                            // Oh well it went away; no big deal
                        }
                    }
                    saveSettingsLocked(userId);
                    return;
                }
            }