diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 36e5012..307411d 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -12485,6 +12485,26 @@
     }
 
     /**
+     * This API can be used by only CTS to update satellite pointing UI app package and class names.
+     *
+     * @param packageName The package name of the satellite pointing UI app.
+     * @param className The class name of the satellite pointing UI app.
+     * @return {@code true} if the satellite pointing UI app package and class is set successfully,
+     * {@code false} otherwise.
+     */
+    public boolean setSatellitePointingUiClassName(
+            @Nullable String packageName, @Nullable String className) {
+        Log.d(LOG_TAG, "setSatellitePointingUiClassName: packageName=" + packageName
+                + ", className=" + className);
+        TelephonyPermissions.enforceShellOnly(
+                Binder.getCallingUid(), "setSatellitePointingUiClassName");
+        TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege(mApp,
+                SubscriptionManager.INVALID_SUBSCRIPTION_ID,
+                "setSatelliteGatewayServicePackageName");
+        return mSatelliteController.setSatellitePointingUiClassName(packageName, className);
+    }
+
+    /**
      * This API can be used by only CTS to update the timeout duration in milliseconds that
      * satellite should stay at listening mode to wait for the next incoming page before disabling
      * listening mode.
diff --git a/src/com/android/phone/TelephonyShellCommand.java b/src/com/android/phone/TelephonyShellCommand.java
index b444840..d23d4e4 100644
--- a/src/com/android/phone/TelephonyShellCommand.java
+++ b/src/com/android/phone/TelephonyShellCommand.java
@@ -185,6 +185,8 @@
             "set-satellite-gateway-service-package-name";
     private static final String SET_SATELLITE_LISTENING_TIMEOUT_DURATION =
             "set-satellite-listening-timeout-duration";
+    private static final String SET_SATELLITE_POINTING_UI_CLASS_NAME =
+            "set-satellite-pointing-ui-class-name";
 
     private static final String INVALID_ENTRY_ERROR = "An emergency number (only allow '0'-'9', "
             + "'*', '#' or '+') needs to be specified after -a in the command ";
@@ -372,6 +374,8 @@
                 return handleSetSatelliteGatewayServicePackageNameCommand();
             case SET_SATELLITE_LISTENING_TIMEOUT_DURATION:
                 return handleSetSatelliteListeningTimeoutDuration();
+            case SET_SATELLITE_POINTING_UI_CLASS_NAME:
+                return handleSetSatellitePointingUiClassNameCommand();
             default: {
                 return handleDefaultCommands(cmd);
             }
@@ -764,6 +768,13 @@
         pw.println("    mode. Options are:");
         pw.println("      -t: the timeout duration in milliseconds.");
         pw.println("          If no option is specified, it will use the default values.");
+        pw.println("  set-satellite-pointing-ui-class-name [-p PACKAGE_NAME -c CLASS_NAME]");
+        pw.println("    Sets the package and class name of satellite pointing UI app defined in");
+        pw.println("    PACKAGE_NAME and CLASS_NAME to be launched. Options are:");
+        pw.println("      -p: the satellite pointing UI app package name that Telephony will");
+        pw.println("           launch. If no option is specified, it will launch the default.");
+        pw.println("      -c: the satellite pointing UI app class name that Telephony will");
+        pw.println("           launch.");
     }
 
     private void onHelpImei() {
@@ -3166,6 +3177,42 @@
         return 0;
     }
 
+    private int handleSetSatellitePointingUiClassNameCommand() {
+        PrintWriter errPw = getErrPrintWriter();
+        String packageName = null;
+        String className = null;
+
+        String opt;
+        while ((opt = getNextOption()) != null) {
+            switch (opt) {
+                case "-p": {
+                    packageName = getNextArgRequired();
+                    break;
+                }
+                case "-c": {
+                    className = getNextArgRequired();
+                    break;
+                }
+            }
+        }
+        Log.d(LOG_TAG, "handleSetSatellitePointingUiClassNameCommand: packageName="
+                + packageName + ", className=" + className);
+
+        try {
+            boolean result = mInterface.setSatellitePointingUiClassName(packageName, className);
+            if (VDBG) {
+                Log.v(LOG_TAG, "setSatellitePointingUiClassName result =" + result);
+            }
+            getOutPrintWriter().println(result);
+        } catch (RemoteException e) {
+            Log.e(LOG_TAG, "setSatellitePointingUiClassName: " + packageName
+                    + ", error = " + e.getMessage());
+            errPw.println("Exception: " + e.getMessage());
+            return -1;
+        }
+        return 0;
+    }
+
     private int handleSetSatelliteListeningTimeoutDuration() {
         PrintWriter errPw = getErrPrintWriter();
         long timeoutMillis = 0;
