Merge "Only try disabling quiet mode" into nyc-dev

This commit is contained in:
Benjamin Franz
2016-04-15 14:53:16 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 2 deletions

View File

@@ -251,7 +251,11 @@ public class AccountSettings extends SettingsPreferenceFragment
ProfileData profileData = mProfiles.valueAt(i); ProfileData profileData = mProfiles.valueAt(i);
if (preference == profileData.workModeSwitch) { if (preference == profileData.workModeSwitch) {
final int userId = profileData.userInfo.id; final int userId = profileData.userInfo.id;
mUm.setQuietModeEnabled(userId, !((boolean) newValue)); if ((boolean) newValue) {
mUm.trySetQuietModeDisabled(userId, null);
} else {
mUm.setQuietModeEnabled(userId, true);
}
return true; return true;
} }
} }

View File

@@ -90,7 +90,7 @@ public class WorkModeCondition extends Condition {
@Override @Override
public void onActionClick(int index) { public void onActionClick(int index) {
if (index == 0) { if (index == 0) {
mUm.setQuietModeEnabled(mUserHandle.getIdentifier(), false); mUm.trySetQuietModeDisabled(mUserHandle.getIdentifier(), null);
setActive(false); setActive(false);
} else { } else {
throw new IllegalArgumentException("Unexpected index " + index); throw new IllegalArgumentException("Unexpected index " + index);