Commit ab139448 authored by Joey's avatar Joey Committed by Luca Stefani

systemUi: styles: support more dark overlays

Change-Id: I4fafa2b1e342608e2690c3dda7cb06aaf88247ba
Signed-off-by: default avatarJoey <joey@lineageos.org>
parent 4489d3ae
......@@ -274,6 +274,7 @@ import java.util.Stack;
import lineageos.hardware.LiveDisplayManager;
import lineageos.providers.LineageSettings;
import lineageos.style.StyleInterface;
public class StatusBar extends SystemUI implements DemoMode,
DragDownHelper.DragDownCallback, ActivityStarter, OnUnlockMethodChangedListener,
......@@ -3027,8 +3028,8 @@ public class StatusBar extends SystemUI implements DemoMode,
public boolean isUsingDarkTheme() {
OverlayInfo systemuiThemeInfo = null;
try {
systemuiThemeInfo = mOverlayManager.getOverlayInfo("org.lineageos.overlay.dark",
mCurrentUserId);
String darkTheme = getDarkOverlay();
systemuiThemeInfo = mOverlayManager.getOverlayInfo(darkTheme, mCurrentUserId);
} catch (RemoteException e) {
e.printStackTrace();
}
......@@ -3047,6 +3048,12 @@ public class StatusBar extends SystemUI implements DemoMode,
return false;
}
private String getDarkOverlay() {
return LineageSettings.System.getString(mContext.getContentResolver(),
LineageSettings.System.BERRY_DARK_OVERLAY,
StyleInterface.OVERLAY_DARK_DEFAULT);
}
@Nullable
public View getAmbientIndicationContainer() {
return mAmbientIndicationContainer;
......@@ -4974,8 +4981,8 @@ public class StatusBar extends SystemUI implements DemoMode,
if (isUsingDarkTheme() != useDarkTheme) {
try {
mOverlayManager.setEnabled("org.lineageos.overlay.dark",
useDarkTheme, mCurrentUserId);
String darkOverlay = getDarkOverlay();
mOverlayManager.setEnabled(darkOverlay, useDarkTheme, mCurrentUserId);
} catch (RemoteException e) {
Log.w(TAG, "Can't change theme", e);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment