Loading packages/SystemUI/src/com/android/systemui/qs/AutoAddTracker.java +6 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,12 @@ public class AutoAddTracker { } } public void setTileRemoved(String tile) { if (mAutoAdded.remove(tile)) { saveTiles(); } } public void destroy() { mContext.getContentResolver().unregisterContentObserver(mObserver); } Loading packages/SystemUI/src/com/android/systemui/qs/QSHost.java +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ public interface QSHost { void removeCallback(Callback callback); TileServices getTileServices(); void removeTile(String tileSpec); void unmarkTileAsAutoAdded(String tileSpec); int indexOf(String tileSpec); Loading packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java +5 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,11 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory> { changeTileSpecs(tileSpecs-> tileSpecs.remove(spec)); } @Override public void unmarkTileAsAutoAdded(String spec) { mAutoTiles.unmarkTileAsAutoAdded(spec); } public void addTile(String spec) { changeTileSpecs(tileSpecs-> tileSpecs.add(spec)); } Loading packages/SystemUI/src/com/android/systemui/qs/tiles/WorkModeTile.java +1 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ public class WorkModeTile extends QSTileImpl<BooleanState> implements @Override public void onManagedProfileRemoved() { mHost.removeTile(getTileSpec()); mHost.unmarkTileAsAutoAdded(getTileSpec()); } @Override Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/AutoTileManager.java +4 −2 Original line number Diff line number Diff line Loading @@ -96,6 +96,10 @@ public class AutoTileManager { Dependency.get(ColorDisplayController.class).setListener(null); } public void unmarkTileAsAutoAdded(String tabSpec) { mAutoTracker.setTileRemoved(tabSpec); } private final ManagedProfileController.Callback mProfileCallback = new ManagedProfileController.Callback() { @Override Loading @@ -104,8 +108,6 @@ public class AutoTileManager { if (Dependency.get(ManagedProfileController.class).hasActiveProfile()) { mHost.addTile(WORK); mAutoTracker.setTileAdded(WORK); mHandler.post(() -> Dependency.get(ManagedProfileController.class) .removeCallback(mProfileCallback)); } } Loading Loading
packages/SystemUI/src/com/android/systemui/qs/AutoAddTracker.java +6 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,12 @@ public class AutoAddTracker { } } public void setTileRemoved(String tile) { if (mAutoAdded.remove(tile)) { saveTiles(); } } public void destroy() { mContext.getContentResolver().unregisterContentObserver(mObserver); } Loading
packages/SystemUI/src/com/android/systemui/qs/QSHost.java +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ public interface QSHost { void removeCallback(Callback callback); TileServices getTileServices(); void removeTile(String tileSpec); void unmarkTileAsAutoAdded(String tileSpec); int indexOf(String tileSpec); Loading
packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java +5 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,11 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory> { changeTileSpecs(tileSpecs-> tileSpecs.remove(spec)); } @Override public void unmarkTileAsAutoAdded(String spec) { mAutoTiles.unmarkTileAsAutoAdded(spec); } public void addTile(String spec) { changeTileSpecs(tileSpecs-> tileSpecs.add(spec)); } Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/WorkModeTile.java +1 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ public class WorkModeTile extends QSTileImpl<BooleanState> implements @Override public void onManagedProfileRemoved() { mHost.removeTile(getTileSpec()); mHost.unmarkTileAsAutoAdded(getTileSpec()); } @Override Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/AutoTileManager.java +4 −2 Original line number Diff line number Diff line Loading @@ -96,6 +96,10 @@ public class AutoTileManager { Dependency.get(ColorDisplayController.class).setListener(null); } public void unmarkTileAsAutoAdded(String tabSpec) { mAutoTracker.setTileRemoved(tabSpec); } private final ManagedProfileController.Callback mProfileCallback = new ManagedProfileController.Callback() { @Override Loading @@ -104,8 +108,6 @@ public class AutoTileManager { if (Dependency.get(ManagedProfileController.class).hasActiveProfile()) { mHost.addTile(WORK); mAutoTracker.setTileAdded(WORK); mHandler.post(() -> Dependency.get(ManagedProfileController.class) .removeCallback(mProfileCallback)); } } Loading