am 83b395c: Merge change 743 into donut

Merge commit '83b395ceace724e55490aa6f2c0117c8b31e3723'

* commit '83b395ceace724e55490aa6f2c0117c8b31e3723':
  Add RIL_UNSOL_OEM_HOOK_RAW.
This commit is contained in:
Android (Google) Code Review
2009-04-30 23:51:14 -07:00
committed by The Android Open Source Project
3 changed files with 38 additions and 23 deletions

View File

@@ -54,6 +54,7 @@ public abstract class BaseCommands implements CommandsInterface {
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 abstract class BaseCommands implements CommandsInterface {
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

View File

@@ -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.Message;
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 @@ public final class RIL extends BaseCommands implements CommandsInterface {
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 @@ public final class RIL extends BaseCommands implements CommandsInterface {
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 @@ public final class RIL extends BaseCommands implements CommandsInterface {
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 @@ public final class RIL extends BaseCommands implements CommandsInterface {
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 @@ public final class RIL extends BaseCommands implements CommandsInterface {
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 @@ public final class RIL extends BaseCommands implements CommandsInterface {
} catch ( Exception e) {
}
}
return response;
}
@@ -2917,7 +2917,8 @@ public final class RIL extends BaseCommands implements CommandsInterface {
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 @@ public final class RIL extends BaseCommands implements CommandsInterface {
riljLogv("[UNSL]< " + responseToString(response) + " " + retToString(response, ret));
}
// ***** Methods for CDMA support
public void
getDeviceIdentity(Message response) {

View File

@@ -233,4 +233,9 @@ cat include/telephony/ril.h | \
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;
}