redirect RIL_UNSOL_OEM_HOOK_RAW to system app
[android/platform/frameworks/opt/telephony.git] / src / java / com / android / internal / telephony / PhoneBase.java
index 564c45d..3c7c9af 100644 (file)
@@ -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");
         }