[Settings] Use background thread to get VoNr state.

- TelephonyManager#isVoNrEnabled may not send back the result in time,
   so use different thread and timer to prevent ANR.

Bug: 282876876
Test: atest passed
Change-Id: Ie6cc0f8a459f5ebed930e457dacb9b742df70fad
This commit is contained in:
tom hsu
2023-05-24 16:06:47 +08:00
parent 59ec10b05a
commit 97a1fc643e
2 changed files with 24 additions and 2 deletions

View File

@@ -186,6 +186,7 @@ public class NrAdvancedCallingPreferenceControllerTest {
doReturn(true).when(mTelephonyManager).isVoNrEnabled();
mPreference.setChecked(false);
mController.init(SUB_ID);
mController.updateState(mPreference);
assertThat(mPreference.isChecked()).isTrue();