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

Commit 4b27125d authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru Committed by android code review
Browse files

Merge changes Ib28636e6,I93ebc433

* changes:
  WallpaperManagerService does not properly propagate setDimensionHints()
  ImageWallpaper : get bitmap width before calc screen offset
parents 00f94e88 3d9a9d6e
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -282,6 +282,13 @@ public class ImageWallpaper extends WallpaperService {
                updateWallpaperLocked();
            }

            if (mBackground == null) {
                // If we somehow got to this point after we have last flushed
                // the wallpaper, well we really need it to draw again.  So
                // seems like we need to reload it.  Ouch.
                updateWallpaperLocked();
            }

            SurfaceHolder sh = getSurfaceHolder();
            final Rect frame = sh.getSurfaceFrame();
            final int dw = frame.width();
@@ -303,13 +310,6 @@ public class ImageWallpaper extends WallpaperService {
            mLastXTranslation = xPixels;
            mLastYTranslation = yPixels;

            if (mBackground == null) {
                // If we somehow got to this point after we have last flushed
                // the wallpaper, well we really need it to draw again.  So
                // seems like we need to reload it.  Ouch.
                updateWallpaperLocked();
            }

            if (mIsHwAccelerated) {
                if (!drawWallpaperWithOpenGL(sh, availw, availh, xPixels, yPixels)) {
                    drawWallpaperWithCanvas(sh, availw, availh, xPixels, yPixels);
+13 −0
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
    WallpaperConnection mWallpaperConnection;
    long mLastDiedTime;
    boolean mWallpaperUpdating;
    boolean mDesiredDimensionChanging;
    
    class WallpaperConnection extends IWallpaperConnection.Stub
            implements ServiceConnection {
@@ -213,6 +214,13 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
        
        public void attachEngine(IWallpaperEngine engine) {
            mEngine = engine;
             if (engine != null && mDesiredDimensionChanging) {
                 try {
                     engine.setDesiredSize(mWidth, mHeight);
                     mDesiredDimensionChanging = false;
                 } catch (RemoteException e) {
                 }
             }
        }
        
        public ParcelFileDescriptor setWallpaper(String name) {
@@ -395,6 +403,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub {

        synchronized (mLock) {
            if (width != mWidth || height != mHeight) {
                boolean desiredDimensionPropagated = false;
                mWidth = width;
                mHeight = height;
                saveSettingsLocked();
@@ -403,11 +412,15 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
                        try {
                            mWallpaperConnection.mEngine.setDesiredSize(
                                    width, height);
                            desiredDimensionPropagated = true;
                        } catch (RemoteException e) {
                        }
                        notifyCallbacksLocked();
                    }
                }
                if (!desiredDimensionPropagated) {
                    mDesiredDimensionChanging = true;
                }
            }
        }
    }