Update light mode when battery saver changes
Change-Id: I56b309222782d823d80a66c87d30eefed2ce5dc7 Fixes: 30150232
This commit is contained in:
@@ -27,7 +27,7 @@ import static com.android.systemui.statusbar.phone.BarTransitions.MODE_TRANSPARE
|
|||||||
/**
|
/**
|
||||||
* Controls how light status bar flag applies to the icons.
|
* Controls how light status bar flag applies to the icons.
|
||||||
*/
|
*/
|
||||||
public class LightStatusBarController {
|
public class LightStatusBarController implements BatteryController.BatteryStateChangeCallback {
|
||||||
|
|
||||||
private final StatusBarIconController mIconController;
|
private final StatusBarIconController mIconController;
|
||||||
private final BatteryController mBatteryController;
|
private final BatteryController mBatteryController;
|
||||||
@@ -37,6 +37,7 @@ public class LightStatusBarController {
|
|||||||
private int mDockedStackVisibility;
|
private int mDockedStackVisibility;
|
||||||
private boolean mFullscreenLight;
|
private boolean mFullscreenLight;
|
||||||
private boolean mDockedLight;
|
private boolean mDockedLight;
|
||||||
|
private int mLastStatusBarMode;
|
||||||
|
|
||||||
private final Rect mLastFullscreenBounds = new Rect();
|
private final Rect mLastFullscreenBounds = new Rect();
|
||||||
private final Rect mLastDockedBounds = new Rect();
|
private final Rect mLastDockedBounds = new Rect();
|
||||||
@@ -45,6 +46,7 @@ public class LightStatusBarController {
|
|||||||
BatteryController batteryController) {
|
BatteryController batteryController) {
|
||||||
mIconController = iconController;
|
mIconController = iconController;
|
||||||
mBatteryController = batteryController;
|
mBatteryController = batteryController;
|
||||||
|
batteryController.addStateChangedCallback(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFingerprintUnlockController(
|
public void setFingerprintUnlockController(
|
||||||
@@ -73,6 +75,7 @@ public class LightStatusBarController {
|
|||||||
}
|
}
|
||||||
mFullscreenStackVisibility = newFullscreen;
|
mFullscreenStackVisibility = newFullscreen;
|
||||||
mDockedStackVisibility = newDocked;
|
mDockedStackVisibility = newDocked;
|
||||||
|
mLastStatusBarMode = statusBarMode;
|
||||||
mLastFullscreenBounds.set(fullscreenStackBounds);
|
mLastFullscreenBounds.set(fullscreenStackBounds);
|
||||||
mLastDockedBounds.set(dockedStackBounds);
|
mLastDockedBounds.set(dockedStackBounds);
|
||||||
}
|
}
|
||||||
@@ -123,4 +126,16 @@ public class LightStatusBarController {
|
|||||||
mIconController.setIconsDark(true, animateChange());
|
mIconController.setIconsDark(true, animateChange());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBatteryLevelChanged(int level, boolean pluggedIn, boolean charging) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPowerSaveChanged(boolean isPowerSave) {
|
||||||
|
onSystemUiVisibilityChanged(mFullscreenStackVisibility, mDockedStackVisibility,
|
||||||
|
0 /* mask */, mLastFullscreenBounds, mLastDockedBounds, true /* sbModeChange*/,
|
||||||
|
mLastStatusBarMode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user