Suspend apps instead of stopping user in quiet mode
Previously enabling quiet mode meant shutting down work profile user completely, so no app code could run there. With this change Profile will no longer be shut down, but work apps will be suspended instead, so that the user still won't be able to use them or see their notifications. This change is necessary to enable telephony in the work profile as well as improve usability in other ways. Package suspension is stored on per-suspending package basis in package manager. Naturally, when packages are suspended for quiet mode, the suspending package must be "android". However when admin apps suspend packages via DPM.setPackagesSuspended() it is recoded as suspension by "android" too. To disambiguate between these cases this CL introduces two separate methods into SuspendPackageHelper - one for admin suspension and another for suspension for quiet mode. SuspendPackageHelper will combine the two suspensions when necessary and store the resulting state. Bug: 258823777 Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest Test: atest android.devicepolicy.cts.QuietModeTest Change-Id: Id100b77c265e3e8f4d7ce446a3ca365c50eb654e
Loading
Please register or sign in to comment