Cell location check for 3GPP cell broadcast messages only am: 8a0e53e8bb

Original change: https://android-review.googlesource.com/c/platform/packages/modules/CellBroadcastService/+/1439231

Change-Id: I6d36b2d87cf4f643a8c341e10a2bf7dd61bff2db
diff --git a/src/com/android/cellbroadcastservice/CellBroadcastHandler.java b/src/com/android/cellbroadcastservice/CellBroadcastHandler.java
index 1378ebb..bbce188 100644
--- a/src/com/android/cellbroadcastservice/CellBroadcastHandler.java
+++ b/src/com/android/cellbroadcastservice/CellBroadcastHandler.java
@@ -478,8 +478,11 @@
                     continue;
                 }
 
-                // Check if the message location is different
-                if (!isSameLocation(message, messageToCheck)) {
+                // Check if the message location is different. Note this is only applicable to
+                // 3GPP format cell broadcast messages.
+                if (message.getMessageFormat() == SmsCbMessage.MESSAGE_FORMAT_3GPP
+                        && messageToCheck.getMessageFormat() == SmsCbMessage.MESSAGE_FORMAT_3GPP
+                        && !isSameLocation(message, messageToCheck)) {
                     if (VDBG) log("Location does not match.");
                     // Not a dup. Check next one.
                     continue;