Loading packages/SystemUI/multivalentTests/src/com/android/systemui/user/ui/viewmodel/StatusBarUserChipViewModelTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -265,7 +265,7 @@ class StatusBarUserChipViewModelTest : SysuiTestCase() { guestUserInteractor = guestUserInteractor, uiEventLogger = uiEventLogger, userRestrictionChecker = mock(), processWrapper = ProcessWrapperFake() processWrapper = ProcessWrapperFake(activityManager) ) ) } Loading packages/SystemUI/multivalentTests/src/com/android/systemui/user/ui/viewmodel/UserSwitcherViewModelTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ class UserSwitcherViewModelTest : SysuiTestCase() { guestUserInteractor = guestUserInteractor, uiEventLogger = uiEventLogger, userRestrictionChecker = mock(), processWrapper = ProcessWrapperFake() processWrapper = ProcessWrapperFake(activityManager) ), guestUserInteractor = guestUserInteractor, ) Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +7 −5 Original line number Diff line number Diff line Loading @@ -3594,12 +3594,13 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, // windows that appear on top, ever int flags = StatusBarManager.DISABLE_NONE; // TODO (b/155663717) After restart, status bar will not properly hide home button // TODO(b/155663717): After restart, status bar will not properly hide home button // unless disable is called to show un-hide it once first if (forceClearFlags) { if (UserManager.isVisibleBackgroundUsersEnabled() && !mProcessWrapper.isSystemUser() && !mProcessWrapper.isForegroundUser()) { // TODO: b/341604160 - Support visible background users properly. && !mProcessWrapper.isSystemUser() && !mProcessWrapper.isForegroundUserOrProfile()) { // TODO(b/341604160): Support visible background users properly. if (DEBUG) { Log.d(TAG, "Status bar manager is disabled for visible background users"); } Loading Loading @@ -3635,8 +3636,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, if (!SceneContainerFlag.isEnabled()) { if (UserManager.isVisibleBackgroundUsersEnabled() && !mProcessWrapper.isSystemUser() && !mProcessWrapper.isForegroundUser()) { // TODO: b/341604160 - Support visible background users properly. && !mProcessWrapper.isSystemUser() && !mProcessWrapper.isForegroundUserOrProfile()) { // TODO(b/341604160): Support visible background users properly. if (DEBUG) { Log.d(TAG, "Status bar manager is disabled for visible background users"); } Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/StatusBarDisableFlagsInteractor.kt +25 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,10 @@ import android.content.Context import android.os.Binder import android.os.IBinder import android.os.RemoteException import android.os.UserManager import android.provider.DeviceConfig import android.util.Log import com.android.app.tracing.coroutines.launchTraced as launch import com.android.internal.config.sysui.SystemUiDeviceConfigFlags import com.android.internal.statusbar.IStatusBarService import com.android.systemui.CoreStartable Loading @@ -39,6 +42,7 @@ import com.android.systemui.navigation.domain.interactor.NavigationInteractor import com.android.systemui.power.domain.interactor.PowerInteractor import com.android.systemui.power.shared.model.WakeSleepReason import com.android.systemui.power.shared.model.WakefulnessModel import com.android.systemui.process.ProcessWrapper import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.shade.ShadeDisplayAware import com.android.systemui.user.domain.interactor.SelectedUserInteractor Loading @@ -49,9 +53,10 @@ import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map import com.android.app.tracing.coroutines.launchTraced as launch import kotlinx.coroutines.withContext private val TAG = StatusBarDisableFlagsInteractor::class.simpleName /** * Logic around StatusBarService#disableForUser, which is used to disable the home and recents * button in certain device states. Loading @@ -67,6 +72,7 @@ constructor( @Background private val backgroundDispatcher: CoroutineDispatcher, private val deviceEntryFaceAuthInteractor: DeviceEntryFaceAuthInteractor, private val statusBarService: IStatusBarService, private val processWrapper: ProcessWrapper, keyguardTransitionInteractor: KeyguardTransitionInteractor, selectedUserInteractor: SelectedUserInteractor, deviceConfigInteractor: DeviceConfigInteractor, Loading Loading @@ -141,6 +147,24 @@ constructor( return } // TODO(b/341604160): Remove this blocking logic once StatusBarManagerService supports // visible background users properly. if ( UserManager.isVisibleBackgroundUsersEnabled() && !processWrapper.isSystemUser() && !processWrapper.isForegroundUserOrProfile() ) { // Currently, only one SysUI process can register with IStatusBarService to listen // for the CommandQueue events. // In the Multi Display configuration with concurrent multi users (primarily used // in Automotive), a visible background user (Automotive Multi Display passengers) // could also access this code path. Given this limitation and we only allow the // current user's SysUI process to register with IStatusBarService, we need to prevent // calls into IStatusBarService from visible background users. Log.d(TAG, "Status bar manager is disabled for visible background users") return } scope.launch { disableFlagsForUserId.collect { (selectedUserId, flags) -> if (context.getSystemService(Context.STATUS_BAR_SERVICE) == null) { Loading packages/SystemUI/src/com/android/systemui/log/SessionTracker.java +4 −4 Original line number Diff line number Diff line Loading @@ -116,8 +116,8 @@ public class SessionTracker implements CoreStartable { mSessionToInstanceId.put(type, instanceId); if (UserManager.isVisibleBackgroundUsersEnabled() && !mProcessWrapper.isSystemUser() && !mProcessWrapper.isForegroundUser()) { // TODO: b/341604160 - Support visible background users properly. && !mProcessWrapper.isForegroundUserOrProfile()) { // TODO(b/341604160): Support visible background users properly. if (DEBUG) { Log.d(TAG, "Status bar manager is disabled for visible background users"); } Loading Loading @@ -155,8 +155,8 @@ public class SessionTracker implements CoreStartable { mUiEventLogger.log(endSessionUiEvent, instanceId); } if (UserManager.isVisibleBackgroundUsersEnabled() && !mProcessWrapper.isSystemUser() && !mProcessWrapper.isForegroundUser()) { // TODO: b/341604160 - Support visible background users properly. && !mProcessWrapper.isForegroundUserOrProfile()) { // TODO(b/341604160): Support visible background users properly. if (DEBUG) { Log.d(TAG, "Status bar manager is disabled for visible background users"); } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/user/ui/viewmodel/StatusBarUserChipViewModelTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -265,7 +265,7 @@ class StatusBarUserChipViewModelTest : SysuiTestCase() { guestUserInteractor = guestUserInteractor, uiEventLogger = uiEventLogger, userRestrictionChecker = mock(), processWrapper = ProcessWrapperFake() processWrapper = ProcessWrapperFake(activityManager) ) ) } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/user/ui/viewmodel/UserSwitcherViewModelTest.kt +1 −1 Original line number Diff line number Diff line Loading @@ -177,7 +177,7 @@ class UserSwitcherViewModelTest : SysuiTestCase() { guestUserInteractor = guestUserInteractor, uiEventLogger = uiEventLogger, userRestrictionChecker = mock(), processWrapper = ProcessWrapperFake() processWrapper = ProcessWrapperFake(activityManager) ), guestUserInteractor = guestUserInteractor, ) Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +7 −5 Original line number Diff line number Diff line Loading @@ -3594,12 +3594,13 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, // windows that appear on top, ever int flags = StatusBarManager.DISABLE_NONE; // TODO (b/155663717) After restart, status bar will not properly hide home button // TODO(b/155663717): After restart, status bar will not properly hide home button // unless disable is called to show un-hide it once first if (forceClearFlags) { if (UserManager.isVisibleBackgroundUsersEnabled() && !mProcessWrapper.isSystemUser() && !mProcessWrapper.isForegroundUser()) { // TODO: b/341604160 - Support visible background users properly. && !mProcessWrapper.isSystemUser() && !mProcessWrapper.isForegroundUserOrProfile()) { // TODO(b/341604160): Support visible background users properly. if (DEBUG) { Log.d(TAG, "Status bar manager is disabled for visible background users"); } Loading Loading @@ -3635,8 +3636,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, if (!SceneContainerFlag.isEnabled()) { if (UserManager.isVisibleBackgroundUsersEnabled() && !mProcessWrapper.isSystemUser() && !mProcessWrapper.isForegroundUser()) { // TODO: b/341604160 - Support visible background users properly. && !mProcessWrapper.isSystemUser() && !mProcessWrapper.isForegroundUserOrProfile()) { // TODO(b/341604160): Support visible background users properly. if (DEBUG) { Log.d(TAG, "Status bar manager is disabled for visible background users"); } Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/StatusBarDisableFlagsInteractor.kt +25 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,10 @@ import android.content.Context import android.os.Binder import android.os.IBinder import android.os.RemoteException import android.os.UserManager import android.provider.DeviceConfig import android.util.Log import com.android.app.tracing.coroutines.launchTraced as launch import com.android.internal.config.sysui.SystemUiDeviceConfigFlags import com.android.internal.statusbar.IStatusBarService import com.android.systemui.CoreStartable Loading @@ -39,6 +42,7 @@ import com.android.systemui.navigation.domain.interactor.NavigationInteractor import com.android.systemui.power.domain.interactor.PowerInteractor import com.android.systemui.power.shared.model.WakeSleepReason import com.android.systemui.power.shared.model.WakefulnessModel import com.android.systemui.process.ProcessWrapper import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.shade.ShadeDisplayAware import com.android.systemui.user.domain.interactor.SelectedUserInteractor Loading @@ -49,9 +53,10 @@ import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.map import com.android.app.tracing.coroutines.launchTraced as launch import kotlinx.coroutines.withContext private val TAG = StatusBarDisableFlagsInteractor::class.simpleName /** * Logic around StatusBarService#disableForUser, which is used to disable the home and recents * button in certain device states. Loading @@ -67,6 +72,7 @@ constructor( @Background private val backgroundDispatcher: CoroutineDispatcher, private val deviceEntryFaceAuthInteractor: DeviceEntryFaceAuthInteractor, private val statusBarService: IStatusBarService, private val processWrapper: ProcessWrapper, keyguardTransitionInteractor: KeyguardTransitionInteractor, selectedUserInteractor: SelectedUserInteractor, deviceConfigInteractor: DeviceConfigInteractor, Loading Loading @@ -141,6 +147,24 @@ constructor( return } // TODO(b/341604160): Remove this blocking logic once StatusBarManagerService supports // visible background users properly. if ( UserManager.isVisibleBackgroundUsersEnabled() && !processWrapper.isSystemUser() && !processWrapper.isForegroundUserOrProfile() ) { // Currently, only one SysUI process can register with IStatusBarService to listen // for the CommandQueue events. // In the Multi Display configuration with concurrent multi users (primarily used // in Automotive), a visible background user (Automotive Multi Display passengers) // could also access this code path. Given this limitation and we only allow the // current user's SysUI process to register with IStatusBarService, we need to prevent // calls into IStatusBarService from visible background users. Log.d(TAG, "Status bar manager is disabled for visible background users") return } scope.launch { disableFlagsForUserId.collect { (selectedUserId, flags) -> if (context.getSystemService(Context.STATUS_BAR_SERVICE) == null) { Loading
packages/SystemUI/src/com/android/systemui/log/SessionTracker.java +4 −4 Original line number Diff line number Diff line Loading @@ -116,8 +116,8 @@ public class SessionTracker implements CoreStartable { mSessionToInstanceId.put(type, instanceId); if (UserManager.isVisibleBackgroundUsersEnabled() && !mProcessWrapper.isSystemUser() && !mProcessWrapper.isForegroundUser()) { // TODO: b/341604160 - Support visible background users properly. && !mProcessWrapper.isForegroundUserOrProfile()) { // TODO(b/341604160): Support visible background users properly. if (DEBUG) { Log.d(TAG, "Status bar manager is disabled for visible background users"); } Loading Loading @@ -155,8 +155,8 @@ public class SessionTracker implements CoreStartable { mUiEventLogger.log(endSessionUiEvent, instanceId); } if (UserManager.isVisibleBackgroundUsersEnabled() && !mProcessWrapper.isSystemUser() && !mProcessWrapper.isForegroundUser()) { // TODO: b/341604160 - Support visible background users properly. && !mProcessWrapper.isForegroundUserOrProfile()) { // TODO(b/341604160): Support visible background users properly. if (DEBUG) { Log.d(TAG, "Status bar manager is disabled for visible background users"); } Loading