Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 9ee8a8cd authored by Pavel Grafov's avatar Pavel Grafov
Browse files

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
parent ce712dee
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment