Limit unconfigurability to specified channels.

am: 80fa6b5833

Change-Id: I63c40ae241f6891fa1e6b85a78dc78d2b918ca6d
This commit is contained in:
Alison Cichowlas
2017-06-13 01:45:10 +00:00
committed by android-build-merger
5 changed files with 164 additions and 9 deletions

View File

@@ -213,7 +213,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase {
private void setupVibrate() {
mVibrate = (RestrictedSwitchPreference) findPreference(KEY_VIBRATE);
mVibrate.setDisabledByAdmin(mSuspendedAppsAdmin);
mVibrate.setEnabled(!(mAppRow.lockedImportance || mVibrate.isDisabledByAdmin()));
mVibrate.setEnabled(!mVibrate.isDisabledByAdmin() && isChannelConfigurable(mChannel));
mVibrate.setChecked(mChannel.shouldVibrate());
mVibrate.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
@@ -230,7 +230,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase {
private void setupRingtone() {
mRingtone = (NotificationSoundPreference) findPreference(KEY_RINGTONE);
mRingtone.setRingtone(mChannel.getSound());
mRingtone.setEnabled(!(mAppRow.lockedImportance));
mRingtone.setEnabled(isChannelConfigurable(mChannel));
mRingtone.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
@@ -286,7 +286,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase {
channelArgs.putBoolean(AppHeader.EXTRA_HIDE_INFO_BUTTON, true);
channelArgs.putString(AppInfoBase.ARG_PACKAGE_NAME, mPkg);
channelArgs.putString(Settings.EXTRA_CHANNEL_ID, mChannel.getId());
mImportance.setEnabled(mSuspendedAppsAdmin == null && !mAppRow.lockedImportance);
mImportance.setEnabled(mSuspendedAppsAdmin == null && isChannelConfigurable(mChannel));
// Set up intent to show importance selection only if this setting is enabled.
if (mImportance.isEnabled()) {
Intent channelIntent = Utils.onBuildStartFragmentIntent(getActivity(),