[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
Loading
Please register or sign in to comment