Skip to content

Commit bbb1776

Browse files
MonkopediaAndroid Git Automerger
authored andcommitted
am 55dbf2d: Merge "QS: Allow Flashlight Tile to handle reset state" into mnc-dev
* commit '55dbf2d78e575b6c7b53e06aed17ff7406305a13': QS: Allow Flashlight Tile to handle reset state
2 parents 4e07468 + 55dbf2d commit bbb1776

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ protected void handleUpdateState(BooleanState state, Object arg) {
7979
return;
8080
}
8181
state.value = value;
82+
} else {
83+
state.value = mFlashlightController.isEnabled();
8284
}
8385
final AnimationIcon icon = state.value ? mEnable : mDisable;
8486
icon.setAllowAnimation(arg instanceof UserBoolean && ((UserBoolean) arg).userInitiated);

packages/SystemUI/src/com/android/systemui/statusbar/policy/FlashlightController.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ public void setFlashlight(boolean enabled) {
9393
}
9494
}
9595

96+
public synchronized boolean isEnabled() {
97+
return mFlashlightEnabled;
98+
}
99+
96100
public synchronized boolean isAvailable() {
97101
return mTorchAvailable;
98102
}

0 commit comments

Comments
 (0)