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

Skip to content
Commit 1b439556 authored by Eric Rahm's avatar Eric Rahm Committed by Abhijit Adsule
Browse files

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
parent 2d0123fd
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