diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6ba2853..aec0fa6 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -12275,13 +12275,13 @@
     <!-- Search keywords for "_satellite_setting_preference_layout" [CHAR_LIMIT=NONE] -->
     <string name="keywords_satellite_setting">Satellite messaging</string>
     <!-- Category name "About satellite messaging" [CHAR_LIMIT=NONE] -->
-    <string name="category_name_about_satellite_messaging">About satellite messaging</string>
+    <string name="category_name_about_satellite_messaging">About <xliff:g id="subject" example="satellite messaging">%1$s</xliff:g></string>
     <!-- Summary for category "About satellite messaging" [CHAR_LIMIT=NONE] -->
     <string name="title_about_satellite_setting">You can send and receive text messages by satellite as part of an eligible <xliff:g id="carrier_name" example="T-Mobile">%1$s</xliff:g> account</string>
     <!-- Category title "Your mobile plan" [CHAR_LIMIT=NONE] -->
     <string name="category_title_your_satellite_plan">Your <xliff:g id="carrier_name" example="T-Mobile">%1$s</xliff:g> plan</string>
     <!-- Title for category "Your mobile plan when satellite is included in plan" [CHAR_LIMIT=NONE] -->
-    <string name="title_have_satellite_plan">Satellite messaging is included with your account</string>
+    <string name="title_have_satellite_plan">Messaging is included with your account</string>
     <!-- Title for category "Your mobile plan when satellite is not included in plan" [CHAR_LIMIT=NONE] -->
     <string name="title_no_satellite_plan">Satellite messaging isn\u2019t included with your account</string>
     <!-- text view "Learn more" [CHAR_LIMIT=NONE] -->
@@ -12297,9 +12297,9 @@
     <!-- Summary for satellite supported service [CHAR_LIMIT=NONE] -->
     <string name="summary_supported_service">You can text anyone, including emergency services. Your phone will reconnect to a mobile network when available.</string>
     <!-- learn more text - more about satellite messaging [CHAR_LIMIT=NONE] -->
-    <string name="satellite_setting_summary_more_information">Satellite messaging may take longer and is available only in some areas. Weather and certain structures may affect your satellite connection. Calling by satellite isn\u2019t available. Emergency calls may still connect.\n\nIt may take some time for account changes to show in Settings. Contact your carrier for details.</string>
+    <string name="satellite_setting_summary_more_information"><xliff:g id="subject" example="satellite messaging">%1$s</xliff:g> may take longer and is available only in some areas. Weather and certain structures may affect your satellite connection. Calling by satellite isn\u2019t available. Emergency calls may still connect.\n\nIt may take some time for account changes to show in Settings. Contact <xliff:g id="carrier_name" example="T-Mobile">%1$s</xliff:g> for details.</string>
     <!-- more about satellite messaging [CHAR_LIMIT=NONE] -->
-    <string name="more_about_satellite_messaging">More about satellite messaging</string>
+    <string name="more_about_satellite_messaging">More about <xliff:g id="subject" example="satellite messaging">%1$s</xliff:g></string>
     <!-- Title for satellite warning dialog to avoid user using wifi/bluetooth/airplane mode [CHAR_LIMIT=NONE] -->
     <string name="satellite_warning_dialog_title">Can’t turn on <xliff:g id="function" example="bluetooth">%1$s</xliff:g></string>
     <!-- Content for satellite warning dialog to avoid user using wifi/bluetooth/airplane mode [CHAR_LIMIT=NONE] -->
@@ -12307,7 +12307,14 @@
     <!-- Category title for satellite functions with data transmission in mobile network settings [CHAR LIMIT=60] -->
     <string name="category_title_satellite_connectivity">Satellite connectivity</string>
     <!-- Title for satellite functions with data transmission in mobile network settings [CHAR LIMIT=60] -->
