Add RIL_UNSOL_OEM_HOOK_RAW.
Add RIL_UNSOL_OEM_HOOK_RAW for OEMs to send Unsolicitied
commands from the baseband.
diff --git a/telephony/java/com/android/internal/telephony/BaseCommands.java b/telephony/java/com/android/internal/telephony/BaseCommands.java
index 11e7461..fbc596c 100644
--- a/telephony/java/com/android/internal/telephony/BaseCommands.java
+++ b/telephony/java/com/android/internal/telephony/BaseCommands.java
@@ -54,6 +54,7 @@
protected RegistrantList mIccStatusChangedRegistrants = new RegistrantList();
protected RegistrantList mVoicePrivacyOnRegistrants = new RegistrantList();
protected RegistrantList mVoicePrivacyOffRegistrants = new RegistrantList();
+ protected Registrant mUnsolOemHookRawRegistrant;
protected Registrant mSMSRegistrant;
protected Registrant mNITZTimeRegistrant;
protected Registrant mSignalStrengthRegistrant;
@@ -456,11 +457,19 @@
public void setOnRestrictedStateChanged(Handler h, int what, Object obj) {
mRestrictedStateRegistrant = new Registrant (h, what, obj);
}
-
+
public void unSetOnRestrictedStateChanged(Handler h) {
mRestrictedStateRegistrant.clear();
}
+ public void setOnUnsolOemHookRaw(Handler h, int what, Object obj) {
+ mUnsolOemHookRawRegistrant = new Registrant (h, what, obj);
+ }
+
+ public void unSetOnUnsolOemHookRaw(Handler h) {
+ mUnsolOemHookRawRegistrant.clear();
+ }
+
//***** Protected Methods
/**
* Store new RadioState and send notification based on the changes
diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java
index cebbe5c..3123111 100644
--- a/telephony/java/com/android/internal/telephony/RIL.java
+++ b/telephony/java/com/android/internal/telephony/RIL.java
@@ -16,6 +16,7 @@
package com.android.internal.telephony;
+import static com.android.internal.telephony.RILConstants.*;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -30,30 +31,21 @@
import android.os.Parcel;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
-import android.telephony.PhoneNumberUtils;
import android.telephony.NeighboringCellInfo;
+import android.telephony.PhoneNumberUtils;
import android.telephony.SmsManager;
import android.telephony.SmsMessage;
-import android.util.Log;
import android.util.Config;
+import android.util.Log;
-import static com.android.internal.telephony.RILConstants.*;
-
-import com.android.internal.telephony.CallForwardInfo;
-import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.gsm.NetworkInfo;
import com.android.internal.telephony.gsm.PDPContextState;
import com.android.internal.telephony.gsm.SuppServiceNotification;
-import com.android.internal.telephony.IccCardApplication;
-import com.android.internal.telephony.IccCardStatus;
-import com.android.internal.telephony.IccUtils;
-import com.android.internal.telephony.RILConstants;
-import com.android.internal.telephony.SmsResponse;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
-import java.io.InputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
@@ -522,7 +514,7 @@
Log.i(LOG_TAG, "'" + SOCKET_NAME_RIL + "' socket closed",
ex);
} catch (Throwable tr) {
- Log.e(LOG_TAG, "Uncaught exception read length=" + length +
+ Log.e(LOG_TAG, "Uncaught exception read length=" + length +
"Exception:" + tr.toString());
}
@@ -593,10 +585,10 @@
mSenderThread = new HandlerThread("RILSender");
mSenderThread.start();
-
+
Looper looper = mSenderThread.getLooper();
mSender = new RILSender(looper);
-
+
mReceiver = new RILReceiver();
mReceiverThread = new Thread(mReceiver, "RILReceiver");
mReceiverThread.start();
@@ -2162,11 +2154,12 @@
case RIL_UNSOL_RESPONSE_CDMA_NEW_SMS: ret = responseCdmaSms(p); break;
case RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS: ret = responseString(p); break;
case RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL: ret = responseVoid(p); break;
+ case RIL_UNSOL_OEM_HOOK_RAW: ret = responseRaw(p); break;
default:
throw new RuntimeException("Unrecognized unsol response: " + response);
//break; (implied)
}} catch (Throwable tr) {
- Log.e(LOG_TAG, "Exception processing unsol response: " + response +
+ Log.e(LOG_TAG, "Exception processing unsol response: " + response +
"Exception:" + tr.toString());
return;
}
@@ -2346,19 +2339,19 @@
case RIL_UNSOL_CALL_RING:
if (RILJ_LOGD) unsljLog(response);
-
+
if (mRingRegistrant != null) {
mRingRegistrant.notifyRegistrant();
}
break;
-
+
case RIL_UNSOL_RESTRICTED_STATE_CHANGED:
if (RILJ_LOGD) unsljLogvRet(response, ret);
if (mRestrictedStateRegistrant != null) {
mRestrictedStateRegistrant.notifyRegistrant(
new AsyncResult (null, ret, null));
}
-
+
case RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED:
if (mIccStatusChangedRegistrants != null) {
mIccStatusChangedRegistrants.notifyRegistrants();
@@ -2387,6 +2380,13 @@
mIccSmsFullRegistrant.notifyRegistrant();
}
break;
+
+ case RIL_UNSOL_OEM_HOOK_RAW:
+ if (RILJ_LOGD) unsljLogvRet(response, IccUtils.bytesToHexString((byte[])ret));
+ if (mUnsolOemHookRawRegistrant != null) {
+ mUnsolOemHookRawRegistrant.notifyRegistrant(new AsyncResult(null, ret, null));
+ }
+ break;
}
}
@@ -2731,7 +2731,7 @@
} catch ( Exception e) {
}
}
-
+
return response;
}
@@ -2917,7 +2917,8 @@
case RIL_UNSOL_SIM_SMS_STORAGE_FULL: return "UNSOL_SIM_SMS_STORAGE_FULL";
case RIL_UNSOL_SIM_REFRESH: return "UNSOL_SIM_REFRESH";
case RIL_UNSOL_CALL_RING: return "UNSOL_CALL_RING";
- case RIL_UNSOL_RESTRICTED_STATE_CHANGED: return "RIL_UNSOL_RESTRICTED_STATE_CHANGED";
+ case RIL_UNSOL_RESTRICTED_STATE_CHANGED: return "RIL_UNSOL_RESTRICTED_STATE_CHANGED";
+ case RIL_UNSOL_OEM_HOOK_RAW: return "RIL_UNSOL_OEM_HOOK_RAW";
default: return "<unknown reponse>";
}
}
@@ -2946,7 +2947,7 @@
riljLogv("[UNSL]< " + responseToString(response) + " " + retToString(response, ret));
}
-
+
// ***** Methods for CDMA support
public void
getDeviceIdentity(Message response) {
diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java
index 9c63627..cbbdec6 100644
--- a/telephony/java/com/android/internal/telephony/RILConstants.java
+++ b/telephony/java/com/android/internal/telephony/RILConstants.java
@@ -233,4 +233,9 @@
int RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS = 1021;
int RIL_UNSOL_CDMA_RUIM_SMS_STORAGE_FULL = 1022;
int RIL_UNSOL_RESTRICTED_STATE_CHANGED = 1023;
+ int RIL_UNSOL_ENTER_EMERGENCY_CALLBACK_MODE = 1024;
+ int RIL_UNSOL_CDMA_CALL_WAITING = 1025;
+ int RIL_UNSOL_CDMA_OTA_PROVISION_STATUS = 1026;
+ int RIL_UNSOL_CDMA_INFO_REC = 1027;
+ int RIL_UNSOL_OEM_HOOK_RAW = 1028;
}