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

Commit f1ecfb79 authored by David van Tonder's avatar David van Tonder Committed by Gerrit Code Review
Browse files

Merge "Lockscreen : Add custom background overlay" into cm-10.1

parents 9e3c604f fa583e17
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -38,8 +38,11 @@ import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Looper;
import android.os.Parcel;
import android.os.Parcelable;
@@ -325,9 +328,10 @@ public class KeyguardHostView extends KeyguardViewBase {
            return;
        }

        Drawable back = null;
        if (!background.isEmpty()) {
            try {
                setBackgroundColor(Integer.parseInt(background));
                back = new ColorDrawable(Integer.parseInt(background));
            } catch(NumberFormatException e) {
                Log.e(TAG, "Invalid background color " + background);
            }
@@ -336,11 +340,15 @@ public class KeyguardHostView extends KeyguardViewBase {
                Context settingsContext = getContext().createPackageContext("com.android.settings", 0);
                String wallpaperFile = settingsContext.getFilesDir() + "/lockwallpaper";
                Bitmap backgroundBitmap = BitmapFactory.decodeFile(wallpaperFile);
                setBackgroundDrawable(new BitmapDrawable(backgroundBitmap));
                back = new BitmapDrawable(getContext().getResources(), backgroundBitmap);
            } catch (NameNotFoundException e) {
                // Do nothing here
            }
        }
        if (back != null) {
            back.setColorFilter(BACKGROUND_COLOR, PorterDuff.Mode.MULTIPLY);
            setBackground(back);
        }
    }

    private boolean shouldEnableAddWidget() {
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ import android.widget.FrameLayout;
 */
public abstract class KeyguardViewBase extends FrameLayout {

    private static final int BACKGROUND_COLOR = 0x70000000;
    protected static final int BACKGROUND_COLOR = 0x70000000;
    private AudioManager mAudioManager;
    private TelephonyManager mTelephonyManager = null;
    protected KeyguardViewMediator.ViewMediatorCallback mViewMediatorCallback;