diff options
| author | 2024-12-19 01:51:49 +0000 | |
|---|---|---|
| committer | 2025-01-22 19:49:51 +0000 | |
| commit | a89d00f8769c0d75e924140bcc2413513116c40f (patch) | |
| tree | 52938bca2a43c176f8b83fca5e4801f09a04a1a8 /libs/androidfw/AssetsProvider.cpp | |
| parent | a42aeb704f233ab8645231a3f8b0c0dae088190a (diff) | |
Remove service when package is modified and service is no longer valid
For system services that are configured in multi mode, i.e support connecting to multiple services,
this change modifies the onPackageModified logic and does the following:
- Gets all services from default service list that are valid
- Loops through the services in the cache and removes a service that is not present in the default service list
- Retains the same logic for services that are still valid
This change is needed because services that become invalid after a package is modified
are ignored in the logic today, which means that they stop showing up in the settings UI
but are still active in the cache. Hence if a provider proactivly disables the services (hence
hiding it from the UI), the user is unable to see it in the settings. Then, if the developer
enables it programmatically, the service is valid again and can start receiving requests
without the user getting a chance to view it in between. This change handles changes in
package modification such that if a service becomes invalid, it is cleared from the cache
so that if it is programmatically enabled again, the user has to explicitly go into
settings and enable it (put it in secure settings).
Note that this change also retains the old logic for single mode services.
Bug: 351809293
Flag: android.credentials.flags.package_update_fix_enabled
Test: Locally deployed and tested
Change-Id: I8b579ac91c3e8cf37379adba686961c574bce254
Diffstat (limited to 'libs/androidfw/AssetsProvider.cpp')
0 files changed, 0 insertions, 0 deletions