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

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

Merge "Bugfix - getRadioServiceProxy cast exception" am: 28f14d91 am: a0fb0f8d am: 51505efd

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

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

    /**
@@ -727,7 +728,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
    @VisibleForTesting
    @NonNull
    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 (RILJ_LOGV) riljLog("getRadioServiceProxy: Not calling getService(): wifi-only");
            if (result != null) {
@@ -735,7 +736,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                        CommandException.fromRilErrno(RADIO_NOT_AVAILABLE));
                result.sendToTarget();
            }
            return new RadioServiceProxy();
            return mServiceProxies.get(service);
        }

        RadioServiceProxy serviceProxy = mServiceProxies.get(service);
+2 −1
Original line number 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
 * getAidl to get the AIDL service and call the AIDL implementations of the HAL APIs.
 */
public class RadioServiceProxy {
public abstract class RadioServiceProxy {
    boolean mIsAidl;
    HalVersion mHalVersion = RIL.RADIO_HAL_VERSION_UNKNOWN;
    volatile android.hardware.radio.V1_0.IRadio mRadioProxy = null;
@@ -69,6 +69,7 @@ public class RadioServiceProxy {
    public boolean isEmpty() {
        return mRadioProxy == null;
    }

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