Prompt credentials for installing/deleting sounds

Actually we probably want to confirm credentials in all locked cases
not just when starting the user -- fewer corners to special case.

Fix: 34734809
Test: manual. set a work profile lock, screen off/on, open sound settings, try to set a work ringtone. first attempt should prompt for credentials, second attempt should not until next screen-off.
Change-Id: I1fea94f3b0d1b768b22741b887d9891f5e318549
This commit is contained in:
Robin Lee
2017-02-10 15:32:49 +00:00
parent aa6e4b5b93
commit cccf3244b6
2 changed files with 13 additions and 2 deletions

View File

@@ -46,7 +46,7 @@ public class DefaultRingtonePreference extends RingtonePreference {
@Override
public void performClick() {
if (mUserId != UserHandle.USER_CURRENT) {
if (Utils.unlockWorkProfileIfNecessary(getContext(), mUserId) ||
if (Utils.confirmWorkProfileCredentialsIfNecessary(getContext(), mUserId) ||
Utils.startQuietModeDialogIfNecessary(getContext(),
UserManager.get(getContext()), mUserId)) {
return;