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

Skip to content
Commit 9ba08918 authored by Evan Chen's avatar Evan Chen
Browse files

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
parent c9bdb0e7
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