summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author tom hsu <tomhsu@google.com> 2025-03-25 03:02:11 +0000
committer Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2025-03-31 20:54:17 -0700
commite9e45b4a0190e816b4fba92a583d42fc5dea38f3 (patch)
treecb0e3d60e9e4ac63787ca96cd97775a24f92448d
parent94029d5c7c1d1b35f85248486b9f3071ed959e17 (diff)
[Satellite] Refactor API usage to Util class.
Flag: EXEMPT refactor Fix: b/403149290 Test: atest pass (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:8916db934fb3d7dc1f94f67c7b409beeff2c6ac6) Merged-In: I8f6375c59cbb2010ad9232b8abe71af60c6133f9 Change-Id: I8f6375c59cbb2010ad9232b8abe71af60c6133f9
-rw-r--r--src/com/android/settings/network/telephony/satellite/SatelliteAppListCategoryController.java18
-rw-r--r--src/com/android/settings/network/telephony/satellite/SatelliteCarrierSettingUtils.java105
-rw-r--r--src/com/android/settings/network/telephony/satellite/SatelliteSetting.java41
-rw-r--r--src/com/android/settings/network/telephony/satellite/SatelliteSettingAccountInfoController.java19
-rw-r--r--src/com/android/settings/network/telephony/satellite/SatelliteSettingPreferenceController.java8
-rw-r--r--src/com/android/settings/network/telephony/satellite/SatelliteSettingsPreferenceCategoryController.java13
-rw-r--r--tests/unit/src/com/android/settings/network/telephony/satellite/SatelliteCarrierSettingUtilsTest.java125
-rw-r--r--tests/unit/src/com/android/settings/network/telephony/satellite/SatelliteSettingPreferenceControllerTest.java (renamed from tests/unit/src/com/android/settings/network/telephony/satellite/SatelliteSettingsPreferenceControllerTest.java)2
8 files changed, 247 insertions, 84 deletions
diff --git a/src/com/android/settings/network/telephony/satellite/SatelliteAppListCategoryController.java b/src/com/android/settings/network/telephony/satellite/SatelliteAppListCategoryController.java
index d182229dd01..b5746492c2d 100644
--- a/src/com/android/settings/network/telephony/satellite/SatelliteAppListCategoryController.java
+++ b/src/com/android/settings/network/telephony/satellite/SatelliteAppListCategoryController.java
@@ -38,7 +38,6 @@ import com.android.settings.network.telephony.TelephonyBasePreferenceController;
import com.android.settingslib.Utils;
import java.util.List;
-import java.util.Set;
/** A controller to show some of apps info which supported on Satellite service. */
public class SatelliteAppListCategoryController extends TelephonyBasePreferenceController {
@@ -58,7 +57,7 @@ public class SatelliteAppListCategoryController extends TelephonyBasePreferenceC
super(context, preferenceKey);
}
- /** Initialize the necessary applications' data*/
+ /** Initialize the necessary applications' data */
public void init(int subId, @NonNull PersistableBundle configBundle, boolean isSmsAvailable,
boolean isDataAvailable) {
mSubId = subId;
@@ -121,20 +120,7 @@ public class SatelliteAppListCategoryController extends TelephonyBasePreferenceC
== CARRIER_ROAMING_NTN_CONNECT_MANUAL) {
return mIsSmsAvailable;
}
- SatelliteManager satelliteManager = mContext.getSystemService(SatelliteManager.class);
- if (satelliteManager == null) {
- Log.d(TAG, "SatelliteManager is null.");
- return false;
- }
- try {
- Set<Integer> restrictionReason =
- satelliteManager.getAttachRestrictionReasonsForCarrier(mSubId);
- return !restrictionReason.contains(
- SatelliteManager.SATELLITE_COMMUNICATION_RESTRICTION_REASON_ENTITLEMENT);
- } catch (SecurityException | IllegalStateException | IllegalArgumentException ex) {
- Log.d(TAG, "Error to getAttachRestrictionReasonsForCarrier : " + ex);
- return false;
- }
+ return SatelliteCarrierSettingUtils.isSatelliteAccountEligible(mContext, mSubId);
}
static ApplicationInfo getApplicationInfo(Context context, String packageName) {
diff --git a/src/com/android/settings/network/telephony/satellite/SatelliteCarrierSettingUtils.java b/src/com/android/settings/network/telephony/satellite/SatelliteCarrierSettingUtils.java
new file mode 100644
index 00000000000..52126550737
--- /dev/null
+++ b/src/com/android/settings/network/telephony/satellite/SatelliteCarrierSettingUtils.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2025 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.satellite;
+
+import static android.telephony.CarrierConfigManager.SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED;
+
+import android.content.Context;
+import android.telephony.satellite.SatelliteManager;
+import android.util.Log;
+
+import androidx.annotation.VisibleForTesting;
+
+import java.util.Collections;
+import java.util.Set;
+
+/** A until for carrier satellite setting. */
+public class SatelliteCarrierSettingUtils {
+ private static final String TAG = "SatelliteCarrierSettingUtils";
+
+ @VisibleForTesting
+ static SatelliteManagerWrapper sSatelliteManagerWrapper;
+
+ /**
+ * Checks account is eligible.
+ *
+ * @return true if there is no restriction reason returned.
+ */
+ public static boolean isSatelliteAccountEligible(Context context, int subId) {
+ SatelliteManagerWrapper wrapper =
+ sSatelliteManagerWrapper == null ? new SatelliteManagerWrapper(context)
+ : sSatelliteManagerWrapper;
+
+ Set<Integer> restrictionReason = wrapper.getAttachRestrictionReasonsForCarrier(subId);
+ return !restrictionReason.contains(
+ SatelliteManager.SATELLITE_COMMUNICATION_RESTRICTION_REASON_ENTITLEMENT);
+ }
+
+ /**
+ * Use getSatelliteDataSupportMode to check data mode is restricted.
+ *
+ * @return true if data mode is restricted.
+ */
+ public static boolean isSatelliteDataRestricted(Context context, int subId) {
+ SatelliteManagerWrapper wrapper =
+ sSatelliteManagerWrapper == null ? new SatelliteManagerWrapper(context)
+ : sSatelliteManagerWrapper;
+ return wrapper.getSatelliteDataSupportMode(subId) <= SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED;
+ }
+
+
+ @VisibleForTesting
+ static class SatelliteManagerWrapper {
+ private final SatelliteManager mSatelliteManager;
+
+ SatelliteManagerWrapper(Context context) {
+ mSatelliteManager = context.getSystemService(SatelliteManager.class);
+ }
+
+ public Set<Integer> getAttachRestrictionReasonsForCarrier(int subId) {
+ if (mSatelliteManager == null) {
+ Log.d(TAG, "SatelliteManager is null.");
+ return Collections.emptySet();
+ }
+ try {
+ Set<Integer> restrictionReason =
+ mSatelliteManager.getAttachRestrictionReasonsForCarrier(subId);
+ Log.d(TAG, "Error to getAttachRestrictionReasonsForCarrier : " + restrictionReason);
+ return restrictionReason;
+ } catch (SecurityException | IllegalStateException | IllegalArgumentException e) {
+ Log.d(TAG, "Error to getAttachRestrictionReasonsForCarrier : " + e);
+ }
+ return Collections.emptySet();
+ }
+
+ public int getSatelliteDataSupportMode(int subId) {
+ if (mSatelliteManager == null) {
+ Log.d(TAG, "SatelliteManager is null.");
+ return SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED;
+ }
+
+ var dataMode = SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED;
+ try {
+ dataMode = mSatelliteManager.getSatelliteDataSupportMode(subId);
+ Log.d(TAG, "Data mode : " + dataMode);
+ } catch (IllegalStateException e) {
+ Log.d(TAG, "Failed to get data mode : " + e);
+ }
+ return dataMode;
+ }
+ }
+}
diff --git a/src/com/android/settings/network/telephony/satellite/SatelliteSetting.java b/src/com/android/settings/network/telephony/satellite/SatelliteSetting.java
index 8b7fdc68a4c..c763417a54a 100644
--- a/src/com/android/settings/network/telephony/satellite/SatelliteSetting.java
+++ b/src/com/android/settings/network/telephony/satellite/SatelliteSetting.java
@@ -23,7 +23,9 @@ import static android.telephony.CarrierConfigManager.KEY_EMERGENCY_MESSAGING_SUP
import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ATTACH_SUPPORTED_BOOL;
import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL;
import static android.telephony.CarrierConfigManager.KEY_SATELLITE_INFORMATION_REDIRECT_URL_STRING;
-import static android.telephony.CarrierConfigManager.SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED;
+
+import static com.android.settings.network.telephony.satellite.SatelliteCarrierSettingUtils.isSatelliteAccountEligible;
+import static com.android.settings.network.telephony.satellite.SatelliteCarrierSettingUtils.isSatelliteDataRestricted;
import android.app.Activity;
import android.app.settings.SettingsEnums;
@@ -45,8 +47,6 @@ import androidx.preference.PreferenceCategory;
import com.android.settings.R;
import com.android.settings.dashboard.RestrictedDashboardFragment;
-import java.util.Set;
-
/** Handle Satellite Setting Preference Layout. */
public class SatelliteSetting extends RestrictedDashboardFragment {
private static final String TAG = "SatelliteSetting";
@@ -108,7 +108,7 @@ public class SatelliteSetting extends RestrictedDashboardFragment {
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
- boolean isSatelliteEligible = isSatelliteEligible();
+ boolean isSatelliteEligible = isSatelliteAccountEligible(getContext(), mSubId);
updateHowItWorksContent(isSatelliteEligible);
}
@@ -141,22 +141,6 @@ public class SatelliteSetting extends RestrictedDashboardFragment {
supportedService.setSummary(R.string.summary_supported_service_for_manual_type);
}
- private boolean isSatelliteEligible() {
- if (isCarrierRoamingNtnConnectedTypeManual()) {
- return mIsSmsAvailableForManualType;
- }
- try {
- Set<Integer> restrictionReason =
- mSatelliteManager.getAttachRestrictionReasonsForCarrier(mSubId);
- Log.d(TAG, "Restriction reason : " + restrictionReason);
- return !restrictionReason.contains(
- SatelliteManager.SATELLITE_COMMUNICATION_RESTRICTION_REASON_ENTITLEMENT);
- } catch (SecurityException | IllegalStateException | IllegalArgumentException ex) {
- loge(ex.toString());
- return false;
- }
- }
-
private PersistableBundle fetchCarrierConfigData(int subId) {
CarrierConfigManager carrierConfigManager = mActivity.getSystemService(
CarrierConfigManager.class);
@@ -189,21 +173,6 @@ public class SatelliteSetting extends RestrictedDashboardFragment {
private boolean isDataAvailableAndNotRestricted() {
return getIntent().getBooleanExtra(EXTRA_IS_SERVICE_DATA_TYPE, false)
- && !isDataRestricted();
- }
-
- private boolean isDataRestricted() {
- int dataMode = SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED;
- try {
- dataMode = mSatelliteManager.getSatelliteDataSupportMode(mSubId);
- Log.d(TAG, "Data mode : " + dataMode);
- } catch (IllegalStateException e) {
- Log.d(TAG, "Failed to get data mode : " + e);
- }
- return dataMode <= SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED;
- }
-
- private static void loge(String message) {
- Log.e(TAG, message);
+ && !isSatelliteDataRestricted(getContext(), mSubId);
}
}
diff --git a/src/com/android/settings/network/telephony/satellite/SatelliteSettingAccountInfoController.java b/src/com/android/settings/network/telephony/satellite/SatelliteSettingAccountInfoController.java
index c3ddbe953f5..844e4dac637 100644
--- a/src/com/android/settings/network/telephony/satellite/SatelliteSettingAccountInfoController.java
+++ b/src/com/android/settings/network/telephony/satellite/SatelliteSettingAccountInfoController.java
@@ -28,12 +28,10 @@ import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.PersistableBundle;
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 androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
@@ -45,8 +43,6 @@ import com.android.settings.R;
import com.android.settings.network.telephony.TelephonyBasePreferenceController;
import com.android.settingslib.Utils;
-import java.util.Set;
-
/** A controller to control content of "Your mobile plan". */
public class SatelliteSettingAccountInfoController extends TelephonyBasePreferenceController {
private static final String TAG = "SatelliteSettingAccountInfoController";
@@ -164,19 +160,6 @@ public class SatelliteSettingAccountInfoController extends TelephonyBasePreferen
== CARRIER_ROAMING_NTN_CONNECT_MANUAL) {
return mIsSmsAvailable;
}
- SatelliteManager satelliteManager = mContext.getSystemService(SatelliteManager.class);
- if (satelliteManager == null) {
- Log.d(TAG, "SatelliteManager is null.");
- return false;
- }
- try {
- Set<Integer> restrictionReason =
- satelliteManager.getAttachRestrictionReasonsForCarrier(mSubId);
- return !restrictionReason.contains(
- SatelliteManager.SATELLITE_COMMUNICATION_RESTRICTION_REASON_ENTITLEMENT);
- } catch (SecurityException | IllegalStateException | IllegalArgumentException ex) {
- Log.d(TAG, "Error to getAttachRestrictionReasonsForCarrier : " + ex.toString());
- return false;
- }
+ return SatelliteCarrierSettingUtils.isSatelliteAccountEligible(mContext, mSubId);
}
}
diff --git a/src/com/android/settings/network/telephony/satellite/SatelliteSettingPreferenceController.java b/src/com/android/settings/network/telephony/satellite/SatelliteSettingPreferenceController.java
index 04f2c5fe73f..b38359bc431 100644
--- a/src/com/android/settings/network/telephony/satellite/SatelliteSettingPreferenceController.java
+++ b/src/com/android/settings/network/telephony/satellite/SatelliteSettingPreferenceController.java
@@ -48,7 +48,6 @@ import com.android.settings.network.telephony.TelephonyBasePreferenceController;
import java.util.Arrays;
import java.util.List;
-import java.util.Set;
/**
* Preference controller for "Satellite Setting"
@@ -191,10 +190,9 @@ public class SatelliteSettingPreferenceController extends
}
try {
- Set<Integer> restrictionReason =
- mSatelliteManager.getAttachRestrictionReasonsForCarrier(mSubId);
- boolean isSatelliteEligible = !restrictionReason.contains(
- SatelliteManager.SATELLITE_COMMUNICATION_RESTRICTION_REASON_ENTITLEMENT);
+ boolean isSatelliteEligible =
+ SatelliteCarrierSettingUtils.isSatelliteAccountEligible(
+ mContext, mSubId);
if (mIsSatelliteEligible == null || mIsSatelliteEligible != isSatelliteEligible) {
mIsSatelliteEligible = isSatelliteEligible;
String summary = mContext.getString(
diff --git a/src/com/android/settings/network/telephony/satellite/SatelliteSettingsPreferenceCategoryController.java b/src/com/android/settings/network/telephony/satellite/SatelliteSettingsPreferenceCategoryController.java
index 6bf635e18f8..614ff6a695f 100644
--- a/src/com/android/settings/network/telephony/satellite/SatelliteSettingsPreferenceCategoryController.java
+++ b/src/com/android/settings/network/telephony/satellite/SatelliteSettingsPreferenceCategoryController.java
@@ -47,8 +47,8 @@ import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicBoolean;
/** Preference controller for Satellite functions in mobile network settings. */
-public class SatelliteSettingsPreferenceCategoryController
- extends TelephonyBasePreferenceController implements DefaultLifecycleObserver {
+public class SatelliteSettingsPreferenceCategoryController extends
+ TelephonyBasePreferenceController implements DefaultLifecycleObserver {
private static final String TAG = "SatelliteSettingsPrefCategoryCon";
@VisibleForTesting
@@ -107,8 +107,7 @@ public class SatelliteSettingsPreferenceCategoryController
final PersistableBundle carrierConfig = mCarrierConfigCache.getConfigForSubId(subId);
boolean isSatelliteSosSupported = false;
if (Flags.satelliteOemSettingsUxMigration()) {
- isSatelliteSosSupported = carrierConfig.getBoolean(
- KEY_SATELLITE_ESOS_SUPPORTED_BOOL);
+ isSatelliteSosSupported = carrierConfig.getBoolean(KEY_SATELLITE_ESOS_SUPPORTED_BOOL);
}
if (!carrierConfig.getBoolean(KEY_SATELLITE_ATTACH_SUPPORTED_BOOL)) {
@@ -120,8 +119,7 @@ public class SatelliteSettingsPreferenceCategoryController
}
if (CARRIER_ROAMING_NTN_CONNECT_AUTOMATIC == carrierConfig.getInt(
- KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT,
- CARRIER_ROAMING_NTN_CONNECT_AUTOMATIC)) {
+ KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT, CARRIER_ROAMING_NTN_CONNECT_AUTOMATIC)) {
return AVAILABLE_UNSEARCHABLE;
} else {
return mCarrierRoamingNtnModeCallback.isSatelliteSmsAvailable()
@@ -171,8 +169,7 @@ public class SatelliteSettingsPreferenceCategoryController
SatelliteSettingsPreferenceCategoryController mController;
private boolean mIsSatelliteSmsAvailable = false;
- CarrierRoamingNtnModeCallback(
- SatelliteSettingsPreferenceCategoryController controller) {
+ CarrierRoamingNtnModeCallback(SatelliteSettingsPreferenceCategoryController controller) {
mController = controller;
}
diff --git a/tests/unit/src/com/android/settings/network/telephony/satellite/SatelliteCarrierSettingUtilsTest.java b/tests/unit/src/com/android/settings/network/telephony/satellite/SatelliteCarrierSettingUtilsTest.java
new file mode 100644
index 00000000000..7c84307234b
--- /dev/null
+++ b/tests/unit/src/com/android/settings/network/telephony/satellite/SatelliteCarrierSettingUtilsTest.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2025 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.satellite;
+
+import static android.telephony.CarrierConfigManager.SATELLITE_DATA_SUPPORT_ALL;
+import static android.telephony.CarrierConfigManager.SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.spy;
+
+import android.content.Context;
+import android.os.Looper;
+import android.telephony.satellite.SatelliteManager;
+
+import androidx.test.core.app.ApplicationProvider;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+public class SatelliteCarrierSettingUtilsTest {
+ private static final int TEST_SUB_ID = 0;
+
+ @Rule
+ public final MockitoRule mMockitoRule = MockitoJUnit.rule();
+
+ private Context mContext;
+
+ @Before
+ public void setUp() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ mContext = spy(ApplicationProvider.getApplicationContext());
+ }
+
+ @Test
+ public void isSatelliteAccountEligible_noRestrictedReason_returnTrue() {
+ SatelliteCarrierSettingUtils.SatelliteManagerWrapper wrapper =
+ new SatelliteCarrierSettingUtils.SatelliteManagerWrapper(mContext) {
+ @Override
+ public Set<Integer> getAttachRestrictionReasonsForCarrier(int subId) {
+ return Collections.emptySet();
+ }
+ };
+ SatelliteCarrierSettingUtils.sSatelliteManagerWrapper = wrapper;
+
+ boolean result = SatelliteCarrierSettingUtils.isSatelliteAccountEligible(mContext,
+ TEST_SUB_ID);
+
+ assertThat(result).isTrue();
+ }
+
+ @Test
+ public void isSatelliteAccountEligible_hasRestrictedReason_returnFalse() throws Exception {
+ SatelliteCarrierSettingUtils.sSatelliteManagerWrapper =
+ new SatelliteCarrierSettingUtils.SatelliteManagerWrapper(mContext) {
+ @Override
+ public Set<Integer> getAttachRestrictionReasonsForCarrier(int subId) {
+ Set<Integer> set = new HashSet<>();
+ set.add(SatelliteManager
+ .SATELLITE_COMMUNICATION_RESTRICTION_REASON_ENTITLEMENT);
+ return set;
+ }
+ };
+
+ boolean result = SatelliteCarrierSettingUtils.isSatelliteAccountEligible(mContext,
+ TEST_SUB_ID);
+
+ assertThat(result).isFalse();
+ }
+
+ @Test
+ public void isSatelliteDataRestricted_unlimitedDataMode_returnFalse() throws Exception {
+ SatelliteCarrierSettingUtils.sSatelliteManagerWrapper =
+ new SatelliteCarrierSettingUtils.SatelliteManagerWrapper(mContext) {
+ @Override
+ public int getSatelliteDataSupportMode(int subId) {
+ return SATELLITE_DATA_SUPPORT_ALL;
+ }
+ };
+
+ boolean result = SatelliteCarrierSettingUtils.isSatelliteDataRestricted(mContext,
+ TEST_SUB_ID);
+
+ assertThat(result).isFalse();
+ }
+
+ @Test
+ public void isSatelliteDataRestricted_restrictedDataMode_returnTrue() throws Exception {
+ SatelliteCarrierSettingUtils.sSatelliteManagerWrapper =
+ new SatelliteCarrierSettingUtils.SatelliteManagerWrapper(mContext) {
+ @Override
+ public int getSatelliteDataSupportMode(int subId) {
+ return SATELLITE_DATA_SUPPORT_ONLY_RESTRICTED;
+ }
+ };
+
+ boolean result = SatelliteCarrierSettingUtils.isSatelliteDataRestricted(mContext,
+ TEST_SUB_ID);
+
+ assertThat(result).isTrue();
+ }
+}
diff --git a/tests/unit/src/com/android/settings/network/telephony/satellite/SatelliteSettingsPreferenceControllerTest.java b/tests/unit/src/com/android/settings/network/telephony/satellite/SatelliteSettingPreferenceControllerTest.java
index 7cb85a580e4..abffcd8bab5 100644
--- a/tests/unit/src/com/android/settings/network/telephony/satellite/SatelliteSettingsPreferenceControllerTest.java
+++ b/tests/unit/src/com/android/settings/network/telephony/satellite/SatelliteSettingPreferenceControllerTest.java
@@ -59,7 +59,7 @@ import org.mockito.junit.MockitoRule;
@RunWith(AndroidJUnit4.class)
@UiThreadTest
-public class SatelliteSettingsPreferenceControllerTest {
+public class SatelliteSettingPreferenceControllerTest {
private static final String KEY = "SatelliteSettingsPreferenceControllerTest";
private static final int TEST_SUB_ID = 5;