[Satellite] Show category of Your data plan with Manual connection type.

- When satellite entitlement is unsupported, it shall show the category of Your data plan with Manual connection type.

Flag: EXEMPT bug fix
Fix: b/405250203
Test: atest pass
Change-Id: I91c5be123d59753d93db37226d0ae17ebb5ea1f5
This commit is contained in:
tom hsu
2025-03-21 02:35:32 +00:00
committed by Tom Hsu
parent 339367886d
commit 0569647a24
2 changed files with 22 additions and 0 deletions

View File

@@ -101,6 +101,10 @@ public class SatelliteSettingAccountInfoController extends TelephonyBasePreferen
@Override @Override
public int getAvailabilityStatus(int subId) { public int getAvailabilityStatus(int subId) {
if (mConfigBundle.getInt(KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT)
== CARRIER_ROAMING_NTN_CONNECT_MANUAL) {
return AVAILABLE;
}
return mConfigBundle.getBoolean(KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL) return mConfigBundle.getBoolean(KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL)
? AVAILABLE ? AVAILABLE
: CONDITIONALLY_UNAVAILABLE; : CONDITIONALLY_UNAVAILABLE;

View File

@@ -16,6 +16,9 @@
package com.android.settings.network.telephony.satellite; package com.android.settings.network.telephony.satellite;
import static android.telephony.CarrierConfigManager.CARRIER_ROAMING_NTN_CONNECT_AUTOMATIC;
import static android.telephony.CarrierConfigManager.CARRIER_ROAMING_NTN_CONNECT_MANUAL;
import static android.telephony.CarrierConfigManager.KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT;
import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL; import static android.telephony.CarrierConfigManager.KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL;
import static com.android.settings.core.BasePreferenceController.AVAILABLE; import static com.android.settings.core.BasePreferenceController.AVAILABLE;
@@ -81,6 +84,8 @@ public class SatelliteSettingAccountInfoControllerTest {
@Test @Test
public void getAvailabilityStatus_entitlementNotSupport_returnConditionalUnavailable() { public void getAvailabilityStatus_entitlementNotSupport_returnConditionalUnavailable() {
mPersistableBundle.putInt(KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT,
CARRIER_ROAMING_NTN_CONNECT_AUTOMATIC);
when(mContext.getSystemService(SatelliteManager.class)).thenReturn(null); when(mContext.getSystemService(SatelliteManager.class)).thenReturn(null);
mController.init(TEST_SUB_ID, mPersistableBundle, false, false); mController.init(TEST_SUB_ID, mPersistableBundle, false, false);
@@ -91,6 +96,8 @@ public class SatelliteSettingAccountInfoControllerTest {
@Test @Test
public void getAvailabilityStatus_entitlementIsSupported_returnConditionalUnavailable() { public void getAvailabilityStatus_entitlementIsSupported_returnConditionalUnavailable() {
mPersistableBundle.putInt(KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT,
CARRIER_ROAMING_NTN_CONNECT_AUTOMATIC);
mPersistableBundle.putBoolean(KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, true); mPersistableBundle.putBoolean(KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, true);
mController.init(TEST_SUB_ID, mPersistableBundle, false, false); mController.init(TEST_SUB_ID, mPersistableBundle, false, false);
@@ -99,6 +106,17 @@ public class SatelliteSettingAccountInfoControllerTest {
assertThat(result).isEqualTo(AVAILABLE); assertThat(result).isEqualTo(AVAILABLE);
} }
@Test
public void getAvailabilityStatus_connectionTypeISManual_returnAvailable() {
mPersistableBundle.putInt(KEY_CARRIER_ROAMING_NTN_CONNECT_TYPE_INT,
CARRIER_ROAMING_NTN_CONNECT_MANUAL);
mController.init(TEST_SUB_ID, mPersistableBundle, false, false);
int result = mController.getAvailabilityStatus(TEST_SUB_ID);
assertThat(result).isEqualTo(AVAILABLE);
}
@Test @Test
public void displayPreference_showCategoryTitle_correctOperatorName() { public void displayPreference_showCategoryTitle_correctOperatorName() {
mPersistableBundle.putBoolean(KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, true); mPersistableBundle.putBoolean(KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL, true);