diff options
author | Jim Miller <jaggies@google.com> | 2011-01-12 13:14:33 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-12 13:14:33 -0800 |
commit | a3a078e34317763ad1294e0164c147074584e2e8 (patch) | |
tree | 71422e59d21067c3ef5f14960c6174ef507d7aee /policy | |
parent | 02e852f968bac83947cd97a5fe7c7a7064774c5a (diff) | |
parent | 39d4b067a777a96817c279429a8e3c452c13c5b4 (diff) | |
download | frameworks_base-a3a078e34317763ad1294e0164c147074584e2e8.zip frameworks_base-a3a078e34317763ad1294e0164c147074584e2e8.tar.gz frameworks_base-a3a078e34317763ad1294e0164c147074584e2e8.tar.bz2 |
Merge "Fix 3201849: Use custom Drawable for bg in lockscreen" into honeycomb
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/KeyguardViewBase.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java b/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java index 82753b2..6b52454 100644 --- a/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java +++ b/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java @@ -18,6 +18,11 @@ package com.android.internal.policy.impl; import android.content.Context; import android.content.Intent; +import android.graphics.Canvas; +import android.graphics.ColorFilter; +import android.graphics.PixelFormat; +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; import android.media.AudioManager; import android.telephony.TelephonyManager; import android.view.KeyEvent; @@ -37,12 +42,34 @@ import android.util.AttributeSet; */ public abstract class KeyguardViewBase extends FrameLayout { + private static final int BACKGROUND_COLOR = 0x70000000; private KeyguardViewCallback mCallback; private AudioManager mAudioManager; private TelephonyManager mTelephonyManager = null; public KeyguardViewBase(Context context) { super(context); + + // 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; + } + }); } // used to inject callback |