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

Commit ca117227 authored by New Author Steven Liu's avatar New Author Steven Liu Committed by Vineeta Srivastava
Browse files

redirect RIL_UNSOL_OEM_HOOK_RAW to system app

add notifyOemHookRawEvent

Bug: 17298769
Change-Id: Iaea054d3cc2925eea1e11f8871faabc7bc9dfb2d
parent e818d6a4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1388,6 +1388,11 @@ public interface CommandsInterface {

    void invokeOemRilRequestStrings(String[] strings, Message response);

    /**
     * Fires when RIL_UNSOL_OEM_HOOK_RAW is received from the RIL.
     */
    void setOnUnsolOemHookRaw(Handler h, int what, Object obj);
    void unSetOnUnsolOemHookRaw(Handler h);

    /**
     * Send TERMINAL RESPONSE to the SIM, after processing a proactive command
+9 −0
Original line number Diff line number Diff line
@@ -299,6 +299,15 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
        }
    }

    @Override
    public void notifyOemHookRawEventForSubscriber(long subId, byte[] rawData) {
        try {
            mRegistry.notifyOemHookRawEventForSubscriber(subId, rawData);
        } catch (RemoteException ex) {
            // system process is dead
        }
    }

    /**
     * Convert the {@link PhoneConstants.State} enum into the TelephonyManager.CALL_STATE_*
     * constants for the public API.
+16 −1
Original line number Diff line number Diff line
@@ -151,7 +151,8 @@ public abstract class PhoneBase extends Handler implements Phone {
    // Single Radio Voice Call Continuity
    protected static final int EVENT_SRVCC_STATE_CHANGED            = 31;
    protected static final int EVENT_INITIATE_SILENT_REDIAL         = 32;
    protected static final int EVENT_LAST                           = EVENT_INITIATE_SILENT_REDIAL;
    protected static final int EVENT_UNSOL_OEM_HOOK_RAW             = 33;
    protected static final int EVENT_LAST                           = EVENT_UNSOL_OEM_HOOK_RAW;

    // Key used to read/write current CLIR setting
    public static final String CLIR_KEY = "clir_key";
@@ -401,6 +402,7 @@ public abstract class PhoneBase extends Handler implements Phone {
        mContext.registerReceiver(mImsIntentReceiver, filter);

        mCi.registerForSrvccStateChanged(this, EVENT_SRVCC_STATE_CHANGED, null);
        mCi.setOnUnsolOemHookRaw(this, EVENT_UNSOL_OEM_HOOK_RAW, null);
    }

    @Override
@@ -416,6 +418,7 @@ public abstract class PhoneBase extends Handler implements Phone {
            mSmsUsageMonitor.dispose();
            mUiccController.unregisterForIccChanged(this);
            mCi.unregisterForSrvccStateChanged(this);
            mCi.unSetOnUnsolOemHookRaw(this);

            if (mTelephonyTester != null) {
                mTelephonyTester.dispose();
@@ -518,6 +521,18 @@ public abstract class PhoneBase extends Handler implements Phone {
                }
                break;

            case EVENT_UNSOL_OEM_HOOK_RAW:
                ar = (AsyncResult)msg.obj;
                if (ar.exception == null) {
                    byte[] data = (byte[])ar.result;
                    Rlog.d(LOG_TAG, "EVENT_UNSOL_OEM_HOOK_RAW data="
                            + IccUtils.bytesToHexString(data));
                    mNotifier.notifyOemHookRawEventForSubscriber(getSubId(), data);
                } else {
                    Rlog.e(LOG_TAG, "OEM hook raw exception: " + ar.exception);
                }
                break;

            default:
                throw new RuntimeException("unexpected event not handled");
        }
+2 −0
Original line number Diff line number Diff line
@@ -61,4 +61,6 @@ public interface PhoneNotifier {
    public void notifyDataConnectionRealTimeInfo(Phone sender, DataConnectionRealTimeInfo dcRtInfo);

    public void notifyVoLteServiceStateChanged(Phone sender, VoLteServiceState lteState);

    public void notifyOemHookRawEventForSubscriber(long subId, byte[] rawData);
}