Loading src/java/com/android/internal/telephony/RIL.java +6 −7 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ import android.hardware.radio.V1_4.SimLockMultiSimPolicy; import android.hardware.radio.V1_5.AccessNetwork; import android.hardware.radio.V1_5.RadioAccessNetworks; import android.hardware.radio.deprecated.V1_0.IOemHook; import android.net.ConnectivityManager; import android.net.InetAddresses; import android.net.KeepalivePacketData; import android.net.LinkAddress; Loading Loading @@ -240,7 +239,7 @@ public class RIL extends BaseCommands implements CommandsInterface { /** Radio bug detector instance */ private RadioBugDetector mRadioBugDetector = null; boolean mIsMobileNetworkSupported; boolean mIsCellularSupported; RadioResponse mRadioResponse; RadioIndication mRadioIndication; volatile IRadio mRadioProxy = null; Loading Loading @@ -421,7 +420,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @VisibleForTesting public synchronized IRadio getRadioProxy(Message result) { if (!SubscriptionManager.isValidPhoneId(mPhoneId)) return null; if (!mIsMobileNetworkSupported) { if (!mIsCellularSupported) { if (RILJ_LOGV) riljLog("getRadioProxy: Not calling getService(): wifi-only"); if (result != null) { AsyncResult.forMessage(result, null, Loading Loading @@ -535,7 +534,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @VisibleForTesting public synchronized IOemHook getOemHookProxy(Message result) { if (!SubscriptionManager.isValidPhoneId((mPhoneId))) return null; if (!mIsMobileNetworkSupported) { if (!mIsCellularSupported) { if (RILJ_LOGV) riljLog("getOemHookProxy: Not calling getService(): wifi-only"); if (result != null) { AsyncResult.forMessage(result, null, Loading Loading @@ -609,9 +608,9 @@ public class RIL extends BaseCommands implements CommandsInterface { mRadioBugDetector = new RadioBugDetector(context, mPhoneId); } ConnectivityManager cm = (ConnectivityManager)context.getSystemService( Context.CONNECTIVITY_SERVICE); mIsMobileNetworkSupported = cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE); TelephonyManager tm = (TelephonyManager) context.getSystemService( Context.TELEPHONY_SERVICE); mIsCellularSupported = tm.isVoiceCapable() || tm.isSmsCapable() || tm.isDataCapable(); mRadioResponse = new RadioResponse(this); mRadioIndication = new RadioIndication(this); Loading tests/telephonytests/src/com/android/internal/telephony/RILTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,8 @@ public class RILTest extends TelephonyTest { @Mock private ConnectivityManager mConnectionManager; @Mock private TelephonyManager mTelephonyManager; @Mock private IRadio mRadioProxy; @Mock private IOemHook mOemHookProxy; Loading Loading @@ -272,6 +274,9 @@ public class RILTest extends TelephonyTest { .isNetworkSupported(ConnectivityManager.TYPE_MOBILE); doReturn(mConnectionManager).when(context) .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), new Handler(Looper.myLooper())); doReturn(powerManager).when(context).getSystemService(Context.POWER_SERVICE); Loading Loading
src/java/com/android/internal/telephony/RIL.java +6 −7 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ import android.hardware.radio.V1_4.SimLockMultiSimPolicy; import android.hardware.radio.V1_5.AccessNetwork; import android.hardware.radio.V1_5.RadioAccessNetworks; import android.hardware.radio.deprecated.V1_0.IOemHook; import android.net.ConnectivityManager; import android.net.InetAddresses; import android.net.KeepalivePacketData; import android.net.LinkAddress; Loading Loading @@ -240,7 +239,7 @@ public class RIL extends BaseCommands implements CommandsInterface { /** Radio bug detector instance */ private RadioBugDetector mRadioBugDetector = null; boolean mIsMobileNetworkSupported; boolean mIsCellularSupported; RadioResponse mRadioResponse; RadioIndication mRadioIndication; volatile IRadio mRadioProxy = null; Loading Loading @@ -421,7 +420,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @VisibleForTesting public synchronized IRadio getRadioProxy(Message result) { if (!SubscriptionManager.isValidPhoneId(mPhoneId)) return null; if (!mIsMobileNetworkSupported) { if (!mIsCellularSupported) { if (RILJ_LOGV) riljLog("getRadioProxy: Not calling getService(): wifi-only"); if (result != null) { AsyncResult.forMessage(result, null, Loading Loading @@ -535,7 +534,7 @@ public class RIL extends BaseCommands implements CommandsInterface { @VisibleForTesting public synchronized IOemHook getOemHookProxy(Message result) { if (!SubscriptionManager.isValidPhoneId((mPhoneId))) return null; if (!mIsMobileNetworkSupported) { if (!mIsCellularSupported) { if (RILJ_LOGV) riljLog("getOemHookProxy: Not calling getService(): wifi-only"); if (result != null) { AsyncResult.forMessage(result, null, Loading Loading @@ -609,9 +608,9 @@ public class RIL extends BaseCommands implements CommandsInterface { mRadioBugDetector = new RadioBugDetector(context, mPhoneId); } ConnectivityManager cm = (ConnectivityManager)context.getSystemService( Context.CONNECTIVITY_SERVICE); mIsMobileNetworkSupported = cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE); TelephonyManager tm = (TelephonyManager) context.getSystemService( Context.TELEPHONY_SERVICE); mIsCellularSupported = tm.isVoiceCapable() || tm.isSmsCapable() || tm.isDataCapable(); mRadioResponse = new RadioResponse(this); mRadioIndication = new RadioIndication(this); Loading
tests/telephonytests/src/com/android/internal/telephony/RILTest.java +5 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,8 @@ public class RILTest extends TelephonyTest { @Mock private ConnectivityManager mConnectionManager; @Mock private TelephonyManager mTelephonyManager; @Mock private IRadio mRadioProxy; @Mock private IOemHook mOemHookProxy; Loading Loading @@ -272,6 +274,9 @@ public class RILTest extends TelephonyTest { .isNetworkSupported(ConnectivityManager.TYPE_MOBILE); doReturn(mConnectionManager).when(context) .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), new Handler(Looper.myLooper())); doReturn(powerManager).when(context).getSystemService(Context.POWER_SERVICE); Loading