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

Skip to content
Commit 02c4a81e authored by Hai Zhang's avatar Hai Zhang
Browse files

Revert "Revert "Persist permission state for updated apps synchronously.""

This reverts commit cebec6c3.

The root cause for the previous regression is that when a new user is
added, the replace parameter will be true for every package (despite they
aren't being actually replaced),  thus a synchronous write will be done
for every one of them and the PM lock will be blocked and main thread
will be held for a very long time, causing ANR in apps calling into
system server at the same time.

The proper fix would be renaming the replace parameter and the relevant
flags like UPDATE_PERMISSIONS_REPLACE(_ALL) into something like
regrantInstallPermissions that better describes its use, and then
introduce another parameter that actually represents whether the package
is being replaced. But since we are late in T now and naming is hard,
this double revert simply re-purposes the existing changing package name
to indicate whether there is actually a changing package, and only write
synchronously in that case.

Fixes: 221899913
Test: android.platform.test.scenario.sysui.multiuser.AddGuest
Change-Id: Ifa40b435c2ad8d04050fd5c5972408e61aeea64d
parent e020d397
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment