diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index 3e48a9c..230c103 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -345,6 +345,7 @@
         /* empty */
     }
 
+    public static class SatelliteSettingActivity extends SettingsActivity { /* empty */ }
     public static class ApnSettingsActivity extends SettingsActivity { /* empty */ }
     public static class WifiCallingSettingsActivity extends SettingsActivity { /* empty */ }
     public static class MemorySettingsActivity extends SettingsActivity { /* empty */ }
diff --git a/src/com/android/settings/core/gateway/SettingsGateway.java b/src/com/android/settings/core/gateway/SettingsGateway.java
index 3433e12..a5a2131 100644
--- a/src/com/android/settings/core/gateway/SettingsGateway.java
+++ b/src/com/android/settings/core/gateway/SettingsGateway.java
@@ -143,6 +143,7 @@
 import com.android.settings.network.apn.ApnSettings;
 import com.android.settings.network.telephony.MobileNetworkSettings;
 import com.android.settings.network.telephony.NetworkSelectSettings;
+import com.android.settings.network.telephony.SatelliteSetting;
 import com.android.settings.network.tether.TetherSettings;
 import com.android.settings.nfc.PaymentSettings;
 import com.android.settings.notification.ConfigureNotificationSettings;
@@ -300,6 +301,7 @@
             AppNotificationSettings.class.getName(),
             NotificationAssistantPicker.class.getName(),
             ChannelNotificationSettings.class.getName(),
+            SatelliteSetting.class.getName(),
             ApnSettings.class.getName(),
             ApnEditor.class.getName(),
             WifiCallingSettings.class.getName(),
diff --git a/src/com/android/settings/network/telephony/MobileNetworkSettings.java b/src/com/android/settings/network/telephony/MobileNetworkSettings.java
index b4b40ef..4188f8d 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkSettings.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkSettings.java
@@ -255,6 +255,11 @@
             roamingPreferenceController.init(getFragmentManager(), mSubId,
                     mMobileNetworkInfoEntity);
         }
+        final SatelliteSettingPreferenceController satelliteSettingPreferenceController = use(
+                SatelliteSettingPreferenceController.class);
+        if (satelliteSettingPreferenceController != null) {
+            satelliteSettingPreferenceController.init(mSubId);
+        }
         use(ApnPreferenceController.class).init(mSubId);
         use(CarrierPreferenceController.class).init(mSubId);
         use(DataUsagePreferenceController.class).init(mSubId);
