Return UNSUPPORTED_ON_DEVICE in deviceinfo/simstatus when no telephony

If the device does not have any telephony support (either via the
build-time config_show_sim_info=false boolean flag, or when not
declaring the PackageManager.FEATURE_TELEPHONY_DATA feature flag),
returning UNSUPPORTED_ON_DEVICE makes more sense than
CONDITIONALLY_UNAVAILABLE, as there is no runtime change that would
make it available.

Bug: 395714454
Flag: EXEMPT bugfix
Test: atest SimStatusPreferenceControllerTest
Change-Id: I0735c949a590190cdc177cbca835444691c50faa
This commit is contained in:
Aleksander Morgado
2025-02-12 16:46:53 +00:00
parent 4cc14d6553
commit d58d0be2e1
2 changed files with 9 additions and 8 deletions

View File

@@ -231,7 +231,7 @@ public class SimStatusPreferenceControllerTest {
when(mResources.getBoolean(R.bool.config_show_sim_info)).thenReturn(false);
assertThat(mController.getAvailabilityStatus()).isEqualTo(
BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
BasePreferenceController.UNSUPPORTED_ON_DEVICE);
}
@Test
@@ -241,7 +241,7 @@ public class SimStatusPreferenceControllerTest {
when(mTelephonyManager.isDataCapable()).thenReturn(false);
assertThat(mController.getAvailabilityStatus()).isEqualTo(
BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
BasePreferenceController.UNSUPPORTED_ON_DEVICE);
}
@Test