Fix theme change notification
Change-Id: Ia7caf5c5c21fcdf6b175ca5cde2f114fc8dd01f7 Bug: 199250382 Test: Manual, verifed that the bubble views colors are correctly updated after theme has been changed. Test: Screen recording: https://drive.google.com/file/d/1Cbd-EinvVPTnDUGYzrtGq1Ym5NqTKNzB/view?usp=sharing
This commit is contained in:
@@ -209,7 +209,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
|
||||
private ConfigurationController.ConfigurationListener mConfigurationListener =
|
||||
new ConfigurationController.ConfigurationListener() {
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
public void onThemeChanged() {
|
||||
mSecurityViewFlipperController.reloadColors();
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ public class KeyguardSliceViewController extends ViewController<KeyguardSliceVie
|
||||
mView.onDensityOrFontScaleChanged();
|
||||
}
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
public void onThemeChanged() {
|
||||
mView.onOverlayChanged();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -544,11 +544,6 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
|
||||
updateColors();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
updateColors();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigChanged(Configuration newConfig) {
|
||||
updateConfiguration();
|
||||
|
||||
@@ -86,7 +86,7 @@ public class AutoReinflateContainer extends FrameLayout implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
public void onThemeChanged() {
|
||||
inflateLayout();
|
||||
}
|
||||
|
||||
|
||||
@@ -272,9 +272,6 @@ class AuthRippleController @Inject constructor(
|
||||
override fun onThemeChanged() {
|
||||
updateRippleColor()
|
||||
}
|
||||
override fun onOverlayChanged() {
|
||||
updateRippleColor()
|
||||
}
|
||||
}
|
||||
|
||||
private val udfpsControllerCallback =
|
||||
|
||||
@@ -397,11 +397,6 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
|
||||
mView.updateColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
mView.updateColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigChanged(Configuration newConfig) {
|
||||
mView.updateColor();
|
||||
|
||||
@@ -148,7 +148,7 @@ class MediaCarouselController @Inject constructor(
|
||||
inflateSettingsButton()
|
||||
}
|
||||
|
||||
override fun onOverlayChanged() {
|
||||
override fun onThemeChanged() {
|
||||
recreatePlayers()
|
||||
inflateSettingsButton()
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public class NavigationModeController implements Dumpable {
|
||||
|
||||
configurationController.addCallback(new ConfigurationController.ConfigurationListener() {
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
public void onThemeChanged() {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "onOverlayChanged");
|
||||
}
|
||||
|
||||
@@ -114,9 +114,6 @@ class WiredChargingRippleController @Inject constructor(
|
||||
override fun onThemeChanged() {
|
||||
updateRippleColor()
|
||||
}
|
||||
override fun onOverlayChanged() {
|
||||
updateRippleColor()
|
||||
}
|
||||
|
||||
override fun onConfigChanged(newConfig: Configuration?) {
|
||||
normalizedPortPosX = context.resources.getFloat(
|
||||
|
||||
@@ -271,15 +271,6 @@ public class NotificationStackScrollLayoutController {
|
||||
mView.reinflateViews();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
updateShowEmptyShadeView();
|
||||
mView.updateCornerRadius();
|
||||
mView.updateBgColor();
|
||||
mView.updateDecorViews();
|
||||
mView.reinflateViews();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUiModeChanged() {
|
||||
mView.updateBgColor();
|
||||
@@ -288,6 +279,11 @@ public class NotificationStackScrollLayoutController {
|
||||
|
||||
@Override
|
||||
public void onThemeChanged() {
|
||||
updateShowEmptyShadeView();
|
||||
mView.updateCornerRadius();
|
||||
mView.updateBgColor();
|
||||
mView.updateDecorViews();
|
||||
mView.reinflateViews();
|
||||
updateFooter();
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ class ConfigurationControllerImpl(context: Context) : ConfigurationController {
|
||||
|
||||
if (lastConfig.updateFrom(newConfig) and ActivityInfo.CONFIG_ASSETS_PATHS != 0) {
|
||||
listeners.filterForEach({ this.listeners.contains(it) }) {
|
||||
it.onOverlayChanged()
|
||||
it.onThemeChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
public void onThemeChanged() {
|
||||
updateResources();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -99,14 +99,9 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
|
||||
mView.loadDimens();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
mView.onOverlayChanged();
|
||||
KeyguardStatusBarViewController.this.onThemeChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onThemeChanged() {
|
||||
mView.onOverlayChanged();
|
||||
KeyguardStatusBarViewController.this.onThemeChanged();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4258,12 +4258,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
@Override
|
||||
public void onThemeChanged() {
|
||||
if (DEBUG) Log.d(TAG, "onThemeChanged");
|
||||
final int themeResId = mView.getContext().getThemeResId();
|
||||
if (mThemeResId == themeResId) {
|
||||
return;
|
||||
}
|
||||
mThemeResId = themeResId;
|
||||
|
||||
mThemeResId = mView.getContext().getThemeResId();
|
||||
reInflateViews();
|
||||
}
|
||||
|
||||
@@ -4276,12 +4271,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
reInflateViews();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
if (DEBUG) Log.d(TAG, "onOverlayChanged");
|
||||
reInflateViews();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDensityOrFontScaleChanged() {
|
||||
if (DEBUG) Log.d(TAG, "onDensityOrFontScaleChanged");
|
||||
|
||||
@@ -261,11 +261,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
|
||||
ScrimController.this.onThemeChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
ScrimController.this.onThemeChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUiModeChanged() {
|
||||
ScrimController.this.onThemeChanged();
|
||||
|
||||
@@ -3260,16 +3260,13 @@ public class StatusBar extends SystemUI implements
|
||||
* Switches theme from light to dark and vice-versa.
|
||||
*/
|
||||
protected void updateTheme() {
|
||||
|
||||
// Lock wallpaper defines the color of the majority of the views, hence we'll use it
|
||||
// to set our default theme.
|
||||
final boolean lockDarkText = mColorExtractor.getNeutralColors().supportsDarkText();
|
||||
final int themeResId = lockDarkText ? R.style.Theme_SystemUI_LightWallpaper
|
||||
: R.style.Theme_SystemUI;
|
||||
if (mContext.getThemeResId() != themeResId) {
|
||||
mContext.setTheme(themeResId);
|
||||
mConfigurationController.notifyThemeChanged();
|
||||
}
|
||||
mContext.setTheme(themeResId);
|
||||
mConfigurationController.notifyThemeChanged();
|
||||
}
|
||||
|
||||
private void updateDozingState() {
|
||||
@@ -4380,6 +4377,13 @@ public class StatusBar extends SystemUI implements
|
||||
|
||||
@Override
|
||||
public void onThemeChanged() {
|
||||
if (mBrightnessMirrorController != null) {
|
||||
mBrightnessMirrorController.onOverlayChanged();
|
||||
}
|
||||
// We need the new R.id.keyguard_indication_area before recreating
|
||||
// mKeyguardIndicationController
|
||||
mNotificationPanelViewController.onThemeChanged();
|
||||
|
||||
if (mStatusBarKeyguardViewManager != null) {
|
||||
mStatusBarKeyguardViewManager.onThemeChanged();
|
||||
}
|
||||
@@ -4389,17 +4393,6 @@ public class StatusBar extends SystemUI implements
|
||||
mNotificationIconAreaController.onThemeChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
if (mBrightnessMirrorController != null) {
|
||||
mBrightnessMirrorController.onOverlayChanged();
|
||||
}
|
||||
// We need the new R.id.keyguard_indication_area before recreating
|
||||
// mKeyguardIndicationController
|
||||
mNotificationPanelViewController.onThemeChanged();
|
||||
onThemeChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUiModeChanged() {
|
||||
if (mBrightnessMirrorController != null) {
|
||||
|
||||
@@ -91,7 +91,7 @@ class StatusBarContentInsetsProvider @Inject constructor(
|
||||
clearCachedInsets()
|
||||
}
|
||||
|
||||
override fun onOverlayChanged() {
|
||||
override fun onThemeChanged() {
|
||||
clearCachedInsets()
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ import android.content.Context;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.SystemClock;
|
||||
import android.service.notification.NotificationListenerService;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.service.vr.IVrManager;
|
||||
import android.service.vr.IVrStateCallbacks;
|
||||
@@ -248,7 +247,7 @@ public class StatusBarNotificationPresenter implements NotificationPresenter,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
public void onThemeChanged() {
|
||||
onDensityOrFontScaleChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
public void onThemeChanged() {
|
||||
initResources();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -42,11 +42,6 @@ public class TapAgainViewController extends ViewController<TapAgainView> {
|
||||
|
||||
@VisibleForTesting
|
||||
final ConfigurationListener mConfigurationListener = new ConfigurationListener() {
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
mView.updateColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUiModeChanged() {
|
||||
mView.updateColor();
|
||||
|
||||
@@ -38,7 +38,6 @@ public interface ConfigurationController extends CallbackController<Configuratio
|
||||
default void onDensityOrFontScaleChanged() {}
|
||||
default void onSmallestScreenWidthChanged() {}
|
||||
default void onMaxBoundsChanged() {}
|
||||
default void onOverlayChanged() {}
|
||||
default void onUiModeChanged() {}
|
||||
default void onThemeChanged() {}
|
||||
default void onLocaleListChanged() {}
|
||||
|
||||
@@ -212,7 +212,7 @@ public final class WMShell extends SystemUI
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
public void onThemeChanged() {
|
||||
pip.onOverlayChanged();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user