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

Commit 740c7679 authored by terrycrhuang's avatar terrycrhuang Committed by jimsun
Browse files

Fix phone crash for AIDL service die cases

The message object types are different for AIDL and HIDL service die
cases. Seperate them with differnt message to handle each message
object.

Bug: 208398531
Test: no phone crash at below cases
1. Trigger HIDL service die by killing vendor ril daemon
2. Trigger AIDL service die by switch mock modem service

Change-Id: I2ee6cd5814fc572f9aa914cf496fae99d411e301
Merged-In: I2ee6cd5814fc572f9aa914cf496fae99d411e301
parent 2b82c304
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -259,6 +259,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
    static final int EVENT_ACK_WAKE_LOCK_TIMEOUT = 4;
    static final int EVENT_BLOCKING_RESPONSE_TIMEOUT = 5;
    static final int EVENT_RADIO_PROXY_DEAD = 6;
    static final int EVENT_AIDL_PROXY_DEAD = 7;

    //***** Constants

@@ -354,6 +355,17 @@ public class RIL extends BaseCommands implements CommandsInterface {
                        resetProxyAndRequestList(service);
                    }
                    break;

                case EVENT_AIDL_PROXY_DEAD:
                    int aidlService = msg.arg1;
                    AtomicLong obj = (AtomicLong) msg.obj;
                    riljLog("handleMessage: EVENT_AIDL_PROXY_DEAD cookie = " + msg.obj
                            + ", service = " + serviceToString(aidlService) + ", cookie = "
                            + mServiceCookies.get(aidlService));
                    if (obj.get() == mServiceCookies.get(aidlService).get()) {
                        resetProxyAndRequestList(aidlService);
                    }
                    break;
            }
        }
    }
@@ -426,7 +438,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
        @Override
        public void binderDied() {
            riljLog("Service " + serviceToString(mService) + " has died.");
            mRilHandler.sendMessage(mRilHandler.obtainMessage(EVENT_RADIO_PROXY_DEAD, mService,
            mRilHandler.sendMessage(mRilHandler.obtainMessage(EVENT_AIDL_PROXY_DEAD, mService,
                    0 /* ignored arg2 */, mServiceCookies.get(mService)));
            unlinkToDeath();
        }