diff options
author | Danesh M <daneshm90@gmail.com> | 2015-04-15 12:46:00 -0700 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2015-04-18 01:56:10 +0000 |
commit | 1ce303b4e64806541217f56a1ac50228b7970aae (patch) | |
tree | c12fa64dde0809ce5e71b31acef92d75c8427fc6 | |
parent | a98cc4b383c88e4abde950be2f4c1afb9d2f68ea (diff) | |
download | android_packages_apps_CellBroadcastReceiver-stable/cm-11.0-XNG2S.tar.gz android_packages_apps_CellBroadcastReceiver-stable/cm-11.0-XNG2S.tar.bz2 android_packages_apps_CellBroadcastReceiver-stable/cm-11.0-XNG2S.zip |
CellBroadcastReceiver : Show alerts in FIFO orderstable/cm-11.0-XNG2S
Change-Id: I68001e5d3058592f3a0859983216e262dc0f47fc
(cherry picked from commit 00d5e3935ed03bad21ad45ed571e7ed4329229a4)
(cherry picked from commit d02ee61b70745706264ef3eb5a7bb4cb19eec4b7)
-rw-r--r-- | src/com/android/cellbroadcastreceiver/CellBroadcastAlertFullScreen.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertFullScreen.java b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertFullScreen.java index 7fd1ab60..5c8a8b6a 100644 --- a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertFullScreen.java +++ b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertFullScreen.java @@ -222,9 +222,8 @@ public class CellBroadcastAlertFullScreen extends Activity { /** Returns the currently displayed message. */ CellBroadcastMessage getLatestMessage() { - int index = mMessageList.size() - 1; - if (index >= 0) { - return mMessageList.get(index); + if (mMessageList.size() > 0) { + return mMessageList.get(0); } else { return null; } @@ -232,9 +231,8 @@ public class CellBroadcastAlertFullScreen extends Activity { /** Removes and returns the currently displayed message. */ private CellBroadcastMessage removeLatestMessage() { - int index = mMessageList.size() - 1; - if (index >= 0) { - return mMessageList.remove(index); + if (mMessageList.size() > 0) { + return mMessageList.remove(0); } else { return null; } |