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

Commit 33be88cb authored by Adam Cohen's avatar Adam Cohen Committed by Android Git Automerger
Browse files

am d562d300: Merge "Deferring wallpaper update to improve workspace scrolling...

am d562d300: Merge "Deferring wallpaper update to improve workspace scrolling (issue 5506959)" into ics-mr1

* commit 'd562d300':
  Deferring wallpaper update to improve workspace scrolling (issue 5506959)
parents 204a8285 d562d300
Loading
Loading
Loading
Loading
+22 −11
Original line number Diff line number Diff line
@@ -213,6 +213,10 @@ public class WallpaperManager {
            mHandler.sendEmptyMessage(MSG_CLEAR_WALLPAPER);
        }

        public Handler getHandler() {
            return mHandler;
        }

        public Bitmap peekWallpaperBitmap(Context context, boolean returnDefault) {
            synchronized (this) {
                if (mWallpaper != null) {
@@ -619,15 +623,22 @@ public class WallpaperManager {
     * @param yOffset The offset along the Y dimension, from 0 to 1.
     */
    public void setWallpaperOffsets(IBinder windowToken, float xOffset, float yOffset) {
        final IBinder fWindowToken = windowToken;
        final float fXOffset = xOffset;
        final float fYOffset = yOffset;
        sGlobals.getHandler().post(new Runnable() {
            public void run() {
                try {
                    //Log.v(TAG, "Sending new wallpaper offsets from app...");
                    ViewRootImpl.getWindowSession(mContext.getMainLooper()).setWallpaperPosition(
                    windowToken, xOffset, yOffset, mWallpaperXStep, mWallpaperYStep);
                            fWindowToken, fXOffset, fYOffset, mWallpaperXStep, mWallpaperYStep);
                    //Log.v(TAG, "...app returning after sending offsets!");
                } catch (RemoteException e) {
                    // Ignore.
                }
            }
        });
    }

    /**
     * For applications that use multiple virtual screens showing a wallpaper,