Loading packages/SystemUI/src/com/android/systemui/controls/controller/ControlsControllerImpl.kt +5 −3 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ class ControlsControllerImpl @Inject constructor ( internal const val CONTROLS_AVAILABLE = "systemui.controls_available" internal val URI = Settings.Secure.getUriFor(CONTROLS_AVAILABLE) private const val USER_CHANGE_RETRY_DELAY = 500L // ms private const val DEFAULT_ENABLED = 1 } // Map of map: ComponentName -> (String -> ControlInfo). Loading @@ -79,7 +80,8 @@ class ControlsControllerImpl @Inject constructor ( private val contentResolver: ContentResolver get() = context.contentResolver override var available = Settings.Secure.getInt(contentResolver, CONTROLS_AVAILABLE, 0) != 0 override var available = Settings.Secure.getInt( contentResolver, CONTROLS_AVAILABLE, DEFAULT_ENABLED) != 0 private set private var currentUser = context.user Loading @@ -104,7 +106,7 @@ class ControlsControllerImpl @Inject constructor ( userContext.filesDir, ControlsFavoritePersistenceWrapper.FILE_NAME) persistenceWrapper.changeFile(fileName) available = Settings.Secure.getIntForUser(contentResolver, CONTROLS_AVAILABLE, /* default */ 0, newUser.identifier) != 0 /* default */ DEFAULT_ENABLED, newUser.identifier) != 0 synchronized(currentFavorites) { currentFavorites.clear() } Loading Loading @@ -140,7 +142,7 @@ class ControlsControllerImpl @Inject constructor ( return } available = Settings.Secure.getIntForUser(contentResolver, CONTROLS_AVAILABLE, /* default */ 0, currentUserId) != 0 /* default */ DEFAULT_ENABLED, currentUserId) != 0 synchronized(currentFavorites) { currentFavorites.clear() } Loading packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +10 −2 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ import com.android.systemui.MultiListLayout; import com.android.systemui.MultiListLayout.MultiListAdapter; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.controls.management.ControlsListingController; import com.android.systemui.controls.ui.ControlsUiController; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; Loading Loading @@ -189,6 +190,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private ControlsUiController mControlsUiController; private final IWindowManager mIWindowManager; private final Executor mBackgroundExecutor; private final ControlsListingController mControlsListingController; private boolean mAnyControlsProviders = false; /** * @param context everything needs a context :( Loading @@ -208,7 +211,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, ControlsUiController controlsUiController, IWindowManager iWindowManager, @Background Executor backgroundExecutor) { @Background Executor backgroundExecutor, ControlsListingController controlsListingController) { mContext = new ContextThemeWrapper(context, com.android.systemui.R.style.qs_theme); mWindowManagerFuncs = windowManagerFuncs; mAudioManager = audioManager; Loading @@ -232,6 +236,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mControlsUiController = controlsUiController; mIWindowManager = iWindowManager; mBackgroundExecutor = backgroundExecutor; mControlsListingController = controlsListingController; // receive broadcasts IntentFilter filter = new IntentFilter(); Loading Loading @@ -268,6 +273,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } } }); mControlsListingController.addCallback(list -> mAnyControlsProviders = !list.isEmpty()); } /** Loading Loading @@ -1914,6 +1921,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private boolean shouldShowControls() { return mKeyguardStateController.isUnlocked() && mControlsUiController.getAvailable(); && mControlsUiController.getAvailable() && mAnyControlsProviders; } } Loading
packages/SystemUI/src/com/android/systemui/controls/controller/ControlsControllerImpl.kt +5 −3 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ class ControlsControllerImpl @Inject constructor ( internal const val CONTROLS_AVAILABLE = "systemui.controls_available" internal val URI = Settings.Secure.getUriFor(CONTROLS_AVAILABLE) private const val USER_CHANGE_RETRY_DELAY = 500L // ms private const val DEFAULT_ENABLED = 1 } // Map of map: ComponentName -> (String -> ControlInfo). Loading @@ -79,7 +80,8 @@ class ControlsControllerImpl @Inject constructor ( private val contentResolver: ContentResolver get() = context.contentResolver override var available = Settings.Secure.getInt(contentResolver, CONTROLS_AVAILABLE, 0) != 0 override var available = Settings.Secure.getInt( contentResolver, CONTROLS_AVAILABLE, DEFAULT_ENABLED) != 0 private set private var currentUser = context.user Loading @@ -104,7 +106,7 @@ class ControlsControllerImpl @Inject constructor ( userContext.filesDir, ControlsFavoritePersistenceWrapper.FILE_NAME) persistenceWrapper.changeFile(fileName) available = Settings.Secure.getIntForUser(contentResolver, CONTROLS_AVAILABLE, /* default */ 0, newUser.identifier) != 0 /* default */ DEFAULT_ENABLED, newUser.identifier) != 0 synchronized(currentFavorites) { currentFavorites.clear() } Loading Loading @@ -140,7 +142,7 @@ class ControlsControllerImpl @Inject constructor ( return } available = Settings.Secure.getIntForUser(contentResolver, CONTROLS_AVAILABLE, /* default */ 0, currentUserId) != 0 /* default */ DEFAULT_ENABLED, currentUserId) != 0 synchronized(currentFavorites) { currentFavorites.clear() } Loading
packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +10 −2 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ import com.android.systemui.MultiListLayout; import com.android.systemui.MultiListLayout.MultiListAdapter; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.controls.management.ControlsListingController; import com.android.systemui.controls.ui.ControlsUiController; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.dagger.qualifiers.Main; Loading Loading @@ -189,6 +190,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private ControlsUiController mControlsUiController; private final IWindowManager mIWindowManager; private final Executor mBackgroundExecutor; private final ControlsListingController mControlsListingController; private boolean mAnyControlsProviders = false; /** * @param context everything needs a context :( Loading @@ -208,7 +211,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, IStatusBarService statusBarService, NotificationShadeWindowController notificationShadeWindowController, ControlsUiController controlsUiController, IWindowManager iWindowManager, @Background Executor backgroundExecutor) { @Background Executor backgroundExecutor, ControlsListingController controlsListingController) { mContext = new ContextThemeWrapper(context, com.android.systemui.R.style.qs_theme); mWindowManagerFuncs = windowManagerFuncs; mAudioManager = audioManager; Loading @@ -232,6 +236,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mControlsUiController = controlsUiController; mIWindowManager = iWindowManager; mBackgroundExecutor = backgroundExecutor; mControlsListingController = controlsListingController; // receive broadcasts IntentFilter filter = new IntentFilter(); Loading Loading @@ -268,6 +273,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } } }); mControlsListingController.addCallback(list -> mAnyControlsProviders = !list.isEmpty()); } /** Loading Loading @@ -1914,6 +1921,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private boolean shouldShowControls() { return mKeyguardStateController.isUnlocked() && mControlsUiController.getAvailable(); && mControlsUiController.getAvailable() && mAnyControlsProviders; } }