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

Commit a0fb0f8d authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Bugfix - getRadioServiceProxy cast exception" am: 28f14d91

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1988813

Change-Id: I307ee2254cbf1f0c911028a929b372e859a4abc1
parents 8e9812dd 28f14d91
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -716,7 +716,8 @@ public class RIL extends BaseCommands implements CommandsInterface {
        if (serviceClass == RadioVoiceProxy.class) {
        if (serviceClass == RadioVoiceProxy.class) {
            return (T) getRadioServiceProxy(VOICE_SERVICE, result);
            return (T) getRadioServiceProxy(VOICE_SERVICE, result);
        }
        }
        return (T) new RadioServiceProxy();
        riljLoge("getRadioServiceProxy: unrecognized " + serviceClass);
        return null;
    }
    }


    /**
    /**
@@ -726,7 +727,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
    @VisibleForTesting
    @VisibleForTesting
    @NonNull
    @NonNull
    public synchronized RadioServiceProxy getRadioServiceProxy(int service, Message result) {
    public synchronized RadioServiceProxy getRadioServiceProxy(int service, Message result) {
        if (!SubscriptionManager.isValidPhoneId(mPhoneId)) return new RadioServiceProxy();
        if (!SubscriptionManager.isValidPhoneId(mPhoneId)) return mServiceProxies.get(service);
        if (!mIsCellularSupported) {
        if (!mIsCellularSupported) {
            if (RILJ_LOGV) riljLog("getRadioServiceProxy: Not calling getService(): wifi-only");
            if (RILJ_LOGV) riljLog("getRadioServiceProxy: Not calling getService(): wifi-only");
            if (result != null) {
            if (result != null) {
@@ -734,7 +735,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                        CommandException.fromRilErrno(RADIO_NOT_AVAILABLE));
                        CommandException.fromRilErrno(RADIO_NOT_AVAILABLE));
                result.sendToTarget();
                result.sendToTarget();
            }
            }
            return new RadioServiceProxy();
            return mServiceProxies.get(service);
        }
        }


        RadioServiceProxy serviceProxy = mServiceProxies.get(service);
        RadioServiceProxy serviceProxy = mServiceProxies.get(service);
+2 −1
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@ import android.os.RemoteException;
 * A holder for IRadio services. Use getHidl to get IRadio 1.0 and call the HIDL implementations or
 * A holder for IRadio services. Use getHidl to get IRadio 1.0 and call the HIDL implementations or
 * getAidl to get the AIDL service and call the AIDL implementations of the HAL APIs.
 * getAidl to get the AIDL service and call the AIDL implementations of the HAL APIs.
 */
 */
public class RadioServiceProxy {
public abstract class RadioServiceProxy {
    boolean mIsAidl;
    boolean mIsAidl;
    HalVersion mHalVersion = RIL.RADIO_HAL_VERSION_UNKNOWN;
    HalVersion mHalVersion = RIL.RADIO_HAL_VERSION_UNKNOWN;
    volatile android.hardware.radio.V1_0.IRadio mRadioProxy = null;
    volatile android.hardware.radio.V1_0.IRadio mRadioProxy = null;
@@ -69,6 +69,7 @@ public class RadioServiceProxy {
    public boolean isEmpty() {
    public boolean isEmpty() {
        return mRadioProxy == null;
        return mRadioProxy == null;
    }
    }

    /**
    /**
     * Call responseAcknowledgement for the service
     * Call responseAcknowledgement for the service
     * @throws RemoteException
     * @throws RemoteException