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

Commit b83bc9e7 authored by Jay Thomas Sullivan's avatar Jay Thomas Sullivan
Browse files

[ECM] Add delay before setMode

Currently a race condition happens when:

1. InstallPackageHelper recently sent a ACTION_PACKAGE_ADDED broadcast
2. AppOpsService hasn't received ACTION_PACKAGE_ADDED yet
3. InstallPackageHelper calls setMode.

In this situation, setMode silently fails, because AppOpsService
sees that mUidStates[uid][packageName] isn't populated yet, which
normally happens when ACTION_PACKAGE_ADDED is received.

This CL is a short-term mitigation to the problem, adding short delay
before InstallPackageHelper calls setMode to mitigate the race condition.
A more robust solution should be added in a follow-up CL.

Bug: 384418063
Flag: android.permission.flags.enhanced_confirmation_mode_apis_enabled
Test: atest CtsPermissionUiTestCases:android.permissionui.cts.EnhancedConfirmationManagerTest
Change-Id: Id5b7de1b4aa1bd486ae53aa7101bea91c5723fc5
parent 99d0b778
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