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

Commit 6ff00377 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix to show the correct HW accel background in the preview window."

parents 1fc756da 07213e6d
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -575,7 +575,6 @@ public final class ViewRootImpl extends Handler implements ViewParent,

        if (hardwareAccelerated) {
            if (!HardwareRenderer.isAvailable()) {
                mAttachInfo.mHardwareAccelerationRequested = true;
                return;
            }

@@ -601,6 +600,13 @@ public final class ViewRootImpl extends Handler implements ViewParent,
                mAttachInfo.mHardwareRenderer = HardwareRenderer.createGlRenderer(2, translucent);
                mAttachInfo.mHardwareAccelerated = mAttachInfo.mHardwareAccelerationRequested
                        = mAttachInfo.mHardwareRenderer != null;
            } else {
                // We would normally have enabled hardware acceleration, but
                // haven't because we are in the system process.  We still want
                // what is drawn on the screen to behave as if it is accelerated,
                // so that our preview starting windows visually match what will
                // actually be drawn by the app.
                mAttachInfo.mHardwareAccelerationRequested = true;
            }
        }
    }
+13 −7
Original line number Diff line number Diff line
@@ -118,9 +118,10 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
                        File changedFile = new File(WALLPAPER_DIR, path);
                        if (WALLPAPER_FILE.equals(changedFile)) {
                            notifyCallbacksLocked();
                            if (mWallpaperComponent == null ||
                                    mWallpaperComponent.equals(mImageWallpaperComponent)) {
                                bindWallpaperComponentLocked(mWallpaperComponent, true);
                            if (mWallpaperComponent == null || mImageWallpaperPending) {
                                mImageWallpaperPending = false;
                                bindWallpaperComponentLocked(mImageWallpaperComponent, true);
                                saveSettingsLocked();
                            }
                        }
                    }
@@ -134,6 +135,11 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
    int mWidth = -1;
    int mHeight = -1;

    /**
     * Client is currently writing a new image wallpaper.
     */
    boolean mImageWallpaperPending;

    /**
     * Resource name if using a picture from the wallpaper gallery
     */
@@ -343,6 +349,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
        }
        final long ident = Binder.clearCallingIdentity();
        try {
            mImageWallpaperPending = false;
            bindWallpaperComponentLocked(null, false);
        } catch (IllegalArgumentException e) {
            // This can happen if the default wallpaper component doesn't
@@ -433,9 +440,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
            try {
                ParcelFileDescriptor pfd = updateWallpaperBitmapLocked(name);
                if (pfd != null) {
                    // Bind the wallpaper to an ImageWallpaper
                    bindWallpaperComponentLocked(mImageWallpaperComponent, false);
                    saveSettingsLocked();
                    mImageWallpaperPending = true;
                }
                return pfd;
            } finally {
@@ -463,6 +468,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub {
        synchronized (mLock) {
            final long ident = Binder.clearCallingIdentity();
            try {
                mImageWallpaperPending = false;
                bindWallpaperComponentLocked(name, false);
            } finally {
                Binder.restoreCallingIdentity(ident);