Delay role revoke when the app is not visible to the user
This cl fixes the problem that CDM calls RoleManager.removeRoleHolderAsUser() will kill the application's process that lead to the poor user experience. In order to fix the problem: 1. Introduce a new OnUidImportanceListener which watches the importance of the packages. In this class, we only interested in the importance of the running process is greater than IMPORTANCE_VISIBLE. 2. Introduce a new field in AssociationInfo class: 'mRevoked' to indicate the associaiton has been reovked and pending for role holder removal. So that the revoked association can store in the same place as the active associaiton -> easy maintenance. 3. Finally remove the role holder for the packages are not visible to the users. Bug: 189250370 Test: atest CtsCompanionDeviceManagerCoreTestCases atest CtsCompanionDeviceManagerUiAutomationTestCases atest CtsOsTestCases:CompanionDeviceManagerTest Change-Id: Ib7fb08b0d800c62a9ee708ddd52cd174de1829d9 Merged-In: Ib7fb08b0d800c62a9ee708ddd52cd174de1829d9
Loading
Please register or sign in to comment