From 0e6177c78af2de6d71279725753d5db92511f397 Mon Sep 17 00:00:00 2001 From: Chris Wren Date: Mon, 11 Apr 2016 10:48:10 -0400 Subject: support OnlyAlertOnce in the Showcase Change-Id: I72fa2f099af40125cf323c98eae629c9d46ccc1f --- .../com/android/example/notificationshowcase/NotificationService.java | 2 +- .../src/com/android/example/notificationshowcase/SettingsActivity.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'NotificationShowcase/src') diff --git a/NotificationShowcase/src/com/android/example/notificationshowcase/NotificationService.java b/NotificationShowcase/src/com/android/example/notificationshowcase/NotificationService.java index 5fb2a2b..cbec648 100644 --- a/NotificationShowcase/src/com/android/example/notificationshowcase/NotificationService.java +++ b/NotificationShowcase/src/com/android/example/notificationshowcase/NotificationService.java @@ -143,7 +143,7 @@ public class NotificationService extends IntentService { .addAction(R.drawable.ic_media_next, context.getString(R.string.sms_reply), ai) .setSmallIcon(R.drawable.stat_notify_talk_text) .setStyle(bigTextStyle) - .setOnlyAlertOnce(true); + .setOnlyAlertOnce(sharedPref.getBoolean(SettingsActivity.KEY_SMS_ONCE, true)); if (TextUtils.isEmpty(personUri)) { Log.w(TAG, "failed to find contact for Mike Cleron"); diff --git a/NotificationShowcase/src/com/android/example/notificationshowcase/SettingsActivity.java b/NotificationShowcase/src/com/android/example/notificationshowcase/SettingsActivity.java index 5697f77..77936c7 100644 --- a/NotificationShowcase/src/com/android/example/notificationshowcase/SettingsActivity.java +++ b/NotificationShowcase/src/com/android/example/notificationshowcase/SettingsActivity.java @@ -26,6 +26,7 @@ public class SettingsActivity extends Activity { public static final String KEY_SMS_NOISY = "pref_key_sms_noisy"; public static final String KEY_SMS_SOUND = "pref_key_sms_sound"; public static final String KEY_SMS_BUZZY = "pref_key_sms_buzzy"; + public static final String KEY_SMS_ONCE = "pref_key_sms_once"; public static final String KEY_SMS_PRIORITY = "pref_key_sms_priority"; public static final String KEY_SMS_PERSON = "pref_key_sms_person"; public static final String KEY_PHONE_ENABLE = "pref_key_phone_enable"; -- cgit v1.2.3