Loading packages/SystemUI/AndroidManifest.xml +3 −0 Original line number Diff line number Diff line Loading @@ -259,6 +259,9 @@ <!-- Permission to register process observer --> <uses-permission android:name="android.permission.SET_ACTIVITY_WATCHER"/> <!-- Restore settings (used by QS) even if they have been modified --> <uses-permission android:name="android.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE" /> <protected-broadcast android:name="com.android.settingslib.action.REGISTER_SLICE_RECEIVER" /> <protected-broadcast android:name="com.android.settingslib.action.UNREGISTER_SLICE_RECEIVER" /> <protected-broadcast android:name="com.android.settings.flashlight.action.FLASHLIGHT_CHANGED" /> Loading packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java +10 −6 Original line number Diff line number Diff line Loading @@ -339,13 +339,18 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, D changeTileSpecs(tileSpecs-> !tileSpecs.contains(spec) && tileSpecs.add(spec)); } private void saveTilesToSettings(List<String> tileSpecs) { Settings.Secure.putStringForUser(mContext.getContentResolver(), TILES_SETTING, TextUtils.join(",", tileSpecs), null /* tag */, false /* default */, mCurrentUser, true /* overrideable by restore */); } private void changeTileSpecs(Predicate<List<String>> changeFunction) { final String setting = Settings.Secure.getStringForUser(mContext.getContentResolver(), TILES_SETTING, ActivityManager.getCurrentUser()); TILES_SETTING, mCurrentUser); final List<String> tileSpecs = loadTileSpecs(mContext, setting); if (changeFunction.test(tileSpecs)) { Settings.Secure.putStringForUser(mContext.getContentResolver(), TILES_SETTING, TextUtils.join(",", tileSpecs), ActivityManager.getCurrentUser()); saveTilesToSettings(tileSpecs); } } Loading Loading @@ -375,7 +380,7 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, D Intent intent = new Intent().setComponent(component); TileLifecycleManager lifecycleManager = new TileLifecycleManager(new Handler(), mContext, mServices, new Tile(), intent, new UserHandle(ActivityManager.getCurrentUser()), new UserHandle(mCurrentUser), mBroadcastDispatcher); lifecycleManager.onStopListening(); lifecycleManager.onTileRemoved(); Loading @@ -384,8 +389,7 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, D } } if (DEBUG) Log.d(TAG, "saveCurrentTiles " + newTiles); Secure.putStringForUser(getContext().getContentResolver(), QSTileHost.TILES_SETTING, TextUtils.join(",", newTiles), ActivityManager.getCurrentUser()); saveTilesToSettings(newTiles); } public QSTile createTile(String tileSpec) { Loading Loading
packages/SystemUI/AndroidManifest.xml +3 −0 Original line number Diff line number Diff line Loading @@ -259,6 +259,9 @@ <!-- Permission to register process observer --> <uses-permission android:name="android.permission.SET_ACTIVITY_WATCHER"/> <!-- Restore settings (used by QS) even if they have been modified --> <uses-permission android:name="android.permission.MODIFY_SETTINGS_OVERRIDEABLE_BY_RESTORE" /> <protected-broadcast android:name="com.android.settingslib.action.REGISTER_SLICE_RECEIVER" /> <protected-broadcast android:name="com.android.settingslib.action.UNREGISTER_SLICE_RECEIVER" /> <protected-broadcast android:name="com.android.settings.flashlight.action.FLASHLIGHT_CHANGED" /> Loading
packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java +10 −6 Original line number Diff line number Diff line Loading @@ -339,13 +339,18 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, D changeTileSpecs(tileSpecs-> !tileSpecs.contains(spec) && tileSpecs.add(spec)); } private void saveTilesToSettings(List<String> tileSpecs) { Settings.Secure.putStringForUser(mContext.getContentResolver(), TILES_SETTING, TextUtils.join(",", tileSpecs), null /* tag */, false /* default */, mCurrentUser, true /* overrideable by restore */); } private void changeTileSpecs(Predicate<List<String>> changeFunction) { final String setting = Settings.Secure.getStringForUser(mContext.getContentResolver(), TILES_SETTING, ActivityManager.getCurrentUser()); TILES_SETTING, mCurrentUser); final List<String> tileSpecs = loadTileSpecs(mContext, setting); if (changeFunction.test(tileSpecs)) { Settings.Secure.putStringForUser(mContext.getContentResolver(), TILES_SETTING, TextUtils.join(",", tileSpecs), ActivityManager.getCurrentUser()); saveTilesToSettings(tileSpecs); } } Loading Loading @@ -375,7 +380,7 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, D Intent intent = new Intent().setComponent(component); TileLifecycleManager lifecycleManager = new TileLifecycleManager(new Handler(), mContext, mServices, new Tile(), intent, new UserHandle(ActivityManager.getCurrentUser()), new UserHandle(mCurrentUser), mBroadcastDispatcher); lifecycleManager.onStopListening(); lifecycleManager.onTileRemoved(); Loading @@ -384,8 +389,7 @@ public class QSTileHost implements QSHost, Tunable, PluginListener<QSFactory>, D } } if (DEBUG) Log.d(TAG, "saveCurrentTiles " + newTiles); Secure.putStringForUser(getContext().getContentResolver(), QSTileHost.TILES_SETTING, TextUtils.join(",", newTiles), ActivityManager.getCurrentUser()); saveTilesToSettings(newTiles); } public QSTile createTile(String tileSpec) { Loading