Fallback to AOSP emergency info if the original intent is broken

If the variant of emergency info is broken, we should try to show
AOSP emergency info instead.

Test: Rebuilt rom and see the Ui. Run robo test
Fix: 154114259
Change-Id: I5bc3f6cbf9102a7b7299c3edf718a58101effbf8
This commit is contained in:
Tsung-Mao Fang
2020-04-16 17:17:38 +08:00
parent 79a38a733f
commit b3bb7a0237
3 changed files with 50 additions and 16 deletions

View File

@@ -156,10 +156,11 @@ public class EmergencyInfoPreferenceControllerTest {
final Preference preference = new Preference(activity);
preference.setKey("emergency_info");
mController = new EmergencyInfoPreferenceController(activity, preference.getKey());
mController.mIntent = new Intent("com.example.action.new").setPackage("com.example.test");
mController.handlePreferenceTreeClick(preference);
assertThat(application.getNextStartedActivity().getAction())
.isEqualTo("android.settings.EDIT_EMERGENCY_INFO");
.isEqualTo("com.example.action.new");
}
}