summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArun Valiaparambil <avaliaparambil@cyngn.com>2016-04-01 15:46:29 +0530
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-04-05 21:34:35 -0700
commitf06df53248fbebb0c6dd6123b9a3b76a7545b15e (patch)
treed7fb0f98ced85d2e2b64611f49049f565668eb32 /src
parentb46d8070cf6f51fce61211c733ab2bab2603a106 (diff)
downloadandroid_packages_apps_Messaging-f06df53248fbebb0c6dd6123b9a3b76a7545b15e.tar.gz
android_packages_apps_Messaging-f06df53248fbebb0c6dd6123b9a3b76a7545b15e.tar.bz2
android_packages_apps_Messaging-f06df53248fbebb0c6dd6123b9a3b76a7545b15e.zip
Play an audible notification on receiving a class zero message. Changes
ported from http://review.cyanogenmod.org/#/c/125457/ PAELLA-123 Change-Id: I53e2de5d97ddba9d0b11d5a8043cee7f430f1663
Diffstat (limited to 'src')
-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 355fb3a..f0ca910 100644
--- a/src/com/android/messaging/datamodel/BugleNotifications.java
+++ b/src/com/android/messaging/datamodel/BugleNotifications.java
@@ -194,6 +194,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;
}