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

Commit fb02560b authored by Hunsuk Choi's avatar Hunsuk Choi
Browse files

Fix the way to detect the Radio Aidl HAL version

Bug: 219242993
Test: build & flash
Change-Id: I50a398affd4b778046a30e355ac51016e18d7e08
Merged-In: I50a398affd4b778046a30e355ac51016e18d7e08
parent e124fc4a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -866,8 +866,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                            binder = mMockModem.getServiceBinder(IMS_SERVICE);
                        }
                        if (binder != null) {
                            mRadioVersion = RADIO_HAL_VERSION_2_1;
                            ((RadioImsProxy) serviceProxy).setAidl(mRadioVersion,
                            mRadioVersion = ((RadioImsProxy) serviceProxy).setAidl(mRadioVersion,
                                    android.hardware.radio.ims.IRadioIms.Stub
                                            .asInterface(binder));
                        }
+23 −2
Original line number Diff line number Diff line
@@ -31,12 +31,33 @@ public class RadioImsProxy extends RadioServiceProxy {
     * Sets IRadioIms as the AIDL implementation for RadioServiceProxy.
     * @param halVersion Radio HAL version.
     * @param ims IRadioIms implementation.
     *
     * @return updated HAL version.
     */
    public void setAidl(HalVersion halVersion, android.hardware.radio.ims.IRadioIms ims) {
    public HalVersion setAidl(HalVersion halVersion, android.hardware.radio.ims.IRadioIms ims) {
        mHalVersion = halVersion;
        mImsProxy = ims;
        mIsAidl = true;
        Rlog.d(TAG, "AIDL initialized");

        try {
            HalVersion newHalVersion;
            int version = ims.getInterfaceVersion();
            switch(version) {
                default:
                    newHalVersion = RIL.RADIO_HAL_VERSION_2_1;
                    break;
            }
            Rlog.d(TAG, "AIDL version=" + version + ", halVersion=" + newHalVersion);

            if (mHalVersion.less(newHalVersion)) {
                mHalVersion = newHalVersion;
            }
        } catch (RemoteException e) {
            Rlog.e(TAG, "setAidl: " + e);
        }

        Rlog.d(TAG, "AIDL initialized mHalVersion=" + mHalVersion);
        return mHalVersion;
    }

    /**