Loading src/com/android/settings/applications/AppStateNotificationBridge.java +3 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings.applications; import android.app.Notification; import android.app.NotificationManager; import android.content.Context; import android.content.pm.PackageManager; import android.os.UserHandle; Loading Loading @@ -92,8 +93,8 @@ public class AppStateNotificationBridge extends AppStateBaseBridge { return false; } AppRow row = (AppRow) info.extraInfo; return row.appImportance > NotificationListenerService.Ranking.IMPORTANCE_NONE && row.appImportance < NotificationListenerService.Ranking.IMPORTANCE_DEFAULT; return row.appImportance > NotificationManager.IMPORTANCE_NONE && row.appImportance < NotificationManager.IMPORTANCE_DEFAULT; } }; Loading src/com/android/settings/applications/InstalledAppDetails.java +4 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.app.ActivityManager; import android.app.AlertDialog; import android.app.LoaderManager.LoaderCallbacks; import android.app.Notification; import android.app.NotificationManager; import android.app.admin.DevicePolicyManager; import android.content.ActivityNotFoundException; import android.content.BroadcastReceiver; Loading Loading @@ -1099,15 +1100,15 @@ public class InstalledAppDetails extends AppInfoBase List<String> summaryAttributes = new ArrayList<>(); StringBuffer summary = new StringBuffer(); if (showSlider) { if (appRow.appImportance != Ranking.IMPORTANCE_UNSPECIFIED) { if (appRow.appImportance != NotificationManager.IMPORTANCE_UNSPECIFIED) { summaryAttributes.add(context.getString( R.string.notification_summary_level, appRow.appImportance)); } } else { if (appRow.banned) { summaryAttributes.add(context.getString(R.string.notifications_disabled)); } else if (appRow.appImportance > Ranking.IMPORTANCE_NONE && appRow.appImportance < Ranking.IMPORTANCE_DEFAULT) { } else if (appRow.appImportance > NotificationManager.IMPORTANCE_NONE && appRow.appImportance < NotificationManager.IMPORTANCE_DEFAULT) { summaryAttributes.add(context.getString(R.string.notifications_silenced)); } } Loading src/com/android/settings/notification/AppNotificationSettings.java +1 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ public class AppNotificationSettings extends NotificationSettingsBase { mChannelList = mBackend.getChannels(mPkg, mUid).getList(); setupImportancePrefs(mAppRow.systemApp, mAppRow.appImportance, mAppRow.banned, NotificationManager.IMPORTANCE_MAX); NotificationManager.IMPORTANCE_HIGH); setupPriorityPref(mAppRow.appBypassDnd); setupVisOverridePref(mAppRow.appVisOverride); Loading src/com/android/settings/notification/ChannelNotificationSettings.java +8 −3 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.settings.notification; import android.app.Activity; import android.app.NotificationChannel; import android.app.NotificationManager; import android.content.Intent; import android.net.Uri; Loading @@ -24,6 +25,7 @@ import android.os.Bundle; import android.provider.Settings; import android.service.notification.NotificationListenerService.Ranking; import android.support.v7.preference.Preference; import android.view.View; import com.android.internal.logging.MetricsProto.MetricsEvent; import com.android.settings.AppHeader; Loading Loading @@ -94,7 +96,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { setupVibrate(); setupRingtone(); mMaxImportance = mAppRow.appImportance == NotificationManager.IMPORTANCE_UNSPECIFIED ? NotificationManager.IMPORTANCE_MAX : mAppRow.appImportance; ? NotificationManager.IMPORTANCE_HIGH : mAppRow.appImportance; setupImportancePrefs(false, mChannel.getImportance(), mChannel.getImportance() == NotificationManager.IMPORTANCE_NONE, mMaxImportance); Loading Loading @@ -141,6 +143,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { public boolean onPreferenceChange(Preference preference, Object newValue) { final boolean lights = (Boolean) newValue; mChannel.setLights(lights); mChannel.lockFields(NotificationChannel.USER_LOCKED_LIGHTS); mBackend.updateChannel(mPkg, mUid, mChannel); return true; } Loading @@ -155,6 +158,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { public boolean onPreferenceChange(Preference preference, Object newValue) { final boolean vibrate = (Boolean) newValue; mChannel.setVibration(vibrate); mChannel.lockFields(NotificationChannel.USER_LOCKED_VIBRATION); mBackend.updateChannel(mPkg, mUid, mChannel); return true; } Loading @@ -162,13 +166,14 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { } private void setupRingtone() { mRingtone.setRingtone(mChannel.getDefaultRingtone()); mRingtone.setRingtone(mChannel.getRingtone()); mRingtone.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { Uri ringtone = Uri.parse((String) newValue); mRingtone.setRingtone(ringtone); mChannel.setDefaultRingtone(ringtone); mChannel.setRingtone(ringtone); mChannel.lockFields(NotificationChannel.USER_LOCKED_RINGTONE); mBackend.updateChannel(mPkg, mUid, mChannel); return false; } Loading src/com/android/settings/notification/ImportanceSeekBarPreference.java +12 −15 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settings.notification; import com.android.settings.R; import com.android.settings.SeekBarPreference; import android.app.NotificationManager; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; Loading Loading @@ -119,12 +120,10 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements private void applyAuto(ImageView autoButton) { mAutoOn = !mAutoOn; if (!mAutoOn) { setProgress(NotificationListenerService.Ranking.IMPORTANCE_DEFAULT); mCallback.onImportanceChanged( NotificationListenerService.Ranking.IMPORTANCE_DEFAULT, true); setProgress(NotificationManager.IMPORTANCE_DEFAULT); mCallback.onImportanceChanged(NotificationManager.IMPORTANCE_DEFAULT, true); } else { mCallback.onImportanceChanged( NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED, true); mCallback.onImportanceChanged(NotificationManager.IMPORTANCE_UNSPECIFIED, true); } applyAutoUi(autoButton); } Loading @@ -140,9 +139,8 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements mSeekBar.setAlpha(alpha); if (mAutoOn) { setProgress(NotificationListenerService.Ranking.IMPORTANCE_DEFAULT); mSummary = getProgressSummary( NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED); setProgress(NotificationManager.IMPORTANCE_DEFAULT); mSummary = getProgressSummary(NotificationManager.IMPORTANCE_UNSPECIFIED); } mSummaryTextView.setText(mSummary); } Loading @@ -168,18 +166,17 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements private String getProgressSummary(int progress) { switch (progress) { case NotificationListenerService.Ranking.IMPORTANCE_NONE: case NotificationManager.IMPORTANCE_NONE: return getContext().getString(R.string.notification_importance_blocked); case NotificationListenerService.Ranking.IMPORTANCE_MIN: case NotificationManager.IMPORTANCE_MIN: return getContext().getString(R.string.notification_importance_min); case NotificationListenerService.Ranking.IMPORTANCE_LOW: case NotificationManager.IMPORTANCE_LOW: return getContext().getString(R.string.notification_importance_low); case NotificationListenerService.Ranking.IMPORTANCE_DEFAULT: case NotificationManager.IMPORTANCE_DEFAULT: return getContext().getString(R.string.notification_importance_default); case NotificationListenerService.Ranking.IMPORTANCE_HIGH: case NotificationManager.IMPORTANCE_HIGH: case NotificationManager.IMPORTANCE_MAX: return getContext().getString(R.string.notification_importance_high); case NotificationListenerService.Ranking.IMPORTANCE_MAX: return getContext().getString(R.string.notification_importance_max); default: return getContext().getString(R.string.notification_importance_unspecified); } Loading Loading
src/com/android/settings/applications/AppStateNotificationBridge.java +3 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.settings.applications; import android.app.Notification; import android.app.NotificationManager; import android.content.Context; import android.content.pm.PackageManager; import android.os.UserHandle; Loading Loading @@ -92,8 +93,8 @@ public class AppStateNotificationBridge extends AppStateBaseBridge { return false; } AppRow row = (AppRow) info.extraInfo; return row.appImportance > NotificationListenerService.Ranking.IMPORTANCE_NONE && row.appImportance < NotificationListenerService.Ranking.IMPORTANCE_DEFAULT; return row.appImportance > NotificationManager.IMPORTANCE_NONE && row.appImportance < NotificationManager.IMPORTANCE_DEFAULT; } }; Loading
src/com/android/settings/applications/InstalledAppDetails.java +4 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.app.ActivityManager; import android.app.AlertDialog; import android.app.LoaderManager.LoaderCallbacks; import android.app.Notification; import android.app.NotificationManager; import android.app.admin.DevicePolicyManager; import android.content.ActivityNotFoundException; import android.content.BroadcastReceiver; Loading Loading @@ -1099,15 +1100,15 @@ public class InstalledAppDetails extends AppInfoBase List<String> summaryAttributes = new ArrayList<>(); StringBuffer summary = new StringBuffer(); if (showSlider) { if (appRow.appImportance != Ranking.IMPORTANCE_UNSPECIFIED) { if (appRow.appImportance != NotificationManager.IMPORTANCE_UNSPECIFIED) { summaryAttributes.add(context.getString( R.string.notification_summary_level, appRow.appImportance)); } } else { if (appRow.banned) { summaryAttributes.add(context.getString(R.string.notifications_disabled)); } else if (appRow.appImportance > Ranking.IMPORTANCE_NONE && appRow.appImportance < Ranking.IMPORTANCE_DEFAULT) { } else if (appRow.appImportance > NotificationManager.IMPORTANCE_NONE && appRow.appImportance < NotificationManager.IMPORTANCE_DEFAULT) { summaryAttributes.add(context.getString(R.string.notifications_silenced)); } } Loading
src/com/android/settings/notification/AppNotificationSettings.java +1 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ public class AppNotificationSettings extends NotificationSettingsBase { mChannelList = mBackend.getChannels(mPkg, mUid).getList(); setupImportancePrefs(mAppRow.systemApp, mAppRow.appImportance, mAppRow.banned, NotificationManager.IMPORTANCE_MAX); NotificationManager.IMPORTANCE_HIGH); setupPriorityPref(mAppRow.appBypassDnd); setupVisOverridePref(mAppRow.appVisOverride); Loading
src/com/android/settings/notification/ChannelNotificationSettings.java +8 −3 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.settings.notification; import android.app.Activity; import android.app.NotificationChannel; import android.app.NotificationManager; import android.content.Intent; import android.net.Uri; Loading @@ -24,6 +25,7 @@ import android.os.Bundle; import android.provider.Settings; import android.service.notification.NotificationListenerService.Ranking; import android.support.v7.preference.Preference; import android.view.View; import com.android.internal.logging.MetricsProto.MetricsEvent; import com.android.settings.AppHeader; Loading Loading @@ -94,7 +96,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { setupVibrate(); setupRingtone(); mMaxImportance = mAppRow.appImportance == NotificationManager.IMPORTANCE_UNSPECIFIED ? NotificationManager.IMPORTANCE_MAX : mAppRow.appImportance; ? NotificationManager.IMPORTANCE_HIGH : mAppRow.appImportance; setupImportancePrefs(false, mChannel.getImportance(), mChannel.getImportance() == NotificationManager.IMPORTANCE_NONE, mMaxImportance); Loading Loading @@ -141,6 +143,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { public boolean onPreferenceChange(Preference preference, Object newValue) { final boolean lights = (Boolean) newValue; mChannel.setLights(lights); mChannel.lockFields(NotificationChannel.USER_LOCKED_LIGHTS); mBackend.updateChannel(mPkg, mUid, mChannel); return true; } Loading @@ -155,6 +158,7 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { public boolean onPreferenceChange(Preference preference, Object newValue) { final boolean vibrate = (Boolean) newValue; mChannel.setVibration(vibrate); mChannel.lockFields(NotificationChannel.USER_LOCKED_VIBRATION); mBackend.updateChannel(mPkg, mUid, mChannel); return true; } Loading @@ -162,13 +166,14 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { } private void setupRingtone() { mRingtone.setRingtone(mChannel.getDefaultRingtone()); mRingtone.setRingtone(mChannel.getRingtone()); mRingtone.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { Uri ringtone = Uri.parse((String) newValue); mRingtone.setRingtone(ringtone); mChannel.setDefaultRingtone(ringtone); mChannel.setRingtone(ringtone); mChannel.lockFields(NotificationChannel.USER_LOCKED_RINGTONE); mBackend.updateChannel(mPkg, mUid, mChannel); return false; } Loading
src/com/android/settings/notification/ImportanceSeekBarPreference.java +12 −15 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settings.notification; import com.android.settings.R; import com.android.settings.SeekBarPreference; import android.app.NotificationManager; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; Loading Loading @@ -119,12 +120,10 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements private void applyAuto(ImageView autoButton) { mAutoOn = !mAutoOn; if (!mAutoOn) { setProgress(NotificationListenerService.Ranking.IMPORTANCE_DEFAULT); mCallback.onImportanceChanged( NotificationListenerService.Ranking.IMPORTANCE_DEFAULT, true); setProgress(NotificationManager.IMPORTANCE_DEFAULT); mCallback.onImportanceChanged(NotificationManager.IMPORTANCE_DEFAULT, true); } else { mCallback.onImportanceChanged( NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED, true); mCallback.onImportanceChanged(NotificationManager.IMPORTANCE_UNSPECIFIED, true); } applyAutoUi(autoButton); } Loading @@ -140,9 +139,8 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements mSeekBar.setAlpha(alpha); if (mAutoOn) { setProgress(NotificationListenerService.Ranking.IMPORTANCE_DEFAULT); mSummary = getProgressSummary( NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED); setProgress(NotificationManager.IMPORTANCE_DEFAULT); mSummary = getProgressSummary(NotificationManager.IMPORTANCE_UNSPECIFIED); } mSummaryTextView.setText(mSummary); } Loading @@ -168,18 +166,17 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements private String getProgressSummary(int progress) { switch (progress) { case NotificationListenerService.Ranking.IMPORTANCE_NONE: case NotificationManager.IMPORTANCE_NONE: return getContext().getString(R.string.notification_importance_blocked); case NotificationListenerService.Ranking.IMPORTANCE_MIN: case NotificationManager.IMPORTANCE_MIN: return getContext().getString(R.string.notification_importance_min); case NotificationListenerService.Ranking.IMPORTANCE_LOW: case NotificationManager.IMPORTANCE_LOW: return getContext().getString(R.string.notification_importance_low); case NotificationListenerService.Ranking.IMPORTANCE_DEFAULT: case NotificationManager.IMPORTANCE_DEFAULT: return getContext().getString(R.string.notification_importance_default); case NotificationListenerService.Ranking.IMPORTANCE_HIGH: case NotificationManager.IMPORTANCE_HIGH: case NotificationManager.IMPORTANCE_MAX: return getContext().getString(R.string.notification_importance_high); case NotificationListenerService.Ranking.IMPORTANCE_MAX: return getContext().getString(R.string.notification_importance_max); default: return getContext().getString(R.string.notification_importance_unspecified); } Loading