-    <string name="satellite_setting_connectivity">Satellite connectivity</string>
+    <string name="title_satellite_setting_connectivity">Satellite connectivity</string>
+    <!-- Description of satellite function with data transmission [CHAR LIMIT=60] -->
+    <string name="description_satellite_setting_connectivity">satellite connectivity</string>
+    <!-- Description of satellite function [CHAR LIMIT=60] -->
+    <string name="description_satellite_setting_messaging">satellite messaging</string>
+    <!-- Title for notifying user's account be able to use data transmission of Satellite" [CHAR_LIMIT=NONE] -->
+    <string name="title_have_satellite_data_plan">Use of data is included with your account</string>
+
 
 
     <!-- Title for Apn settings in mobile network settings [CHAR LIMIT=60] -->
diff --git a/res/xml/satellite_setting.xml b/res/xml/satellite_setting.xml
index 09fbbd6..60fe5bf 100644
--- a/res/xml/satellite_setting.xml
+++ b/res/xml/satellite_setting.xml
@@ -22,7 +22,7 @@
     settings:keywords="@string/keywords_satellite_setting">
 
     <PreferenceCategory
-        android:title="@string/category_name_about_satellite_messaging">
+        android:key="key_category_about_satellite">
 
         <com.android.settingslib.widget.TopIntroPreference
             android:key="key_about_satellite_messaging"/>
@@ -35,6 +35,12 @@
         <Preference
             android:key="key_your_satellite_plan"
             android:icon="?android:attr/textColorPrimary"/>
+
+        <Preference
+            android:key="key_your_satellite_data_plan"
+            android:icon="?android:attr/textColorPrimary"
+            settings:isPreferenceVisible="false"/>
+
     </PreferenceCategory>
 
     <PreferenceCategory
diff --git a/src/com/android/settings/network/telephony/SatelliteSetting.java b/src/com/android/settings/network/telephony/SatelliteSetting.java
index 16c56f0..a6e2f82 100644
--- a/src/com/android/settings/network/telephony/SatelliteSetting.java
+++ b/src/com/android/settings/network/telephony/SatelliteSetting.java
@@ -56,20 +56,26 @@
 /** Handle Satellite Setting Preference Layout. */
 public class SatelliteSetting extends RestrictedDashboardFragment {
     private static final String TAG = "SatelliteSetting";
-    public static final String PREF_KEY_ABOUT_SATELLITE_MESSAGING = "key_about_satellite_messaging";
-    public static final String PREF_KEY_CATEGORY_YOUR_SATELLITE_PLAN =
+    private static final String PREF_KEY_ABOUT_SATELLITE_MESSAGING =
+            "key_about_satellite_messaging";
+    private static final String PREF_KEY_CATEGORY_YOUR_SATELLITE_PLAN =
             "key_category_your_satellite_plan";
-    public static final String PREF_KEY_YOUR_SATELLITE_PLAN = "key_your_satellite_plan";
-    public static final String PREF_KEY_CATEGORY_HOW_IT_WORKS = "key_category_how_it_works";
+    private static final String PREF_KEY_YOUR_SATELLITE_PLAN = "key_your_satellite_plan";
+    private static final String PREF_KEY_CATEGORY_HOW_IT_WORKS = "key_category_how_it_works";
+    private static final String PREF_KEY_YOUR_SATELLITE_DATA_PLAN = "key_your_satellite_data_plan";
+    private static final String PREF_KEY_CATEGORY_ABOUT_SATELLITE = "key_category_about_satellite";
     private static final String KEY_FOOTER_PREFERENCE = "satellite_setting_extra_info_footer_pref";
-    public static final String SUB_ID = "sub_id";
+
+    static final String SUB_ID = "sub_id";
+    static final String EXTRA_IS_SERVICE_DATA_TYPE = "is_service_data_type";
 
     private Activity mActivity;
-    private TelephonyManager mTelephonymanager;
     private CarrierConfigManager mCarrierConfigManager;
     private SatelliteManager mSatelliteManager;
     private PersistableBundle mConfigBundle;
-    private int mSubId;
+    private int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+    private String mSimOperatorName = "";
+    private boolean mIsServiceDataType = false;
 
     public SatelliteSetting() {
         super(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS);
@@ -111,13 +117,19 @@
             return;
         }
 
-        mTelephonymanager = mActivity.getSystemService(TelephonyManager.class);
+        mIsServiceDataType = getIntent().getBooleanExtra(EXTRA_IS_SERVICE_DATA_TYPE, false);
+        mSimOperatorName = getSystemService(TelephonyManager.class).getSimOperatorName(mSubId);
     }
 
     @Override
     public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
         super.onViewCreated(view, savedInstanceState);