diff --git a/src/com/android/settings/network/telephony/SatelliteSetting.java b/src/com/android/settings/network/telephony/SatelliteSetting.java
new file mode 100644
index 0000000..ecfa8e4
--- /dev/null
+++ b/src/com/android/settings/network/telephony/SatelliteSetting.java
@@ -0,0 +1,198 @@
+/*
+ * 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 android.app.Activity;
+import android.app.settings.SettingsEnums;
+import android.content.Intent;
+import android.graphics.Typeface;
+import android.graphics.drawable.Drawable;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.UserManager;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
+import android.telephony.satellite.SatelliteManager;
+import android.text.SpannableString;
+import android.text.Spanned;
+import android.text.style.StyleSpan;
+import android.text.style.UnderlineSpan;
+import android.util.Log;
+import android.view.View;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceCategory;
+
+import com.android.settings.R;
+import com.android.settings.dashboard.RestrictedDashboardFragment;
+import com.android.settingslib.HelpUtils;
+import com.android.settingslib.Utils;
+import com.android.settingslib.widget.FooterPreference;
+
+import java.util.Set;
+
+/** 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 =
+            "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 KEY_FOOTER_PREFERENCE = "satellite_setting_extra_info_footer_pref";
+    public static final String SUB_ID = "sub_id";
+
+    private Activity mActivity;
+    private TelephonyManager mTelephonymanager;
+    private SatelliteManager mSatelliteManager;
+    private int mSubId;
+
+    public SatelliteSetting() {
+        super(UserManager.DISALLOW_CONFIG_MOBILE_NETWORKS);
+    }
+
+    @Override
+    public int getMetricsCategory() {
+        return SettingsEnums.SATELLITE_SETTING;
+    }
+
+    @Override
+    public void onCreate(@NonNull Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        mActivity = getActivity();
+        mTelephonymanager = mActivity.getSystemService(TelephonyManager.class);
+        mSatelliteManager = mActivity.getSystemService(SatelliteManager.class);
+        mSubId = mActivity.getIntent().getIntExtra(SUB_ID,
+                SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+    }
+
+    @Override
+    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+        super.onViewCreated(view, savedInstanceState);
+        updateDynamicPreferenceViews();
+    }
+
+    @Override
+    protected String getLogTag() {
+        return TAG;
+    }
+
+    @Override
+    protected int getPreferenceScreenResId() {
+        return R.xml.satellite_setting;
+    }
+
+    private void updateDynamicPreferenceViews() {
+        String operatorName = mTelephonymanager.getSimOperatorName(mSubId);
+        boolean isSatelliteEligible = isSatelliteEligible();
+
+        // About satellite messaging
+        Preference preference = findPreference(PREF_KEY_ABOUT_SATELLITE_MESSAGING);
+        preference.setTitle(
+                getResources().getString(R.string.title_about_satellite_setting, operatorName));
+
+        // Your mobile plan
+        PreferenceCategory prefCategory = findPreference(PREF_KEY_CATEGORY_YOUR_SATELLITE_PLAN);
+        prefCategory.setTitle(getResources().getString(R.string.category_title_your_satellite_plan,
+                operatorName));
+
+        preference = findPreference(PREF_KEY_YOUR_SATELLITE_PLAN);
+        Drawable icon;
+        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 = getResources().getDrawable(R.drawable.ic_check_circle_24px);
+        } 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);
+            /* 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));
+            spannable.setSpan(new UnderlineSpan(), 0, spannable.length(),
+                    Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+            spannable.setSpan(new StyleSpan(Typeface.BOLD), 0, spannable.length(),
+                    Spanned.SPAN_INCLUSIVE_INCLUSIVE);
+            preference.setSummary(spannable);
+            /* The link will lead users to a guide page */
+            preference.setOnPreferenceClickListener(pref -> {
+                String url = getResources().getString(R.string.more_info_satellite_messaging_link);
+                if (!url.isEmpty()) {
+                    Uri uri = Uri.parse(url);
+                    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
+                    startActivity(intent);
+                }
+                return true;
+            });
+            icon = getResources().getDrawable(R.drawable.ic_block_24px);
+        }
+        icon.setTintList(Utils.getColorAttr(getContext(), android.R.attr.textColorPrimary));
+        preference.setIcon(icon);
+
+        /* 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) {
+            PreferenceCategory category = findPreference(PREF_KEY_CATEGORY_HOW_IT_WORKS);
+            category.setEnabled(false);
+            category.setShouldDisableView(true);
+        }
+
+        // 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));
+
+            final String[] link = new String[1];
+            link[0] = getResources().getString(R.string.more_info_satellite_messaging_link);
+            footerPreference.setLearnMoreAction(view -> {
+                if (!link[0].isEmpty()) {
+                    Intent helpIntent = HelpUtils.getHelpIntent(mActivity, link[0],
+                            this.getClass().getName());
+                    if (helpIntent != null) {
+                        mActivity.startActivityForResult(helpIntent, /*requestCode=*/ 0);
+                    }
+                }
+            });
+            footerPreference.setLearnMoreText(
+                    getResources().getString(R.string.more_about_satellite_messaging));
+
+            // TODO : b/320467418 add rounded rectangle border line to footer preference.
+        }
+    }
+
+    private boolean isSatelliteEligible() {
+        try {
+            Set<Integer> restrictionReason =
+                    mSatelliteManager.getSatelliteAttachRestrictionReasonsForCarrier(mSubId);
+            return !restrictionReason.contains(
+                    SatelliteManager.SATELLITE_COMMUNICATION_RESTRICTION_REASON_ENTITLEMENT);
+        } catch (SecurityException | IllegalStateException | IllegalArgumentException ex) {
+            loge(ex.toString());
+            return false;
+        }
+    }
+
+    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
new file mode 100644
index 0000000..7de7fcb
--- /dev/null
+++ b/src/com/android/settings/network/telephony/SatelliteSettingPreferenceController.java
@@ -0,0 +1,139 @@
+/*
+ * 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 android.content.Context;
+import android.content.Intent;
+import android.os.PersistableBundle;
+import android.provider.Settings;
+import android.telephony.CarrierConfigManager;
+import android.telephony.satellite.SatelliteManager;
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+
+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.Set;
+
+/**
+ * Preference controller for "Satellite Setting"
+ */
+public class SatelliteSettingPreferenceController extends
+        TelephonyBasePreferenceController implements LifecycleObserver, OnStart, OnStop {
+
+    private static final String TAG = "SatelliteSettingPreferenceController";
+
+    CarrierConfigCache mCarrierConfigCache;
+    SatelliteManager mSatelliteManager;
+    @Nullable private Boolean mIsSatelliteEligible = null;
+
+    public SatelliteSettingPreferenceController(@NonNull Context context, @NonNull String key) {
+        super(context, key);
+        mCarrierConfigCache = CarrierConfigCache.getInstance(context);
+        mSatelliteManager = context.getSystemService(SatelliteManager.class);
+    }
+
+    @Override
+    public int getAvailabilityStatus(int subId) {
+        final PersistableBundle carrierConfig = mCarrierConfigCache.getConfigForSubId(subId);
+        final boolean isSatelliteAttachSupported = carrierConfig.getBoolean(
+                CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL);
+
+        return isSatelliteAttachSupported ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
+    }
+
+    @Override
+    public void onStart() {
+    }
+
+    @Override
+    public void onStop() {
+    }
+
+    @Override
+    public void displayPreference(@NonNull PreferenceScreen screen) {
+        super.displayPreference(screen);
+    }
+
+    @Override
+    public void updateState(@Nullable Preference preference) {
+        super.updateState(preference);
+        if (preference != null) {
+            updateSummary(preference);
+        }
+    }
+
+    @Override
+    public boolean handlePreferenceTreeClick(@NonNull Preference preference) {
+        if (getPreferenceKey().equals(preference.getKey())) {
+            // This activity runs in phone process, we must use intent to start
+            final Intent intent = new Intent(Settings.ACTION_SATELLITE_SETTING);
+            // This will setup the Home and Search affordance
+            intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_AS_SUBSETTING, true);
+            intent.putExtra(SatelliteSetting.SUB_ID, mSubId);
+            mContext.startActivity(intent);
+            return true;
+        }
+
+        return false;
+    }
+
+    /**
+     * Set subId for Satellite Settings page.
+     * @param subId subscription ID.
+     */
+    public void init(int subId) {
+        logd("init(), subId=" + subId);
+        mSubId = subId;
+    }
+
+    private void updateSummary(Preference preference) {
+        try {
+            Set<Integer> restrictionReason =
+                    mSatelliteManager.getSatelliteAttachRestrictionReasonsForCarrier(mSubId);
+            boolean isSatelliteEligible = !restrictionReason.contains(
+                    SatelliteManager.SATELLITE_COMMUNICATION_RESTRICTION_REASON_ENTITLEMENT);
+            if (mIsSatelliteEligible == null || mIsSatelliteEligible != isSatelliteEligible) {
+                mIsSatelliteEligible = isSatelliteEligible;
+                String summary = mContext.getString(
+                        mIsSatelliteEligible ? R.string.satellite_setting_enabled_summary
+                                : R.string.satellite_setting_disabled_summary);
+                preference.setSummary(summary);
+            }
+        } catch (SecurityException | IllegalStateException | IllegalArgumentException ex) {
+            loge(ex.toString());
+            preference.setSummary(R.string.satellite_setting_disabled_summary);
+        }
+    }
+
+    private static void logd(String message) {
+        Log.d(TAG, message);
+    }
+
+    private static void loge(String message) {
+        Log.e(TAG, message);
+    }
+}
