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

Commit 1626ea51 authored by Michael Wright's avatar Michael Wright Committed by Android Git Automerger
Browse files

am 4138766a: am 448a1f6f: am cf5b34b0: Merge "Ensure WallpaperEngine has...

am 4138766a: am 448a1f6f: am cf5b34b0: Merge "Ensure WallpaperEngine has correct size information" into klp-dev

* commit '4138766a':
  Ensure WallpaperEngine has correct size information
parents ff942d6d 4138766a
Loading
Loading
Loading
Loading
+15 −0
Original line number Original line Diff line number Diff line
@@ -219,6 +219,8 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
        WallpaperData mWallpaper;
        WallpaperData mWallpaper;
        IRemoteCallback mReply;
        IRemoteCallback mReply;


        boolean mDimensionsChanged = false;

        public WallpaperConnection(WallpaperInfo info, WallpaperData wallpaper) {
        public WallpaperConnection(WallpaperInfo info, WallpaperData wallpaper) {
            mInfo = info;
            mInfo = info;
            mWallpaper = wallpaper;
            mWallpaper = wallpaper;
@@ -262,6 +264,14 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
        public void attachEngine(IWallpaperEngine engine) {
        public void attachEngine(IWallpaperEngine engine) {
            synchronized (mLock) {
            synchronized (mLock) {
                mEngine = engine;
                mEngine = engine;
                if (mDimensionsChanged) {
                    try {
                        mEngine.setDesiredSize(mWallpaper.width, mWallpaper.height);
                    } catch (RemoteException e) {
                        Slog.w(TAG, "Failed to set wallpaper dimensions", e);
                    }
                    mDimensionsChanged = false;
                }
            }
            }
        }
        }


@@ -652,6 +662,11 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
                        } catch (RemoteException e) {
                        } catch (RemoteException e) {
                        }
                        }
                        notifyCallbacksLocked(wallpaper);
                        notifyCallbacksLocked(wallpaper);
                    } else if (wallpaper.connection.mService != null) {
                        // We've attached to the service but the engine hasn't attached back to us
                        // yet. This means it will be created with the previous dimensions, so we
                        // need to update it to the new dimensions once it attaches.
                        wallpaper.connection.mDimensionsChanged = true;
                    }
                    }
                }
                }
            }
            }