Merge "Toggle wallpaper window flag when setting custom keyguard background" into klp-dev

This commit is contained in:
Adam Powell
2013-10-11 03:09:35 +00:00
committed by Android (Google) Code Review

View File

@@ -85,6 +85,7 @@ public class KeyguardViewManager {
public void onSetBackground(Bitmap bmp) { public void onSetBackground(Bitmap bmp) {
mKeyguardHost.setCustomBackground(bmp != null ? mKeyguardHost.setCustomBackground(bmp != null ?
new BitmapDrawable(mContext.getResources(), bmp) : null); new BitmapDrawable(mContext.getResources(), bmp) : null);
updateShowWallpaper(bmp == null);
} }
}; };
@@ -379,6 +380,16 @@ public class KeyguardViewManager {
mViewManager.updateViewLayout(mKeyguardHost, mWindowLayoutParams); 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) { public void setNeedsInput(boolean needsInput) {
mNeedsInput = needsInput; mNeedsInput = needsInput;
if (mWindowLayoutParams != null) { if (mWindowLayoutParams != null) {
@@ -489,6 +500,7 @@ public class KeyguardViewManager {
lastView.cleanUp(); lastView.cleanUp();
// Let go of any large bitmaps. // Let go of any large bitmaps.
mKeyguardHost.setCustomBackground(null); mKeyguardHost.setCustomBackground(null);
updateShowWallpaper(true);
mKeyguardHost.removeView(lastView); mKeyguardHost.removeView(lastView);
} }
} }