-        updateDynamicPreferenceViews();
+        boolean isSatelliteEligible = isSatelliteEligible();
+        updateTitle();
+        updateAboutSatelliteContent();
+        updateMobilePlan(isSatelliteEligible);
+        updateHowItWorksContent(isSatelliteEligible);
+        updateFooterContent();
     }
 
     @Override
@@ -130,31 +142,45 @@
         return R.xml.satellite_setting;
     }
 
-    private void updateDynamicPreferenceViews() {
-        String operatorName = mTelephonymanager.getSimOperatorName(mSubId);
-        boolean isSatelliteEligible = isSatelliteEligible();
+    private void updateTitle() {
+        getActivity().setTitle(getSubjectString());
+    }
 
-        // About satellite messaging
+    // About satellite content
+    private void updateAboutSatelliteContent() {
+        Preference categoryTitle = findPreference(PREF_KEY_CATEGORY_ABOUT_SATELLITE);
+        categoryTitle.setTitle(
+                getString(R.string.category_name_about_satellite_messaging,
+                        getDescriptionString()));
+
         Preference preference = findPreference(PREF_KEY_ABOUT_SATELLITE_MESSAGING);
         preference.setTitle(
-                getResources().getString(R.string.title_about_satellite_setting, operatorName));
+                getResources().getString(R.string.title_about_satellite_setting, mSimOperatorName));
+    }
 
+    private void updateMobilePlan(boolean isSatelliteEligible) {
         // Your mobile plan
         PreferenceCategory prefCategory = findPreference(PREF_KEY_CATEGORY_YOUR_SATELLITE_PLAN);
         prefCategory.setTitle(getResources().getString(R.string.category_title_your_satellite_plan,
-                operatorName));
+                mSimOperatorName));
+        Preference messagingPreference = findPreference(PREF_KEY_YOUR_SATELLITE_PLAN);
 
-        preference = findPreference(PREF_KEY_YOUR_SATELLITE_PLAN);
-        Drawable icon;
+        Drawable icon = getContext().getDrawable(R.drawable.ic_check_circle_24px);
         if (isSatelliteEligible) {
             /* In case satellite is allowed by carrier's entitlement server, the page will show
                the check icon with guidance that satellite is included in user's mobile plan */
-            preference.setTitle(R.string.title_have_satellite_plan);
-            icon = getContext().getDrawable(R.drawable.ic_check_circle_24px);
+            messagingPreference.setTitle(R.string.title_have_satellite_plan);
+            if (com.android.settings.flags.Flags.satelliteOemSettingsUxMigration()) {
+                Preference connectivityPreference = findPreference(
+                        PREF_KEY_YOUR_SATELLITE_DATA_PLAN);
+                connectivityPreference.setTitle(R.string.title_have_satellite_data_plan);
+                connectivityPreference.setIcon(icon);
+                connectivityPreference.setVisible(true);
+            }
         } else {
             /* Or, it will show the blocked icon with the guidance that satellite is not included
                in user's mobile plan */
-            preference.setTitle(R.string.title_no_satellite_plan);
+            messagingPreference.setTitle(R.string.title_no_satellite_plan);
             /* And, the link url provides more information via web page will be shown */
             SpannableString spannable = new SpannableString(
                     getResources().getString(R.string.summary_add_satellite_setting));
@@ -162,9 +188,9 @@
                     Spanned.SPAN_INCLUSIVE_INCLUSIVE);
             spannable.setSpan(new StyleSpan(Typeface.BOLD), 0, spannable.length(),
                     Spanned.SPAN_INCLUSIVE_INCLUSIVE);
