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

Commit 34125b0b authored by Aurélien Pomini's avatar Aurélien Pomini Committed by Automerger Merge Worker
Browse files

Merge "Don't set ImageWallpaper to home only the first time" into udc-qpr-dev...

Merge "Don't set ImageWallpaper to home only the first time" into udc-qpr-dev am: 8cec5d1e am: 91c9f5ea

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23845487



Change-Id: Ieb9b21aa7bbfbbd5558b6913feadad38cf8d9317
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0c53e3f7 91c9f5ea
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -3158,7 +3158,10 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
            if (which == FLAG_SYSTEM && systemIsStatic && systemIsBoth) {
                Slog.i(TAG, "Migrating current wallpaper to be lock-only before"
                        + " updating system wallpaper");
                migrateStaticSystemToLockWallpaperLocked(userId);
                if (!migrateStaticSystemToLockWallpaperLocked(userId)
                        && !isLockscreenLiveWallpaperEnabled()) {
                    which |= FLAG_LOCK;
                }
            }

            wallpaper = getWallpaperSafeLocked(userId, which);
@@ -3186,13 +3189,13 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
        }
    }

    private void migrateStaticSystemToLockWallpaperLocked(int userId) {
    private boolean migrateStaticSystemToLockWallpaperLocked(int userId) {
        WallpaperData sysWP = mWallpaperMap.get(userId);
        if (sysWP == null) {
            if (DEBUG) {
                Slog.i(TAG, "No system wallpaper?  Not tracking for lock-only");
            }
            return;
            return true;
        }

        // We know a-priori that there is no lock-only wallpaper currently
@@ -3219,9 +3222,12 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                SELinux.restorecon(lockWP.getWallpaperFile());
                mLastLockWallpaper = lockWP;
            }
            return true;
        } catch (ErrnoException e) {
            Slog.e(TAG, "Can't migrate system wallpaper: " + e.getMessage());
            // can happen when migrating default wallpaper (which is not stored in wallpaperFile)
            Slog.w(TAG, "Couldn't migrate system wallpaper: " + e.getMessage());
            clearWallpaperBitmaps(lockWP);
            return false;
        }
    }

@@ -3433,7 +3439,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                    // therefore it's a shared system+lock image that we need to migrate.
                    Slog.i(TAG, "Migrating current wallpaper to be lock-only before"
                            + "updating system wallpaper");
                    migrateStaticSystemToLockWallpaperLocked(userId);
                    if (!migrateStaticSystemToLockWallpaperLocked(userId)) {
                        which |= FLAG_LOCK;
                    }
                }
            }