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

Commit 4453eec6 authored by beanstown106's avatar beanstown106 Committed by Bruno Martins
Browse files

base: Allow to disable Lockscreen Media Art [1/3]

Change-Id: Id93e115649df5d6dc680101a8c852644b217c28a
parent 58088b7f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -281,6 +281,8 @@ public class StatusBar extends SystemUI implements DemoMode, TunerService.Tunabl
            "system:" + Settings.System.SCREEN_BRIGHTNESS_MODE;
    private static final String STATUS_BAR_BRIGHTNESS_CONTROL =
            "lineagesystem:" + LineageSettings.System.STATUS_BAR_BRIGHTNESS_CONTROL;
    private static final String LOCKSCREEN_MEDIA_METADATA =
            "lineagesecure:" + LineageSettings.Secure.LOCKSCREEN_MEDIA_METADATA;

    private static final String BANNER_ACTION_CANCEL =
            "com.android.systemui.statusbar.banner_action_cancel";
@@ -550,6 +552,7 @@ public class StatusBar extends SystemUI implements DemoMode, TunerService.Tunabl
    private VisualizerView mVisualizerView;
    private boolean mScreenOn;
    private boolean mKeyguardShowingMedia;
    private boolean mShowMediaMetadata;

    private BroadcastReceiver mWallpaperChangedReceiver = new BroadcastReceiver() {
        @Override
@@ -698,6 +701,7 @@ public class StatusBar extends SystemUI implements DemoMode, TunerService.Tunabl
        final TunerService tunerService = Dependency.get(TunerService.class);
        tunerService.addTunable(this, SCREEN_BRIGHTNESS_MODE);
        tunerService.addTunable(this, STATUS_BAR_BRIGHTNESS_CONTROL);
        tunerService.addTunable(this, LOCKSCREEN_MEDIA_METADATA);

        mDisplayManager = mContext.getSystemService(DisplayManager.class);

@@ -1677,7 +1681,7 @@ public class StatusBar extends SystemUI implements DemoMode, TunerService.Tunabl
        }

        Drawable artworkDrawable = null;
        if (mediaMetadata != null) {
        if (mediaMetadata != null && mShowMediaMetadata) {
            Bitmap artworkBitmap = mediaMetadata.getBitmap(MediaMetadata.METADATA_KEY_ART);
            if (artworkBitmap == null) {
                artworkBitmap = mediaMetadata.getBitmap(MediaMetadata.METADATA_KEY_ALBUM_ART);
@@ -5770,6 +5774,8 @@ public class StatusBar extends SystemUI implements DemoMode, TunerService.Tunabl
                    == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
        } else if (STATUS_BAR_BRIGHTNESS_CONTROL.equals(key)) {
            mBrightnessControl = newValue != null && Integer.parseInt(newValue) == 1;
        } else if (LOCKSCREEN_MEDIA_METADATA.equals(key)) {
            mShowMediaMetadata = newValue != null && Integer.parseInt(newValue) == 1;
        }
    }
    // End Extra BaseStatusBarMethods.