-            preference.setSummary(spannable);
+            messagingPreference.setSummary(spannable);
             /* The link will lead users to a guide page */
-            preference.setOnPreferenceClickListener(pref -> {
+            messagingPreference.setOnPreferenceClickListener(pref -> {
                 String url = readSatelliteMoreInfoString(mSubId);
                 if (!url.isEmpty()) {
                     Uri uri = Uri.parse(url);
@@ -173,11 +199,13 @@
                 }
                 return true;
             });
-            icon = getResources().getDrawable(R.drawable.ic_block_24px);
+            icon = getResources().getDrawable(R.drawable.ic_block_24px, null);
         }
         icon.setTintList(Utils.getColorAttr(getContext(), android.R.attr.textColorPrimary));
-        preference.setIcon(icon);
+        messagingPreference.setIcon(icon);
+    }
 
+    private void updateHowItWorksContent(boolean isSatelliteEligible) {
         /* Composes "How it works" section, which guides how users can use satellite messaging, when
            satellite messaging is included in user's mobile plan, or it'll will be grey out. */
         if (!isSatelliteEligible) {
@@ -185,13 +213,15 @@
             category.setEnabled(false);
             category.setShouldDisableView(true);
         }
+    }
 
+    private void updateFooterContent() {
         // More about satellite messaging
         FooterPreference footerPreference = findPreference(KEY_FOOTER_PREFERENCE);
         if (footerPreference != null) {
             footerPreference.setSummary(
                     getResources().getString(R.string.satellite_setting_summary_more_information,
-                            operatorName));
+                            getSubjectString(), mSimOperatorName));
 
             final String[] link = new String[1];
             link[0] = readSatelliteMoreInfoString(mSubId);
@@ -205,8 +235,9 @@
                         }
                     }
                 });
+
                 footerPreference.setLearnMoreText(
-                        getResources().getString(R.string.more_about_satellite_messaging));
+                        getString(R.string.more_about_satellite_messaging, getDescriptionString()));
             }
         }
     }
@@ -245,6 +276,32 @@
         return bundle.getBoolean(KEY_SATELLITE_ATTACH_SUPPORTED_BOOL, false);
     }
 
+    // This is for a word which first letter is uppercase. e.g. Satellite messaging.
+    private String getSubjectString() {
+        int result;
+        if (com.android.settings.flags.Flags.satelliteOemSettingsUxMigration()) {
+            result = mIsServiceDataType
+                    ? R.string.title_satellite_setting_connectivity
+                    : R.string.satellite_setting_title;
+        } else {
+            result = R.string.satellite_setting_title;
+        }
+        return getString(result);
+    }
+
+    // This is for a word without uppercase letter. e.g. satellite messaging.
+    private String getDescriptionString() {
+        int result;
+        if (com.android.settings.flags.Flags.satelliteOemSettingsUxMigration()) {
+            result = mIsServiceDataType
+                    ? R.string.description_satellite_setting_connectivity
+                    : R.string.description_satellite_setting_messaging;
+        } else {
+            result = R.string.satellite_setting_title;
+        }
+        return getString(result);
+    }
+
     private static void loge(String message) {
         Log.e(TAG, message);
     }
diff --git a/src/com/android/settings/network/telephony/SatelliteSettingPreferenceController.java b/src/com/android/settings/network/telephony/SatelliteSettingPreferenceController.java
index efdd9cb..f13ea35 100644
--- a/src/com/android/settings/network/telephony/SatelliteSettingPreferenceController.java
+++ b/src/com/android/settings/network/telephony/SatelliteSettingPreferenceController.java
@@ -16,16 +16,25 @@
 
 package com.android.settings.network.telephony;
 
