Loading packages/SystemUI/res-keyguard/values/attrs.xml +0 −3 Original line number Diff line number Diff line Loading @@ -41,7 +41,4 @@ <declare-styleable name="CarrierText"> <attr name="allCaps" format="boolean" /> </declare-styleable> <attr name="pinDividerColor" format="color" /> <attr name="pinDeleteColor" format="color" /> </resources> packages/SystemUI/res/values/styles.xml +0 −2 Original line number Diff line number Diff line Loading @@ -295,8 +295,6 @@ <item name="darkIconTheme">@style/DualToneDarkTheme</item> <item name="bgProtectTextColor">?android:attr/textColorPrimaryInverse</item> <item name="bgProtectSecondaryTextColor">?android:attr/textColorSecondaryInverse</item> <item name="pinDividerColor">@color/pin_divider_color</item> <item name="pinDeleteColor">@color/pin_delete_color</item> <item name="*android:lockPatternStyle">@style/LockPatternStyle</item> </style> Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +45 −19 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.app.PendingIntent; import android.app.RemoteInput; import android.app.StatusBarManager; import android.app.TaskStackBuilder; import android.app.WallpaperColors; import android.app.WallpaperManager; import android.app.admin.DevicePolicyManager; import android.content.BroadcastReceiver; Loading Loading @@ -103,7 +104,6 @@ import android.os.UserHandle; import android.os.UserManager; import android.os.Vibrator; import android.provider.Settings; import android.service.notification.NotificationListenerService; import android.service.notification.NotificationListenerService.RankingMap; import android.service.notification.StatusBarNotification; import android.service.vr.IVrManager; Loading Loading @@ -139,6 +139,7 @@ import android.widget.RemoteViews; import android.widget.TextView; import android.widget.Toast; import com.android.internal.graphics.ColorUtils; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.messages.nano.SystemMessageProto.SystemMessage; Loading Loading @@ -213,7 +214,6 @@ import com.android.systemui.statusbar.notification.AboveShelfObserver; import com.android.systemui.statusbar.notification.InflationException; import com.android.systemui.statusbar.notification.RowInflaterTask; import com.android.systemui.statusbar.notification.VisualStabilityManager; import com.android.systemui.statusbar.phone.StatusBarIconController.IconManager; import com.android.systemui.statusbar.phone.UnlockMethodCache.OnUnlockMethodChangedListener; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.BatteryController.BatteryStateChangeCallback; Loading Loading @@ -1301,10 +1301,6 @@ public class StatusBar extends SystemUI implements DemoMode, } public void onOverlayChanged() { final boolean usingDarkTheme = isUsingDarkTheme(); if (DEBUG) { Log.d(TAG, "Updating theme because overlay changed. Is theme dark? " + usingDarkTheme); } reevaluateStyles(); // Clock and bottom icons Loading Loading @@ -2844,6 +2840,17 @@ public class StatusBar extends SystemUI implements DemoMode, updateTheme(); } public boolean isUsingDarkText() { OverlayInfo themeInfo = null; try { themeInfo = mOverlayManager.getOverlayInfo("com.android.systemui.theme.lightwallpaper", mCurrentUserId); } catch (RemoteException e) { e.printStackTrace(); } return themeInfo != null && themeInfo.isEnabled(); } public boolean isUsingDarkTheme() { OverlayInfo themeInfo = null; try { Loading Loading @@ -4531,30 +4538,49 @@ public class StatusBar extends SystemUI implements DemoMode, * Switches theme from light to dark and vice-versa. */ private void updateTheme() { boolean useDarkTheme; // Ignore visibility since we calculate the theme based on the real colors, // not the current state. int which; if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) { useDarkTheme = mColorExtractor.getColors(WallpaperManager.FLAG_LOCK, true /* vis */) .supportsDarkText(); which = WallpaperManager.FLAG_LOCK; } else { useDarkTheme = mColorExtractor.getColors(WallpaperManager.FLAG_SYSTEM, true /* vis */) which = WallpaperManager.FLAG_SYSTEM; } // Gradient defines if text color should be light or dark. final boolean useDarkText = mColorExtractor.getColors(which, true /* ignoreVisibility */) .supportsDarkText(); // And wallpaper defines if QS should be light or dark. boolean useDarkTheme = false; final WallpaperManager wallpaperManager = mContext.getSystemService(WallpaperManager.class); if (wallpaperManager != null) { WallpaperColors wallpaperColors = wallpaperManager .getWallpaperColors(WallpaperManager.FLAG_SYSTEM); if (wallpaperColors != null) { final int mainColor = wallpaperColors.getPrimaryColor().toArgb(); final float[] hsl = new float[3]; ColorUtils.colorToHSL(mainColor, hsl); useDarkTheme = hsl[2] < 0.2f; } } // Enable/Disable dark overlay // Enable/disable dark UI. if (isUsingDarkTheme() != useDarkTheme) { if (DEBUG) { Log.d(TAG, "Switching theme to: " + (useDarkTheme ? "Dark" : "Light")); } try { mOverlayManager.setEnabled("com.android.systemui.theme.dark", useDarkTheme, mCurrentUserId); } catch (RemoteException e) { Log.w(TAG, "Can't change theme", e); return; } mStatusBarWindowManager.setKeyguardDark(useDarkTheme); } // Enable/disable dark text overlay. if (isUsingDarkText() != useDarkText) { try { mOverlayManager.setEnabled("com.android.systemui.theme.lightwallpaper", useDarkText, mCurrentUserId); mStatusBarWindowManager.setKeyguardDark(useDarkText); } catch (RemoteException e) { Log.w(TAG, "Can't change theme", e); } } } Loading packages/SysuiDarkThemeOverlay/Android.mk→packages/overlays/SysuiDarkThemeOverlay/Android.mk +0 −0 File moved. View file packages/SysuiDarkThemeOverlay/AndroidManifest.xml→packages/overlays/SysuiDarkThemeOverlay/AndroidManifest.xml +0 −0 File moved. View file Loading
packages/SystemUI/res-keyguard/values/attrs.xml +0 −3 Original line number Diff line number Diff line Loading @@ -41,7 +41,4 @@ <declare-styleable name="CarrierText"> <attr name="allCaps" format="boolean" /> </declare-styleable> <attr name="pinDividerColor" format="color" /> <attr name="pinDeleteColor" format="color" /> </resources>
packages/SystemUI/res/values/styles.xml +0 −2 Original line number Diff line number Diff line Loading @@ -295,8 +295,6 @@ <item name="darkIconTheme">@style/DualToneDarkTheme</item> <item name="bgProtectTextColor">?android:attr/textColorPrimaryInverse</item> <item name="bgProtectSecondaryTextColor">?android:attr/textColorSecondaryInverse</item> <item name="pinDividerColor">@color/pin_divider_color</item> <item name="pinDeleteColor">@color/pin_delete_color</item> <item name="*android:lockPatternStyle">@style/LockPatternStyle</item> </style> Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +45 −19 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.app.PendingIntent; import android.app.RemoteInput; import android.app.StatusBarManager; import android.app.TaskStackBuilder; import android.app.WallpaperColors; import android.app.WallpaperManager; import android.app.admin.DevicePolicyManager; import android.content.BroadcastReceiver; Loading Loading @@ -103,7 +104,6 @@ import android.os.UserHandle; import android.os.UserManager; import android.os.Vibrator; import android.provider.Settings; import android.service.notification.NotificationListenerService; import android.service.notification.NotificationListenerService.RankingMap; import android.service.notification.StatusBarNotification; import android.service.vr.IVrManager; Loading Loading @@ -139,6 +139,7 @@ import android.widget.RemoteViews; import android.widget.TextView; import android.widget.Toast; import com.android.internal.graphics.ColorUtils; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.messages.nano.SystemMessageProto.SystemMessage; Loading Loading @@ -213,7 +214,6 @@ import com.android.systemui.statusbar.notification.AboveShelfObserver; import com.android.systemui.statusbar.notification.InflationException; import com.android.systemui.statusbar.notification.RowInflaterTask; import com.android.systemui.statusbar.notification.VisualStabilityManager; import com.android.systemui.statusbar.phone.StatusBarIconController.IconManager; import com.android.systemui.statusbar.phone.UnlockMethodCache.OnUnlockMethodChangedListener; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.BatteryController.BatteryStateChangeCallback; Loading Loading @@ -1301,10 +1301,6 @@ public class StatusBar extends SystemUI implements DemoMode, } public void onOverlayChanged() { final boolean usingDarkTheme = isUsingDarkTheme(); if (DEBUG) { Log.d(TAG, "Updating theme because overlay changed. Is theme dark? " + usingDarkTheme); } reevaluateStyles(); // Clock and bottom icons Loading Loading @@ -2844,6 +2840,17 @@ public class StatusBar extends SystemUI implements DemoMode, updateTheme(); } public boolean isUsingDarkText() { OverlayInfo themeInfo = null; try { themeInfo = mOverlayManager.getOverlayInfo("com.android.systemui.theme.lightwallpaper", mCurrentUserId); } catch (RemoteException e) { e.printStackTrace(); } return themeInfo != null && themeInfo.isEnabled(); } public boolean isUsingDarkTheme() { OverlayInfo themeInfo = null; try { Loading Loading @@ -4531,30 +4538,49 @@ public class StatusBar extends SystemUI implements DemoMode, * Switches theme from light to dark and vice-versa. */ private void updateTheme() { boolean useDarkTheme; // Ignore visibility since we calculate the theme based on the real colors, // not the current state. int which; if (mState == StatusBarState.KEYGUARD || mState == StatusBarState.SHADE_LOCKED) { useDarkTheme = mColorExtractor.getColors(WallpaperManager.FLAG_LOCK, true /* vis */) .supportsDarkText(); which = WallpaperManager.FLAG_LOCK; } else { useDarkTheme = mColorExtractor.getColors(WallpaperManager.FLAG_SYSTEM, true /* vis */) which = WallpaperManager.FLAG_SYSTEM; } // Gradient defines if text color should be light or dark. final boolean useDarkText = mColorExtractor.getColors(which, true /* ignoreVisibility */) .supportsDarkText(); // And wallpaper defines if QS should be light or dark. boolean useDarkTheme = false; final WallpaperManager wallpaperManager = mContext.getSystemService(WallpaperManager.class); if (wallpaperManager != null) { WallpaperColors wallpaperColors = wallpaperManager .getWallpaperColors(WallpaperManager.FLAG_SYSTEM); if (wallpaperColors != null) { final int mainColor = wallpaperColors.getPrimaryColor().toArgb(); final float[] hsl = new float[3]; ColorUtils.colorToHSL(mainColor, hsl); useDarkTheme = hsl[2] < 0.2f; } } // Enable/Disable dark overlay // Enable/disable dark UI. if (isUsingDarkTheme() != useDarkTheme) { if (DEBUG) { Log.d(TAG, "Switching theme to: " + (useDarkTheme ? "Dark" : "Light")); } try { mOverlayManager.setEnabled("com.android.systemui.theme.dark", useDarkTheme, mCurrentUserId); } catch (RemoteException e) { Log.w(TAG, "Can't change theme", e); return; } mStatusBarWindowManager.setKeyguardDark(useDarkTheme); } // Enable/disable dark text overlay. if (isUsingDarkText() != useDarkText) { try { mOverlayManager.setEnabled("com.android.systemui.theme.lightwallpaper", useDarkText, mCurrentUserId); mStatusBarWindowManager.setKeyguardDark(useDarkText); } catch (RemoteException e) { Log.w(TAG, "Can't change theme", e); } } } Loading
packages/SysuiDarkThemeOverlay/Android.mk→packages/overlays/SysuiDarkThemeOverlay/Android.mk +0 −0 File moved. View file
packages/SysuiDarkThemeOverlay/AndroidManifest.xml→packages/overlays/SysuiDarkThemeOverlay/AndroidManifest.xml +0 −0 File moved. View file