am 6b024448: Merge "Fix 5493266: Properly restore background after playing music" into ics-mr0

* commit '6b0244485c1d20261cffb0fbabebdfefd701867e':
  Fix 5493266: Properly restore background after playing music
This commit is contained in:
Jim Miller
2011-10-20 17:35:51 -07:00
committed by Android Git Automerger
2 changed files with 26 additions and 21 deletions

View File

@@ -47,29 +47,34 @@ public abstract class KeyguardViewBase extends FrameLayout {
private AudioManager mAudioManager;
private TelephonyManager mTelephonyManager = null;
// This is a faster way to draw the background on devices without hardware acceleration
Drawable mBackgroundDrawable = new Drawable() {
@Override
public void draw(Canvas canvas) {
canvas.drawColor(BACKGROUND_COLOR, PorterDuff.Mode.SRC);
}
@Override
public void setAlpha(int alpha) {
}
@Override
public void setColorFilter(ColorFilter cf) {
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
};
public KeyguardViewBase(Context context) {
super(context);
resetBackground();
}
// This is a faster way to draw the background on devices without hardware acceleration
setBackgroundDrawable(new Drawable() {
@Override
public void draw(Canvas canvas) {
canvas.drawColor(BACKGROUND_COLOR, PorterDuff.Mode.SRC);
}
@Override
public void setAlpha(int alpha) {
}
@Override
public void setColorFilter(ColorFilter cf) {
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
});
public void resetBackground() {
setBackgroundDrawable(mBackgroundDrawable);
}
// used to inject callback

View File

@@ -254,7 +254,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
// TODO: examine all widgets to derive clock status
mUpdateMonitor.reportClockVisible(true);
setBackgroundDrawable(null);
resetBackground();
}
public boolean isVisible(View self) {