Fallback to AOSP eSOS settings page if OEM impl fails

When OEM eSOS implementation fails for any reason (app disabled,
misconfigured, etc), Emergency SOS settings should fallack to the
default settings page (rather than hiding the setting entirely)

Bug: 180959553
Test: robotests
Change-Id: I31c08449eff3f01d4c33bf827023f17beade93c2
This commit is contained in:
Fan Zhang
2021-03-10 21:45:19 +00:00
parent bf182903ed
commit 9fdceaea78
4 changed files with 123 additions and 4 deletions

View File

@@ -105,7 +105,7 @@ public class EmergencyGestureEntrypointPreferenceControllerTest {
}
@Test
public void getAvailabilityStatus_noSuitableIntent_shouldReturnUnsupported() {
public void getAvailabilityStatus_noSuitableIntent_shouldReturnAvailable() {
SettingsShadowResources.overrideResource(
R.bool.config_show_emergency_gesture_settings,
Boolean.TRUE);
@@ -117,7 +117,8 @@ public class EmergencyGestureEntrypointPreferenceControllerTest {
EmergencyGestureEntrypointPreferenceController controller =
new EmergencyGestureEntrypointPreferenceController(mContext, PREF_KEY);
assertThat(controller.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
assertThat(controller.getAvailabilityStatus()).isEqualTo(AVAILABLE);
assertThat(controller.mIntent).isNull();
}
private void prepareCustomIntent() {