summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Eric Rahm <erahm@google.com> 2023-03-23 16:00:52 +0000
committer Abhijit Adsule <adsule@google.com> 2024-04-24 10:43:19 -0700
commit1b4395562ccf777d17b3f09fd3d857e1123dc3fb (patch)
tree0dec625149d830e041b5b3ed2e426f69c3bd73ca /libs/androidfw/StringPool.cpp
parent2d0123fd5f468d14748abc10b52555a702659f51 (diff)
Add INTERACT_ACROSS_USERS to soundpicker
This change re-lands ag/22205806 ag/22205806 added INTERACT_ACROSS_USERS permission in packages/SoundPicker/AndroidManifest.xml and privapp-permissions-platform.xml ag/24894829 removed it to support SoundPicker2 (bug introduced here) ag/26136396 removed SoundPicker2 later Adds the `INTERACT_ACROSS_USERS` permission to `android.com.soundpicker`. `SoundPicker` provides a `RingtonePickerActivity` which allows the user to choose a ringtone from all of the available ringtones. To support this is uses a `RingtoneManager` to retrieve a list of all available rintgtones including those of the parent profile. RingtoneManager optionally supports managing ringtones from the parent profile, this is controlled by a boolean flag that `RingtonePickerActivity` sets to true when creating its `RingtoneManager`. When enumerating ringtones one calls `RingtoneManager::getCursor` which builds a set of ringtones that includes “internal ringtones,” “media ringtones,” and optionally parent ringtones if the `RingtoneManager` was configured to included them when created. In this case it is configured to do so and will call `RingtoneManager::getParentRingtones`. This function retrieves the parent profile by calling `UserManager::getProfileParent` and gates following logic on whether or not a `UserInfo` is returned. `UserManager::getProfileParent` requires the caller to have either the `MANAGER_USERS` or `INTERACT_ACROSS_USERS` permission. Without the permission a security exception is thrown To ameliorate this we add the `INTERACT_ACROSS_USERS` permission to `SoundPicker` to indicate its intent to query the parent profile which matches the intent of `RingtonePickerActivity`. Bug: 178990696 Bug: 246352264 Bug: 327760628 Test: enable config_enableRingtoneSelection and verify that Settings > Sound > Watch ringtone works Change-Id: Ide033c3a40d0579b7cd3d1a641c5dc3ddf29fe67
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions