Fix ANR in WifiCallingPreferenceController.getAvailabilityStatus

Move the following to background thread to avoid block main thread,
- MobileNetworkUtils.isWifiCallingEnabled(mContext, mSubId, null)
- MobileNetworkUtils.buildPhoneAccountConfigureIntent()
- getSummaryForWfcMode()
- Call State

Since WifiCallingPreferenceController no longer calculate availability
in getAvailabilityStatus(), also update the
CallingPreferenceCategoryController accordingly.

Also introduce ImsMmTelRepository for split business logic for easy
testing.

Fix: 292401934
Test: manual - on Mobile Settings
Test: unit test
Change-Id: If92e2c8f6e137e40b83e578294c03c1b917eef8e
This commit is contained in:
Chaohui Wang
2023-12-29 13:26:09 +08:00
parent 946f52b2a1
commit 355144675a
12 changed files with 597 additions and 495 deletions

View File

@@ -86,7 +86,8 @@ public class VideoCallingPreferenceControllerTest {
mPreference = new SwitchPreference(mContext);
mController = spy(new VideoCallingPreferenceController(mContext, "wifi_calling"));
mController.init(SUB_ID);
mController.init(
SUB_ID, new CallingPreferenceCategoryController(mContext, "calling_category"));
doReturn(mQueryImsState).when(mController).queryImsState(anyInt());
doReturn(mQueryVoLteState).when(mController).queryVoLteState(anyInt());
doReturn(true).when(mController).isImsSupported();