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