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

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

Merge "Run liveSync/localSync.complete() earlier" into udc-qpr-dev am: 712fca51 am: bf81d071

parents 470327fe bf81d071
Loading
Loading
Loading
Loading
+10 −17
Original line number Diff line number Diff line
@@ -326,9 +326,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                            if (DEBUG) {
                                Slog.d(TAG, "publish system wallpaper changed!");
                            }
                            if (localSync != null) {
                                localSync.complete();
                            }
                            notifyWallpaperChanged(wallpaper);
                        }
                    };
@@ -336,7 +333,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                    // If this was the system wallpaper, rebind...
                    bindWallpaperComponentLocked(mImageWallpaper, true, false, wallpaper,
                            callback);
                    notifyColorsWhich |= FLAG_SYSTEM;
                    notifyColorsWhich |= wallpaper.mWhich;
                }

                if (lockWallpaperChanged) {
@@ -350,9 +347,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                            if (DEBUG) {
                                Slog.d(TAG, "publish lock wallpaper changed!");
                            }
                            if (localSync != null) {
                                localSync.complete();
                            }
                            notifyWallpaperChanged(wallpaper);
                        }
                    };
@@ -377,9 +371,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                }

                saveSettingsLocked(wallpaper.userId);
                // Notify the client immediately if only lockscreen wallpaper changed.
                if (lockWallpaperChanged && !sysWallpaperChanged) {
                    notifyWallpaperChanged(wallpaper);
                if ((sysWallpaperChanged || lockWallpaperChanged) && localSync != null) {
                    localSync.complete();
                }
            }

@@ -1426,7 +1419,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                            lockWp.connection.mWallpaper = lockWp;
                            mOriginalSystem.mWhich = FLAG_LOCK;
                            updateEngineFlags(mOriginalSystem);
                            notifyWallpaperColorsChanged(lockWp, FLAG_LOCK);
                        } else {
                            // Failed rename, use current system wp for both
                            if (DEBUG) {
@@ -1446,7 +1438,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                        updateEngineFlags(mOriginalSystem);
                        mLockWallpaperMap.put(mNewWallpaper.userId, mOriginalSystem);
                        mLastLockWallpaper = mOriginalSystem;
                        notifyWallpaperColorsChanged(mOriginalSystem, FLAG_LOCK);
                    }
                } else if (mNewWallpaper.mWhich == FLAG_LOCK) {
                    // New wp is lock only, so old system+lock is now system only
@@ -1460,10 +1451,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                    }
                }
            }

            synchronized (mLock) {
            saveSettingsLocked(mNewWallpaper.userId);
            }

            if (DEBUG) {
                Slog.v(TAG, "--- wallpaper changed --");
@@ -3340,7 +3328,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                        if (DEBUG) {
                            Slog.d(TAG, "publish system wallpaper changed!");
                        }
                        liveSync.complete();
                    }
                };

@@ -3396,6 +3383,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                        }
                        mLockWallpaperMap.remove(newWallpaper.userId);
                    }
                    if (liveSync != null) liveSync.complete();
                }
            } finally {
                Binder.restoreCallingIdentity(ident);
@@ -3514,6 +3502,11 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
        }
        // Has the component changed?
        if (!force && changingToSame(componentName, wallpaper)) {
            try {
                if (reply != null) reply.sendResult(null);
            } catch (RemoteException e) {
                Slog.e(TAG, "Failed to send callback", e);
            }
            return true;
        }