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

Commit ad1d8b68 authored by Adam Powell's avatar Adam Powell Committed by Android Git Automerger
Browse files

am 1db8cf12: Merge "Toggle wallpaper window flag when setting custom keyguard...

am 1db8cf12: Merge "Toggle wallpaper window flag when setting custom keyguard background" into klp-dev

* commit '1db8cf12':
  Toggle wallpaper window flag when setting custom keyguard background
parents 5537dc21 1db8cf12
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ public class KeyguardViewManager {
        public void onSetBackground(Bitmap bmp) {
            mKeyguardHost.setCustomBackground(bmp != null ?
                    new BitmapDrawable(mContext.getResources(), bmp) : null);
            updateShowWallpaper(bmp == null);
        }
    };

@@ -379,6 +380,16 @@ public class KeyguardViewManager {
        mViewManager.updateViewLayout(mKeyguardHost, mWindowLayoutParams);
    }

    void updateShowWallpaper(boolean show) {
        if (show) {
            mWindowLayoutParams.flags |= WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
        } else {
            mWindowLayoutParams.flags &= ~WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
        }

        mViewManager.updateViewLayout(mKeyguardHost, mWindowLayoutParams);
    }

    public void setNeedsInput(boolean needsInput) {
        mNeedsInput = needsInput;
        if (mWindowLayoutParams != null) {
@@ -489,6 +500,7 @@ public class KeyguardViewManager {
                            lastView.cleanUp();
                            // Let go of any large bitmaps.
                            mKeyguardHost.setCustomBackground(null);
                            updateShowWallpaper(true);
                            mKeyguardHost.removeView(lastView);
                        }
                    }