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

Commit 072c4310 authored by Jack Yu's avatar Jack Yu
Browse files

Fixed telephony not binding radio service issue

If one of the voice, sms, or data is enabled, then
telephony should bind radio service. This is the
regression introduced by ag/10002556.

Bug: 147519438
Test: Manual boot up the device and confirmed device
      camped on network

Change-Id: I955a89f57d06901a4ebec06038e7f2b63a13106a
parent 827940b1
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -238,7 +238,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;
@@ -419,7 +419,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,
@@ -533,7 +533,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,
@@ -607,9 +607,9 @@ public class RIL extends BaseCommands implements CommandsInterface {
            mRadioBugDetector = new RadioBugDetector(context, mPhoneId);
        }

        TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(
        TelephonyManager tm = (TelephonyManager) context.getSystemService(
                Context.TELEPHONY_SERVICE);
        mIsMobileNetworkSupported = telephonyManager.isDataCapable();
        mIsCellularSupported = tm.isVoiceCapable() || tm.isSmsCapable() || tm.isDataCapable();

        mRadioResponse = new RadioResponse(this);
        mRadioIndication = new RadioIndication(this);