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

Commit 4fe816dd authored by Shuo Qian's avatar Shuo Qian
Browse files

Replace isNetworkSupported with isDataCapable in Telephony

Test: RILTest; Treehugger
Bug: 147017757
Change-Id: Iae462d9df21a69c8c7a3af54b7dfa34d1ae43752
parent b4dab44a
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -52,7 +52,6 @@ import android.hardware.radio.V1_4.CarrierRestrictionsWithPriority;
import android.hardware.radio.V1_4.SimLockMultiSimPolicy;
import android.hardware.radio.V1_4.SimLockMultiSimPolicy;
import android.hardware.radio.V1_5.AccessNetwork;
import android.hardware.radio.V1_5.AccessNetwork;
import android.hardware.radio.deprecated.V1_0.IOemHook;
import android.hardware.radio.deprecated.V1_0.IOemHook;
import android.net.ConnectivityManager;
import android.net.KeepalivePacketData;
import android.net.KeepalivePacketData;
import android.net.LinkAddress;
import android.net.LinkAddress;
import android.net.LinkProperties;
import android.net.LinkProperties;
@@ -609,9 +608,9 @@ public class RIL extends BaseCommands implements CommandsInterface {
            mRadioBugDetector = new RadioBugDetector(context, mPhoneId);
            mRadioBugDetector = new RadioBugDetector(context, mPhoneId);
        }
        }


        ConnectivityManager cm = (ConnectivityManager)context.getSystemService(
        TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(
                Context.CONNECTIVITY_SERVICE);
                Context.TELEPHONY_SERVICE);
        mIsMobileNetworkSupported = cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
        mIsMobileNetworkSupported = telephonyManager.isDataCapable();


        mRadioResponse = new RadioResponse(this);
        mRadioResponse = new RadioResponse(this);
        mRadioIndication = new RadioIndication(this);
        mRadioIndication = new RadioIndication(this);
+5 −0
Original line number Original line Diff line number Diff line
@@ -178,6 +178,8 @@ public class RILTest extends TelephonyTest {
    @Mock
    @Mock
    private ConnectivityManager mConnectionManager;
    private ConnectivityManager mConnectionManager;
    @Mock
    @Mock
    private TelephonyManager mTelephonyManager;
    @Mock
    private IRadio mRadioProxy;
    private IRadio mRadioProxy;
    @Mock
    @Mock
    private IOemHook mOemHookProxy;
    private IOemHook mOemHookProxy;
@@ -271,6 +273,9 @@ public class RILTest extends TelephonyTest {
            .isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
            .isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
        doReturn(mConnectionManager).when(context)
        doReturn(mConnectionManager).when(context)
            .getSystemService(Context.CONNECTIVITY_SERVICE);
            .getSystemService(Context.CONNECTIVITY_SERVICE);
        doReturn(mTelephonyManager).when(context)
                .getSystemService(Context.TELEPHONY_SERVICE);
        doReturn(true).when(mTelephonyManager).isDataCapable();
        PowerManager powerManager = new PowerManager(context, mock(IPowerManager.class),
        PowerManager powerManager = new PowerManager(context, mock(IPowerManager.class),
                new Handler(Looper.myLooper()));
                new Handler(Looper.myLooper()));
        doReturn(powerManager).when(context).getSystemService(Context.POWER_SERVICE);
        doReturn(powerManager).when(context).getSystemService(Context.POWER_SERVICE);