Merge cherrypicks of ['googleplex-android-review.googlesource.com/33444909'] into 25Q2-release.

Change-Id: I4309ba53f451559864b02166fcbe64ef93b40f21
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 1a1b725..9789165 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -15220,4 +15220,20 @@
 
         return satelliteMode;
     }
+
+    /**
+     * This API can be used by only CTS to ignore plmn list from storage.
+     *
+     * @param enabled Whether to enable boolean config.
+     * @return {@code true} if the value is set successfully, {@code false} otherwise.
+     */
+    public boolean setSatelliteIgnorePlmnListFromStorage(boolean enabled) {
+        Log.d(LOG_TAG, "setSatelliteIgnorePlmnListFromStorage - " + enabled);
+        TelephonyPermissions.enforceShellOnly(
+                Binder.getCallingUid(), "setSatelliteIgnorePlmnListFromStorage");
+        TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege(mApp,
+                SubscriptionManager.INVALID_SUBSCRIPTION_ID,
+                "setSatelliteIgnorePlmnListFromStorage");
+        return mSatelliteController.setSatelliteIgnorePlmnListFromStorage(enabled);
+    }
 }
diff --git a/src/com/android/phone/TelephonyShellCommand.java b/src/com/android/phone/TelephonyShellCommand.java
index e4b948c..ba1caa1 100644
--- a/src/com/android/phone/TelephonyShellCommand.java
+++ b/src/com/android/phone/TelephonyShellCommand.java
@@ -246,6 +246,9 @@
     private static final String GET_IMEI = "get-imei";
     private static final String GET_SIM_SLOTS_MAPPING = "get-sim-slots-mapping";
     private static final String COMMAND_DELETE_IMSI_KEY = "delete_imsi_key";
+    private static final String SET_SATELLITE_IGNORE_PLMN_LIST_FROM_STORAGE =
+            "set-satellite-ignore-plmn-list-from-storage";
+
     // Take advantage of existing methods that already contain permissions checks when possible.
     private final ITelephony mInterface;
 
@@ -459,6 +462,8 @@
                 return handleSetSatelliteTnScanningSupport();
             case COMMAND_DELETE_IMSI_KEY:
                 return handleDeleteTestImsiKey();
+            case SET_SATELLITE_IGNORE_PLMN_LIST_FROM_STORAGE:
+                return handleSetSatelliteIgnorePlmnListFromStorage();
             default: {
                 return handleDefaultCommands(cmd);
             }
@@ -4474,4 +4479,36 @@
         phone.resetCarrierKeysForImsiEncryption(true);
         return 1;
     }
+
+    private int handleSetSatelliteIgnorePlmnListFromStorage() {
+        PrintWriter errPw = getErrPrintWriter();
+        boolean enabled = false;
+
+        String opt;
+        while ((opt = getNextOption()) != null) {
+            switch (opt) {
+                case "-d": {
+                    enabled = Boolean.parseBoolean(getNextArgRequired());
+                    break;
+                }
+            }
+        }
+        Log.d(LOG_TAG, "handleSetSatelliteIgnorePlmnListFromStorage: enabled ="
+                + enabled);
+
+        try {
+            boolean result = mInterface.setSatelliteIgnorePlmnListFromStorage(enabled);
+            if (VDBG) {
+                Log.v(LOG_TAG, "handleSetAllPlmnListFromStorageEmpty " + enabled
+                        + ", result = " + result);
+            }
+            getOutPrintWriter().println(result);
+        } catch (RemoteException e) {
+            Log.w(LOG_TAG, "handleSetAllPlmnListFromStorageEmpty: " + enabled
+                    + ", error = " + e.getMessage());
+            errPw.println("Exception: " + e.getMessage());
+            return -1;
+        }
+        return 0;
+    }
 }