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

Commit c7d1f62f authored by Thomas Vannet's avatar Thomas Vannet
Browse files

Synchronously revoke permissions on OTP session end when kill delay is 0

This addresses a race condition where a process could be restarted
before the delayed call happens, even when the delay is 0.

Test: manual
Bug: 221785285
Change-Id: I01c3c585cbd8d94e636ecaf439919014d8189d03
Merged-In: I01c3c585cbd8d94e636ecaf439919014d8189d03
parent a427d626
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -272,6 +272,10 @@ public class OneTimePermissionUserManager {
                mHandler.removeCallbacksAndMessages(mToken);

                if (importance > IMPORTANCE_CACHED) {
                    if (mRevokeAfterKilledDelay == 0) {
                        onPackageInactiveLocked();
                        return;
                    }
                    // Delay revocation in case app is restarting
                    mHandler.postDelayed(() -> {
                        int imp = mActivityManager.getUidImportance(mUid);