diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/communal/data/repository/CommunalSettingsRepository.kt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/communal/data/repository/CommunalSettingsRepository.kt b/packages/SystemUI/src/com/android/systemui/communal/data/repository/CommunalSettingsRepository.kt index e3ef6bbfad61..748c4fab5ee8 100644 --- a/packages/SystemUI/src/com/android/systemui/communal/data/repository/CommunalSettingsRepository.kt +++ b/packages/SystemUI/src/com/android/systemui/communal/data/repository/CommunalSettingsRepository.kt @@ -20,6 +20,7 @@ import android.app.admin.DevicePolicyManager import android.app.admin.DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL import android.content.IntentFilter import android.content.pm.UserInfo +import android.os.UserHandle import android.provider.Settings import com.android.systemui.Flags.communalHub import com.android.systemui.broadcast.BroadcastDispatcher @@ -102,7 +103,10 @@ constructor( .broadcastFlow( filter = IntentFilter(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED), - user = user.userHandle + // In COPE management mode, the restriction from the managed profile may + // propagate to the main profile. Therefore listen to this broadcast across + // all users and update the state each time it changes. + user = UserHandle.ALL, ) .emitOnStart() .map { devicePolicyManager.areKeyguardWidgetsAllowed(user.id) } |