Loading src/com/android/settings/notification/ChannelNotificationSettings.java +11 −6 Original line number Diff line number Diff line Loading @@ -213,6 +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.setChecked(mChannel.shouldVibrate()); mVibrate.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override Loading @@ -229,6 +230,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { private void setupRingtone() { mRingtone = (NotificationSoundPreference) findPreference(KEY_RINGTONE); mRingtone.setRingtone(mChannel.getSound()); mRingtone.setEnabled(!(mAppRow.lockedImportance)); mRingtone.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { Loading Loading @@ -284,12 +286,15 @@ 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); // Set up intent to show importance selection only if this setting is enabled. if (mImportance.isEnabled()) { Intent channelIntent = Utils.onBuildStartFragmentIntent(getActivity(), ChannelImportanceSettings.class.getName(), channelArgs, null, R.string.notification_importance_title, null, false, getMetricsCategory()); mImportance.setIntent(channelIntent); mImportance.setEnabled(mSuspendedAppsAdmin == null); } mImportance.setSummary(getImportanceSummary(mChannel.getImportance())); } Loading src/com/android/settings/notification/NotificationSettingsBase.java +3 −0 Original line number Diff line number Diff line Loading @@ -293,6 +293,8 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen private void setupImportanceToggle() { mImportanceToggle = (RestrictedSwitchPreference) findPreference(KEY_ALLOW_SOUND); mImportanceToggle.setDisabledByAdmin(mSuspendedAppsAdmin); mImportanceToggle.setEnabled(!(mAppRow.lockedImportance || mImportanceToggle.isDisabledByAdmin())); mImportanceToggle.setChecked(mChannel.getImportance() >= IMPORTANCE_DEFAULT || mChannel.getImportance() == IMPORTANCE_UNSPECIFIED); mImportanceToggle.setOnPreferenceChangeListener( Loading @@ -313,6 +315,7 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen protected void setupPriorityPref(boolean priority) { mPriority = (RestrictedSwitchPreference) findPreference(KEY_BYPASS_DND); mPriority.setDisabledByAdmin(mSuspendedAppsAdmin); mPriority.setEnabled(!(mAppRow.lockedImportance || mPriority.isDisabledByAdmin())); mPriority.setChecked(priority); mPriority.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override Loading Loading
src/com/android/settings/notification/ChannelNotificationSettings.java +11 −6 Original line number Diff line number Diff line Loading @@ -213,6 +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.setChecked(mChannel.shouldVibrate()); mVibrate.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override Loading @@ -229,6 +230,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { private void setupRingtone() { mRingtone = (NotificationSoundPreference) findPreference(KEY_RINGTONE); mRingtone.setRingtone(mChannel.getSound()); mRingtone.setEnabled(!(mAppRow.lockedImportance)); mRingtone.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { Loading Loading @@ -284,12 +286,15 @@ 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); // Set up intent to show importance selection only if this setting is enabled. if (mImportance.isEnabled()) { Intent channelIntent = Utils.onBuildStartFragmentIntent(getActivity(), ChannelImportanceSettings.class.getName(), channelArgs, null, R.string.notification_importance_title, null, false, getMetricsCategory()); mImportance.setIntent(channelIntent); mImportance.setEnabled(mSuspendedAppsAdmin == null); } mImportance.setSummary(getImportanceSummary(mChannel.getImportance())); } Loading
src/com/android/settings/notification/NotificationSettingsBase.java +3 −0 Original line number Diff line number Diff line Loading @@ -293,6 +293,8 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen private void setupImportanceToggle() { mImportanceToggle = (RestrictedSwitchPreference) findPreference(KEY_ALLOW_SOUND); mImportanceToggle.setDisabledByAdmin(mSuspendedAppsAdmin); mImportanceToggle.setEnabled(!(mAppRow.lockedImportance || mImportanceToggle.isDisabledByAdmin())); mImportanceToggle.setChecked(mChannel.getImportance() >= IMPORTANCE_DEFAULT || mChannel.getImportance() == IMPORTANCE_UNSPECIFIED); mImportanceToggle.setOnPreferenceChangeListener( Loading @@ -313,6 +315,7 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen protected void setupPriorityPref(boolean priority) { mPriority = (RestrictedSwitchPreference) findPreference(KEY_BYPASS_DND); mPriority.setDisabledByAdmin(mSuspendedAppsAdmin); mPriority.setEnabled(!(mAppRow.lockedImportance || mPriority.isDisabledByAdmin())); mPriority.setChecked(priority); mPriority.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override Loading