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

Commit c13bf07d authored by Etan Cohen's avatar Etan Cohen Committed by Android (Google) Code Review
Browse files

Merge "redirect RIL_UNSOL_OEM_HOOK_RAW to system app" into lmp-sprout-dev

parents ba2cc792 110eda52
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
@@ -152,7 +152,8 @@ public abstract class PhoneBase extends Handler implements Phone {
    protected static final int EVENT_SRVCC_STATE_CHANGED            = 31;
    protected static final int EVENT_INITIATE_SILENT_REDIAL         = 32;
    protected static final int EVENT_RADIO_NOT_AVAILABLE            = 33;
    protected static final int EVENT_LAST                           = EVENT_RADIO_NOT_AVAILABLE;
    protected static final int EVENT_UNSOL_OEM_HOOK_RAW             = 34;
    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";
@@ -403,6 +404,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
@@ -418,6 +420,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();
@@ -520,6 +523,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);
}