Merge "Fix 5493266: Properly restore background after playing music" into ics-mr0
This commit is contained in:
@@ -47,29 +47,34 @@ public abstract class KeyguardViewBase extends FrameLayout {
|
|||||||
private AudioManager mAudioManager;
|
private AudioManager mAudioManager;
|
||||||
private TelephonyManager mTelephonyManager = null;
|
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) {
|
public KeyguardViewBase(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
|
resetBackground();
|
||||||
|
}
|
||||||
|
|
||||||
// This is a faster way to draw the background on devices without hardware acceleration
|
public void resetBackground() {
|
||||||
setBackgroundDrawable(new Drawable() {
|
setBackgroundDrawable(mBackgroundDrawable);
|
||||||
@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;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// used to inject callback
|
// used to inject callback
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase implements Handler
|
|||||||
|
|
||||||
// TODO: examine all widgets to derive clock status
|
// TODO: examine all widgets to derive clock status
|
||||||
mUpdateMonitor.reportClockVisible(true);
|
mUpdateMonitor.reportClockVisible(true);
|
||||||
setBackgroundDrawable(null);
|
resetBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isVisible(View self) {
|
public boolean isVisible(View self) {
|
||||||
|
|||||||
Reference in New Issue
Block a user