[Settings] Use TelephonyManasger.registerTelephonyCallback instead of TelephonyManager.listen

Bug: 175270951
Test: make and atest
Change-Id: I15e1a199e6a34914db97055bfea9392c5bbdc9c6
This commit is contained in:
Zoey Chen
2021-03-10 16:01:18 +08:00
parent 0872d40a75
commit b8a639f8fd
12 changed files with 202 additions and 175 deletions

View File

@@ -48,7 +48,6 @@ import android.content.Context;
import android.os.PersistableBundle;
import android.telephony.CarrierConfigManager;
import android.telephony.CellSignalStrength;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionInfo;
@@ -89,8 +88,6 @@ public class SimStatusDialogControllerTest {
@Mock
private ServiceState mServiceState;
@Mock
private PhoneStateListener mPhoneStateListener;
@Mock
private SignalStrength mSignalStrength;
@Mock
private CellSignalStrength mCellSignalStrengthCdma;
@@ -150,7 +147,6 @@ public class SimStatusDialogControllerTest {
doReturn(0).when(mCellSignalStrengthWcdma).getAsuLevel();
doReturn(null).when(mSignalStrength).getCellSignalStrengths();
doReturn(mPhoneStateListener).when(mController).getPhoneStateListener();
doReturn(mSubscriptionInfo).when(mSubscriptionManager).getActiveSubscriptionInfo(anyInt());
when(mTelephonyManager.getActiveModemCount()).thenReturn(MAX_PHONE_COUNT_SINGLE_SIM);