+import static android.telephony.NetworkRegistrationInfo.SERVICE_TYPE_DATA;
+import static android.telephony.NetworkRegistrationInfo.SERVICE_TYPE_SMS;
+
 import android.content.Context;
 import android.content.Intent;
 import android.os.PersistableBundle;
 import android.provider.Settings;
 import android.telephony.CarrierConfigManager;
+import android.telephony.TelephonyCallback;
+import android.telephony.TelephonyManager;
+import android.telephony.satellite.NtnSignalStrength;
 import android.telephony.satellite.SatelliteManager;
 import android.util.Log;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
+import androidx.lifecycle.DefaultLifecycleObserver;
+import androidx.lifecycle.LifecycleOwner;
 import androidx.preference.Preference;
 import androidx.preference.PreferenceScreen;
 
@@ -33,28 +42,33 @@
 import com.android.settings.R;
 import com.android.settings.SettingsActivity;
 import com.android.settings.network.CarrierConfigCache;
-import com.android.settingslib.core.lifecycle.LifecycleObserver;
-import com.android.settingslib.core.lifecycle.events.OnStart;
-import com.android.settingslib.core.lifecycle.events.OnStop;
 
+import java.util.List;
 import java.util.Set;
 
 /**
  * Preference controller for "Satellite Setting"
  */
 public class SatelliteSettingPreferenceController extends
