diff --git a/src/com/android/phone/satellite/entitlement/SatelliteEntitlementResponse.java b/src/com/android/phone/satellite/entitlement/SatelliteEntitlementResponse.java
index 1fe0ecf..b877bee 100644
--- a/src/com/android/phone/satellite/entitlement/SatelliteEntitlementResponse.java
+++ b/src/com/android/phone/satellite/entitlement/SatelliteEntitlementResponse.java
@@ -18,6 +18,7 @@
 
 import static com.android.phone.satellite.entitlement.SatelliteEntitlementResult.SATELLITE_ENTITLEMENT_STATUS_DISABLED;
 
+import android.text.TextUtils;
 import android.util.Log;
 
 import com.android.internal.annotations.VisibleForTesting;
@@ -70,7 +71,9 @@
         mEntitlementStatus = SATELLITE_ENTITLEMENT_STATUS_DISABLED;
         mPlmnAllowedList = new ArrayList<>();
         mPlmnBarredList = new ArrayList<>();
-        parsingResponse(response);
+        if (!TextUtils.isEmpty(response)) {
+            parsingResponse(response);
+        }
     }
 
     /**
@@ -123,8 +126,11 @@
                 for (int i = 0; i < jsonArray.length(); i++) {
                     String dataPlanType = jsonArray.getJSONObject(i).has(DATA_PLAN_TYPE_KEY)
                             ? jsonArray.getJSONObject(i).getString(DATA_PLAN_TYPE_KEY) : "";
-                    mPlmnAllowedList.add(new SatelliteNetworkInfo(
-                            jsonArray.getJSONObject(i).getString(PLMN_KEY), dataPlanType));
+                    String plmn = jsonArray.getJSONObject(i).getString(PLMN_KEY);
+                    logd("parsingResponse: plmn=" + plmn + " dataplan=" + dataPlanType);
+                    if (!TextUtils.isEmpty(plmn)) {
+                        mPlmnAllowedList.add(new SatelliteNetworkInfo(plmn, dataPlanType));
+                    }
                 }
             }
             if (jsonToken.has(PLMN_BARRED_KEY)) {
@@ -141,6 +147,10 @@
         }
     }
 
+    private static void logd(String log) {
+        Log.d(TAG, log);
+    }
+
     private static void loge(String log) {
         Log.e(TAG, log);
     }
diff --git a/tests/src/com/android/phone/satellite/entitlement/SatelliteEntitlementResponseTest.java b/tests/src/com/android/phone/satellite/entitlement/SatelliteEntitlementResponseTest.java
index 45e2a71..13d43c8 100644
--- a/tests/src/com/android/phone/satellite/entitlement/SatelliteEntitlementResponseTest.java
+++ b/tests/src/com/android/phone/satellite/entitlement/SatelliteEntitlementResponseTest.java
@@ -52,12 +52,27 @@
                     + "\"TOKEN\":{\"token\":\"ASH127AHHA88SF\"},\""
                     + ServiceEntitlement.APP_SATELLITE_ENTITLEMENT + "\":{}}";
 
+    private static final String RESPONSE_WITHOUT_PLMN =
+            "{\"VERS\":{\"version\":\"1\",\"validity\":\"172800\"},"
+                    + "\"TOKEN\":{\"token\":\"ASH127AHHA88SF\"},\""
+                    + ServiceEntitlement.APP_SATELLITE_ENTITLEMENT + "\":{"
+                    + "\"EntitlementStatus\":\"" + SATELLITE_ENTITLEMENT_STATUS_ENABLED + "\"}}";
+
+    private static final String RESPONSE_WITHOUT_PLMN_ALLOWED =
+            "{\"VERS\":{\"version\":\"1\",\"validity\":\"172800\"},"
+                    + "\"TOKEN\":{\"token\":\"ASH127AHHA88SF\"},\""
+                    + ServiceEntitlement.APP_SATELLITE_ENTITLEMENT + "\":{"
+                    + "\"EntitlementStatus\":\"" + SATELLITE_ENTITLEMENT_STATUS_ENABLED + "\"" + ","
+                    + "\"PLMNBarred\":[{\"PLMN\":\"31017\"},"
+                    + "{\"PLMN\":\"302020\"}]}}";
+
     @Test
     public void testGetSatelliteEntitlementResponse() throws Exception {
         // Received the body with satellite service enabled.
         SatelliteEntitlementResponse response = new SatelliteEntitlementResponse(
                 getResponse(SATELLITE_ENTITLEMENT_STATUS_ENABLED));
         assertEquals(SATELLITE_ENTITLEMENT_STATUS_ENABLED, response.getEntitlementStatus());
+        assertTrue(response.getPlmnAllowed().size() == 2);
         assertEquals(TEST_PLMN_DATA_PLAN_TYPE_LIST.get(0).mPlmn,
                 response.getPlmnAllowed().get(0).mPlmn);
         assertEquals(TEST_PLMN_DATA_PLAN_TYPE_LIST.get(0).mDataPlanType,
@@ -66,6 +81,7 @@
                 response.getPlmnAllowed().get(1).mPlmn);
         assertEquals(TEST_PLMN_DATA_PLAN_TYPE_LIST.get(1).mDataPlanType,
                 response.getPlmnAllowed().get(1).mDataPlanType);
+        assertTrue(response.getPlmnBarredList().size() == 2);
         assertEquals(TEST_PLMN_BARRED_LIST, response.getPlmnBarredList());
 
         // Received the empty body.
@@ -106,6 +122,50 @@
         assertEquals(SATELLITE_ENTITLEMENT_STATUS_PROVISIONING, response.getEntitlementStatus());
         assertTrue(response.getPlmnAllowed().size() == 0);
         assertTrue(response.getPlmnBarredList().size() == 0);
+
+        // Received the body without plmn.
+        response = new SatelliteEntitlementResponse(RESPONSE_WITHOUT_PLMN);
+        assertEquals(SATELLITE_ENTITLEMENT_STATUS_ENABLED, response.getEntitlementStatus());
+        assertTrue(response.getPlmnAllowed().size() == 0);
+        assertTrue(response.getPlmnBarredList().size() == 0);
+
+        // Received the body without plmn allowed key.
+        response = new SatelliteEntitlementResponse(RESPONSE_WITHOUT_PLMN_ALLOWED);
+        assertEquals(SATELLITE_ENTITLEMENT_STATUS_ENABLED, response.getEntitlementStatus());
+        assertTrue(response.getPlmnAllowed().size() == 0);
+        assertTrue(response.getPlmnBarredList().size() == 2);
+        assertEquals(TEST_PLMN_BARRED_LIST, response.getPlmnBarredList());
+
+        String plmn = "123456";
+        // Received 123456 and empty string list
+        response = new SatelliteEntitlementResponse(
+                getChangedPLMNListResponse(plmn, ""));
+        assertEquals(SATELLITE_ENTITLEMENT_STATUS_ENABLED, response.getEntitlementStatus());
+        assertTrue(response.getPlmnAllowed().size() == 1);
+        assertEquals(plmn, response.getPlmnAllowed().get(0).mPlmn);
+
+        // Received empty string and 123456 list
+        response = new SatelliteEntitlementResponse(
+                getChangedPLMNListResponse("", plmn));
+        assertEquals(SATELLITE_ENTITLEMENT_STATUS_ENABLED, response.getEntitlementStatus());
+        assertTrue(response.getPlmnAllowed().size() == 1);
+        assertEquals(plmn, response.getPlmnAllowed().get(0).mPlmn);
+
+        // Received all empty strings list
+        response = new SatelliteEntitlementResponse(
+                getChangedPLMNListResponse("", ""));
+        assertEquals(SATELLITE_ENTITLEMENT_STATUS_ENABLED, response.getEntitlementStatus());
+        assertTrue(response.getPlmnAllowed().size() == 0);
+
+        // Received null
+        response = new SatelliteEntitlementResponse(null);
+        assertEquals(SATELLITE_ENTITLEMENT_STATUS_DISABLED, response.getEntitlementStatus());
+        assertTrue(response.getPlmnAllowed().size() == 0);
+
+        // Received empty string
+        response = new SatelliteEntitlementResponse("");
+        assertEquals(SATELLITE_ENTITLEMENT_STATUS_DISABLED, response.getEntitlementStatus());
+        assertTrue(response.getPlmnAllowed().size() == 0);
     }
 
     private String getResponse(int entitlementStatus) {
@@ -124,4 +184,18 @@
                 + "\"PLMNBarred\":[{\"PLMN\":\"31017\"},"
                 + "{\"PLMN\":\"302020\"}]" : "";
     }
+
+    private String getAllowedPlmns(String firstPlmn, String secondPlmn) {
+        return ",\"PLMNAllowed\":[{\"PLMN\":\"" + firstPlmn + "\",\"DataPlanType\":\"unmetered\"},"
+                + "{\"PLMN\":\"" + secondPlmn + "\",\"DataPlanType\":\"metered\"}]";
+    }
+
+    private String getChangedPLMNListResponse(String firstPlmn, String secondPlmn) {
+        return "{\"VERS\":{\"version\":\"1\",\"validity\":\"172800\"},"
+                + "\"TOKEN\":{\"token\":\"ASH127AHHA88SF\"},\""
+                + ServiceEntitlement.APP_SATELLITE_ENTITLEMENT + "\":{"
+                + "\"EntitlementStatus\":\"" + SATELLITE_ENTITLEMENT_STATUS_ENABLED + "\""
+                + getAllowedPlmns(firstPlmn, secondPlmn)
+                + "}}";
+    }
 }
