diff options
Diffstat (limited to 'src/com/android/cellbroadcastreceiver/CellBroadcastReceiverApp.java')
-rw-r--r-- | src/com/android/cellbroadcastreceiver/CellBroadcastReceiverApp.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiverApp.java b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiverApp.java index b9e60398..2b62177f 100644 --- a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiverApp.java +++ b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiverApp.java @@ -21,6 +21,8 @@ import android.telephony.CellBroadcastMessage; import android.util.Log; import android.preference.PreferenceManager; +import java.util.HashMap; +import java.util.Map; import java.util.ArrayList; import java.util.concurrent.atomic.AtomicInteger; @@ -43,7 +45,8 @@ public class CellBroadcastReceiverApp extends Application { new ArrayList<CellBroadcastMessage>(4); /** Latest area info cell broadcast received. */ - private static CellBroadcastMessage sLatestAreaInfo; + private static Map<Integer, CellBroadcastMessage> sLatestAreaInfo = + new HashMap<Integer, CellBroadcastMessage>(); /** Adds a new unread non-emergency message and returns the current list. */ static ArrayList<CellBroadcastMessage> addNewMessageToList(CellBroadcastMessage message) { @@ -58,11 +61,11 @@ public class CellBroadcastReceiverApp extends Application { /** Saves the latest area info broadcast received. */ static void setLatestAreaInfo(CellBroadcastMessage areaInfo) { - sLatestAreaInfo = areaInfo; + sLatestAreaInfo.put(areaInfo.getSubId(), areaInfo); } /** Returns the latest area info broadcast received. */ - static CellBroadcastMessage getLatestAreaInfo() { - return sLatestAreaInfo; + static CellBroadcastMessage getLatestAreaInfo(int subId) { + return sLatestAreaInfo.get(subId); } } |