summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Valiaparambil <avaliaparambil@cyngn.com>2016-04-01 15:46:29 +0530
committerJoey Rizzoli <joey@cyanogenmoditalia.it>2016-10-17 16:38:29 +0200
commitd4f36c297bc4cc7595acf61309d324390eff75d4 (patch)
treedb48983094b715f4e31c3ce0edc28f608b8d4660
parent68751562e547c33c6cf5ea485f8c53067878466d (diff)
downloadandroid_packages_apps_Messaging-d4f36c297bc4cc7595acf61309d324390eff75d4.tar.gz
android_packages_apps_Messaging-d4f36c297bc4cc7595acf61309d324390eff75d4.tar.bz2
android_packages_apps_Messaging-d4f36c297bc4cc7595acf61309d324390eff75d4.zip
Play an audible notification on receiving a class zero message. Changes
ported from http://review.cyanogenmod.org/#/c/125457/ PAELLA-123 Change-Id: I1289790d32a3b69bf7892025bac5fa3bd74eeefc
-rw-r--r--src/com/android/messaging/datamodel/BugleNotifications.java9
-rw-r--r--src/com/android/messaging/ui/ClassZeroActivity.java3
2 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/messaging/datamodel/BugleNotifications.java b/src/com/android/messaging/datamodel/BugleNotifications.java
index b796e73..ffe9105 100644
--- a/src/com/android/messaging/datamodel/BugleNotifications.java
+++ b/src/com/android/messaging/datamodel/BugleNotifications.java
@@ -191,6 +191,15 @@ public class BugleNotifications {
}
/**
+ * Play a sound to notify arrival of a class 0 message
+ *
+ */
+ public static void playClassZeroNotification() {
+ final Uri ringtoneUri = RingtoneUtil.getNotificationRingtoneUri(null);
+ playObservableConversationNotificationSound(ringtoneUri);
+ }
+
+ /**
* Cancel all notifications of a certain type.
*
* @param type Message or error notifications from Constants.
diff --git a/src/com/android/messaging/ui/ClassZeroActivity.java b/src/com/android/messaging/ui/ClassZeroActivity.java
index 129ec19..ccb15a0 100644
--- a/src/com/android/messaging/ui/ClassZeroActivity.java
+++ b/src/com/android/messaging/ui/ClassZeroActivity.java
@@ -33,6 +33,7 @@ import android.view.Window;
import com.android.messaging.R;
import com.android.messaging.datamodel.action.ReceiveSmsMessageAction;
+import com.android.messaging.datamodel.BugleNotifications;
import com.android.messaging.util.Assert;
import java.util.ArrayList;
@@ -88,6 +89,8 @@ public class ClassZeroActivity extends Activity {
return false;
}
mMessageQueue.add(messageValues);
+ // Show a notification to let the user know a new message has arrived
+ BugleNotifications.playClassZeroNotification();
return true;
}