-        TelephonyBasePreferenceController implements LifecycleObserver, OnStart, OnStop {
-
+        TelephonyBasePreferenceController implements DefaultLifecycleObserver {
     private static final String TAG = "SatelliteSettingPreferenceController";
 
     CarrierConfigCache mCarrierConfigCache;
     SatelliteManager mSatelliteManager;
-    @Nullable private Boolean mIsSatelliteEligible = null;
+    private TelephonyManager mTelephonyManager = null;
+    @VisibleForTesting
+    final CarrierRoamingNtnModeCallback mCarrierRoamingNtnModeCallback =
+            new CarrierRoamingNtnModeCallback();
+
+    @Nullable
+    private Boolean mIsSatelliteEligible = null;
+    private boolean mIsServiceDataType = false;
 
     public SatelliteSettingPreferenceController(@NonNull Context context, @NonNull String key) {
         super(context, key);
         mCarrierConfigCache = CarrierConfigCache.getInstance(context);
         mSatelliteManager = context.getSystemService(SatelliteManager.class);
+        mTelephonyManager = context.getSystemService(TelephonyManager.class);
     }
 
     @Override
@@ -76,11 +90,18 @@
     }
 
     @Override
-    public void onStart() {
+    public void onResume(@NonNull LifecycleOwner owner) {
+        if (com.android.settings.flags.Flags.satelliteOemSettingsUxMigration()) {
+            mTelephonyManager.registerTelephonyCallback(mContext.getMainExecutor(),
+                    mCarrierRoamingNtnModeCallback);
+        }
     }
 
     @Override
-    public void onStop() {
+    public void onPause(@NonNull LifecycleOwner owner) {
+        if (com.android.settings.flags.Flags.satelliteOemSettingsUxMigration()) {
+            mTelephonyManager.unregisterTelephonyCallback(mCarrierRoamingNtnModeCallback);
+        }
     }
 
     @Override
@@ -93,6 +114,7 @@
     public void updateState(@Nullable Preference preference) {
         super.updateState(preference);
         if (preference != null) {
+            mCarrierRoamingNtnModeCallback.mPref = preference;
             updateSummary(preference);
         }
     }
@@ -106,6 +128,7 @@
             // This will setup the Home and Search affordance
             intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_AS_SUBSETTING, true);
             intent.putExtra(SatelliteSetting.SUB_ID, mSubId);
+            intent.putExtra(SatelliteSetting.EXTRA_IS_SERVICE_DATA_TYPE, mIsServiceDataType);
             mContext.startActivity(intent);
             return true;
         }
@@ -115,11 +138,13 @@
 
     /**
      * Set subId for Satellite Settings page.
+     *
      * @param subId subscription ID.
      */
     public void init(int subId) {
         logd("init(), subId=" + subId);
         mSubId = subId;
+        mTelephonyManager = mTelephonyManager.createForSubscriptionId(subId);
     }
 
     private void updateSummary(Preference preference) {
@@ -148,4 +173,45 @@
     private static void loge(String message) {
         Log.e(TAG, message);
     }
+
+    @VisibleForTesting
+    class CarrierRoamingNtnModeCallback extends TelephonyCallback implements
+            TelephonyCallback.CarrierRoamingNtnModeListener {
+        Preference mPref = null;
+
+        @Override
+        public void onCarrierRoamingNtnAvailableServicesChanged(List<Integer> availableServices) {
+            CarrierRoamingNtnModeListener.super.onCarrierRoamingNtnAvailableServicesChanged(
+                    availableServices);
+            boolean isSmsAvailable = availableServices.contains(SERVICE_TYPE_SMS);
+            boolean isDataAvailable = availableServices.contains(SERVICE_TYPE_DATA);
+            logd("isSmsAvailable : " + isSmsAvailable
+                    + " / isDataAvailable " + isDataAvailable);
+            if (mPref == null) {
+                logd("Satellite preference is not initialized yet");
+                return;
+            }
+            if (isDataAvailable) {
+                mIsServiceDataType = true;
+                mPref.setTitle(R.string.title_satellite_setting_connectivity);
+            } else if (isSmsAvailable) {
+                mPref.setTitle(R.string.satellite_setting_title);
+            }
+        }
+
+        @Override
+        public void onCarrierRoamingNtnEligibleStateChanged(boolean eligible) {
+            // Do nothing
+        }
+
+        @Override
+        public void onCarrierRoamingNtnModeChanged(boolean active) {
+            // Do nothing
+        }
+
+        @Override
+        public void onCarrierRoamingNtnSignalStrengthChanged(NtnSignalStrength ntnSignalStrength) {
+            // Do nothing
+        }
+    }
 }
diff --git a/src/com/android/settings/network/telephony/SatelliteSettingsPreferenceCategoryController.java b/src/com/android/settings/network/telephony/SatelliteSettingsPreferenceCategoryController.java
index ae3262f..c182059 100644
--- a/src/com/android/settings/network/telephony/SatelliteSettingsPreferenceCategoryController.java
+++ b/src/com/android/settings/network/telephony/SatelliteSettingsPreferenceCategoryController.java
@@ -33,6 +33,7 @@
 import androidx.preference.PreferenceScreen;
 
 import com.android.settings.R;
+import com.android.settings.flags.Flags;
 
 import java.util.Arrays;
 import java.util.List;
@@ -87,13 +88,17 @@
 
     @Override
     public void onResume(@NonNull LifecycleOwner owner) {
-        mTelephonyManager.registerTelephonyCallback(mContext.getMainExecutor(),
-                mCarrierRoamingNtnModeCallback);
+        if (Flags.satelliteOemSettingsUxMigration()) {
+            mTelephonyManager.registerTelephonyCallback(mContext.getMainExecutor(),
+                    mCarrierRoamingNtnModeCallback);
+        }
     }
 
     @Override
     public void onPause(@NonNull LifecycleOwner owner) {
-        mTelephonyManager.unregisterTelephonyCallback(mCarrierRoamingNtnModeCallback);
+        if (Flags.satelliteOemSettingsUxMigration()) {
+            mTelephonyManager.unregisterTelephonyCallback(mCarrierRoamingNtnModeCallback);
+        }
     }
 
     @VisibleForTesting
diff --git a/tests/unit/src/com/android/settings/network/telephony/SatelliteSettingsPreferenceCategoryControllerTest.java b/tests/unit/src/com/android/settings/network/telephony/SatelliteSettingsPreferenceCategoryControllerTest.java
index bd06a64..299ea13 100644
--- a/tests/unit/src/com/android/settings/network/telephony/SatelliteSettingsPreferenceCategoryControllerTest.java
+++ b/tests/unit/src/com/android/settings/network/telephony/SatelliteSettingsPreferenceCategoryControllerTest.java
@@ -114,7 +114,7 @@
                 new int[]{SERVICE_TYPE_DATA});
 
         assertThat(preferenceCategory.getTitle()).isEqualTo(
-                mContext.getString(R.string.satellite_setting_connectivity));
+                mContext.getString(R.string.title_satellite_setting_connectivity));
     }
 
 
