Play an audible notification on receiving a class zero message.
Changes ported from http://review.cyanogenmod.org/#/c/125457/ PAELLA-123 Change-Id: I1289790d32a3b69bf7892025bac5fa3bd74eeefc
This commit is contained in:
@@ -190,6 +190,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.
|
* Cancel all notifications of a certain type.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import android.view.Window;
|
|||||||
|
|
||||||
import com.android.messaging.R;
|
import com.android.messaging.R;
|
||||||
import com.android.messaging.datamodel.action.ReceiveSmsMessageAction;
|
import com.android.messaging.datamodel.action.ReceiveSmsMessageAction;
|
||||||
|
import com.android.messaging.datamodel.BugleNotifications;
|
||||||
import com.android.messaging.util.Assert;
|
import com.android.messaging.util.Assert;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -88,6 +89,8 @@ public class ClassZeroActivity extends Activity {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mMessageQueue.add(messageValues);
|
mMessageQueue.add(messageValues);
|
||||||
|
// Show a notification to let the user know a new message has arrived
|
||||||
|
BugleNotifications.playClassZeroNotification();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user