Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af59a35e authored by fionaxu's avatar fionaxu
Browse files

TelephonyManager unit test cleanup

Bug: 25691379
Change-Id: I129c8b4f04ad7e6d777857e8c7853de7a86348cc
parent 9ee5b72d
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import android.telephony.CarrierConfigManager;
import android.telephony.CellLocation;
import android.telephony.ServiceState;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.cdma.CdmaCellLocation;
import android.telephony.gsm.GsmCellLocation;
import android.test.suitebuilder.annotation.SmallTest;
@@ -74,7 +73,6 @@ public class GsmCdmaPhoneTest extends TelephonyTest {

    //mPhoneUnderTest
    private GsmCdmaPhone mPhoneUT;
    private TelephonyManager mTelephonyManager;

    private static final int EVENT_EMERGENCY_CALLBACK_MODE_EXIT = 1;
    private static final int EVENT_EMERGENCY_CALL_TOGGLE = 2;
@@ -116,7 +114,6 @@ public class GsmCdmaPhoneTest extends TelephonyTest {
        super.setUp(getClass().getSimpleName());

        doReturn(false).when(mSST).isDeviceShuttingDown();
        mTelephonyManager = TelephonyManager.from(mContext);

        new GsmCdmaPhoneTestHandler(TAG).start();
        waitUntilReady();
+0 −3
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import static org.mockito.Mockito.eq;
import org.junit.Test;
import org.mockito.Mock;

import android.telephony.TelephonyManager;

import android.test.suitebuilder.annotation.SmallTest;

@@ -52,8 +51,6 @@ public class PhoneSubInfoControllerTest extends TelephonyTest {
           mSecondPhone -> PhoneId:1 -> SubId: 1*/
        doReturn(0).when(mSubscriptionController).getPhoneId(eq(0));
        doReturn(1).when(mSubscriptionController).getPhoneId(eq(1));
        TelephonyManager mTelephonyManager = (TelephonyManager) mContext.getSystemService(
                Context.TELEPHONY_SERVICE);
        doReturn(2).when(mTelephonyManager).getPhoneCount();

        mServiceManagerMockedServices.put("isub", mSubscriptionController);
+0 −5
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.internal.telephony;

import android.content.Context;
import android.content.Intent;
import android.os.AsyncResult;
import android.os.Bundle;
@@ -28,7 +27,6 @@ import android.telephony.CellInfoGsm;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.gsm.GsmCellLocation;
import android.test.suitebuilder.annotation.MediumTest;

@@ -62,7 +60,6 @@ public class ServiceStateTrackerTest extends TelephonyTest {
    private ProxyController mProxyController;

    private ServiceStateTracker sst;
    private TelephonyManager mTelephonyManager;

    private class ServiceStateTrackerTestHandler extends HandlerThread {

@@ -85,8 +82,6 @@ public class ServiceStateTrackerTest extends TelephonyTest {

        doReturn(true).when(mDct).isDisconnected();
        mPhone.mDcTracker = mDct;
        mTelephonyManager = (TelephonyManager) mContextFixture.getTestDouble().
                getSystemService(Context.TELEPHONY_SERVICE);

        replaceInstance(ProxyController.class, "sProxyController", null, mProxyController);

+1 −4
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.internal.telephony;

import android.os.IBinder;
import android.telephony.TelephonyManager;
import android.test.suitebuilder.annotation.SmallTest;

import org.junit.After;
@@ -85,9 +84,7 @@ public class Sms7BitEncodingTranslatorTest extends TelephonyTest {
    @SmallTest
    public void testCdmaTranslate() {

        TelephonyManager telephonyManager = TelephonyManager.from(mContext);

        doReturn(PhoneConstants.PHONE_TYPE_CDMA).when(telephonyManager).getCurrentPhoneType();
        doReturn(PhoneConstants.PHONE_TYPE_CDMA).when(mTelephonyManager).getCurrentPhoneType();

        String s = null;
        try {
+0 −2
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ public class SmsNumberUtilsTest extends TelephonyTest {
    private static final String INDIA_AIRTEL_MCC_MNC = "40553";
    private static final String JAPAN_NTTDOCOMO_MCC_MNC = "44020";

    private TelephonyManager mTelephonyManager;

    // Simulate partial packages/providers/TelephonyProvider/res/xml/hbpcd_lookup_tables.xml
    private class HbpcdContentProvider extends MockContentProvider {
@@ -119,7 +118,6 @@ public class SmsNumberUtilsTest extends TelephonyTest {

        mHbpcdContentProvider = new HbpcdContentProvider();

        mTelephonyManager = TelephonyManager.from(mContextFixture.getTestDouble());
        doReturn(TMO_MCC_MNC).when(mTelephonyManager).getNetworkOperator(anyInt());

        ((MockContentResolver) mContextFixture.getTestDouble().getContentResolver())
Loading