diff --git a/tests/unit/src/com/android/settings/network/telephony/SatelliteSettingsPreferenceControllerTest.java b/tests/unit/src/com/android/settings/network/telephony/SatelliteSettingsPreferenceControllerTest.java
new file mode 100644
index 0000000..b15c660
--- /dev/null
+++ b/tests/unit/src/com/android/settings/network/telephony/SatelliteSettingsPreferenceControllerTest.java
@@ -0,0 +1,179 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.network.telephony;
+
+import static android.telephony.NetworkRegistrationInfo.SERVICE_TYPE_DATA;
+import static android.telephony.NetworkRegistrationInfo.SERVICE_TYPE_SMS;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE;
+import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.os.Looper;
+import android.os.PersistableBundle;
+import android.platform.test.annotations.EnableFlags;
+import android.telephony.CarrierConfigManager;
+import android.telephony.TelephonyManager;
+import android.telephony.satellite.SatelliteManager;
+
+import androidx.preference.Preference;
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import com.android.internal.telephony.flags.Flags;
+import com.android.settings.R;
+import com.android.settings.network.CarrierConfigCache;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+
+import java.util.List;
+
+@RunWith(AndroidJUnit4.class)
+public class SatelliteSettingsPreferenceControllerTest {
+    private static final String KEY = "key";
+    private static final int TEST_SUB_ID = 0;
+
+    @Rule
+    public final MockitoRule mMockitoRule = MockitoJUnit.rule();
+
+    @Mock
+    private CarrierConfigCache mCarrierConfigCache;
+    @Mock
+    private TelephonyManager mTelephonyManager;
+
+    private Context mContext = null;
+    private SatelliteManager mSatelliteManager;
+    private SatelliteSettingPreferenceController mController = null;
+    private PersistableBundle mCarrierConfig = new PersistableBundle();
+
+    @Before
+    public void setUp() {
+        if (Looper.myLooper() == null) {
+            Looper.prepare();
+        }
+        mContext = spy(ApplicationProvider.getApplicationContext());
+        mSatelliteManager = new SatelliteManager(mContext);
+        CarrierConfigCache.setTestInstance(mContext, mCarrierConfigCache);
+        when(mContext.getSystemService(SatelliteManager.class)).thenReturn(mSatelliteManager);
+        when(mContext.getSystemService(TelephonyManager.class)).thenReturn(mTelephonyManager);
+        when(mTelephonyManager.createForSubscriptionId(TEST_SUB_ID)).thenReturn(mTelephonyManager);
+        mController = spy(new SatelliteSettingPreferenceController(mContext, KEY));
+    }
+
+    @Test
+    @EnableFlags(Flags.FLAG_CARRIER_ENABLED_SATELLITE_FLAG)
+    public void getAvailabilityStatus_noSatellite_returnUnsupport() {
+        when(mContext.getSystemService(SatelliteManager.class)).thenReturn(null);
+        mController = new SatelliteSettingPreferenceController(mContext, KEY);
+
+        int result = mController.getAvailabilityStatus(TEST_SUB_ID);
+
+        assertThat(result).isEqualTo(UNSUPPORTED_ON_DEVICE);
+    }
+
+    @Test
+    @EnableFlags(Flags.FLAG_CARRIER_ENABLED_SATELLITE_FLAG)
+    public void getAvailabilityStatus_carrierIsNotSupport_returnUnavailable() {
+        when(mContext.getSystemService(SatelliteManager.class)).thenReturn(null);
+        mCarrierConfig.putBoolean(
+                CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL,
+                false);
+        when(mCarrierConfigCache.getConfigForSubId(TEST_SUB_ID)).thenReturn(mCarrierConfig);
+
+        int result = mController.getAvailabilityStatus(TEST_SUB_ID);
+
+        assertThat(result).isEqualTo(CONDITIONALLY_UNAVAILABLE);
+    }
+
+    @Test
+    @EnableFlags(Flags.FLAG_CARRIER_ENABLED_SATELLITE_FLAG)
+    public void getAvailabilityStatus_carrierIsSupport_returnAvailable() {
+        when(mContext.getSystemService(SatelliteManager.class)).thenReturn(null);
+        mCarrierConfig.putBoolean(
+                CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL,
+                true);
+        when(mCarrierConfigCache.getConfigForSubId(TEST_SUB_ID)).thenReturn(mCarrierConfig);
+
+        int result = mController.getAvailabilityStatus(TEST_SUB_ID);
+
+        assertThat(result).isEqualTo(AVAILABLE);
+    }
+
+    @Test
+    @EnableFlags(com.android.settings.flags.Flags.FLAG_SATELLITE_OEM_SETTINGS_UX_MIGRATION)
+    public void getAvailabilityStatus_registerTelephonyCallback_success() {
+        mController.init(TEST_SUB_ID);
+        mController.onResume(null);
+
+        verify(mTelephonyManager).registerTelephonyCallback(any(), any());
+    }
+
+    @Test
+    @EnableFlags(com.android.settings.flags.Flags.FLAG_SATELLITE_OEM_SETTINGS_UX_MIGRATION)
+    public void getAvailabilityStatus_unregisterTelephonyCallback_success() {
+        mController.init(TEST_SUB_ID);
+        mController.onPause(null);
+
+        verify(mTelephonyManager).unregisterTelephonyCallback(any());
+    }
+
+    @Test
+    @EnableFlags(com.android.settings.flags.Flags.FLAG_SATELLITE_OEM_SETTINGS_UX_MIGRATION)
+    public void getAvailabilityStatus_hasServiceDataType_showDataUi() {
+        mController.init(TEST_SUB_ID);
+        Preference preference = new Preference(mContext);
+        preference.setKey(KEY);
+        preference.setTitle("test title");
+        mController.updateState(preference);
+
+        mController.mCarrierRoamingNtnModeCallback.onCarrierRoamingNtnAvailableServicesChanged(
+                List.of(SERVICE_TYPE_SMS, SERVICE_TYPE_DATA));
+
+        assertThat(preference.getTitle()).isEqualTo(
+                mContext.getString(R.string.title_satellite_setting_connectivity));
+    }
+
+    @Test
+    @EnableFlags(com.android.settings.flags.Flags.FLAG_SATELLITE_OEM_SETTINGS_UX_MIGRATION)
+    public void getAvailabilityStatus_hasServiceDataType_showSmsUi() {
+        mController.init(TEST_SUB_ID);
+        Preference preference = new Preference(mContext);
+        preference.setKey(KEY);
+        preference.setTitle("test title");
+        mController.updateState(preference);
+
+        mController.mCarrierRoamingNtnModeCallback.onCarrierRoamingNtnAvailableServicesChanged(
+                List.of(SERVICE_TYPE_SMS));
+
+        assertThat(preference.getTitle()).isEqualTo(
+                mContext.getString(R.string.satellite_setting_title));
+    }
+}
