diff options
| author | 2018-03-02 17:24:10 +0000 | |
|---|---|---|
| committer | 2018-03-02 23:57:32 +0000 | |
| commit | e9861b4b6565e65f632aabf73558410d719ef58e (patch) | |
| tree | 500bc0cedcf128c25262d3562a41bee08f21822a | |
| parent | 4462da8352e125298cb13565a5736ec4f43851b3 (diff) | |
Remove work mode tile if it is no longer available
BUG: 72328528
Test: Remove work profile and observe the QS tile is gone.
Change-Id: I3467d0ecbeb3f6a79cdcce3c73dbef12b7519aca
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tiles/WorkModeTile.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/WorkModeTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/WorkModeTile.java index 36906a5700e4..5bab3e8f39a4 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WorkModeTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WorkModeTile.java @@ -21,12 +21,11 @@ import android.provider.Settings; import android.service.quicksettings.Tile; import android.widget.Switch; -import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.systemui.Dependency; import com.android.systemui.R; -import com.android.systemui.qs.QSHost; import com.android.systemui.plugins.qs.QSTile.BooleanState; +import com.android.systemui.qs.QSHost; import com.android.systemui.qs.tileimpl.QSTileImpl; import com.android.systemui.statusbar.phone.ManagedProfileController; @@ -88,6 +87,10 @@ public class WorkModeTile extends QSTileImpl<BooleanState> implements @Override protected void handleUpdateState(BooleanState state, Object arg) { + if (!isAvailable()) { + onManagedProfileRemoved(); + } + if (state.slash == null) { state.slash = new SlashState(); } |