From 21dd407c10bb1bade10233e8468ea6729bcf71ef Mon Sep 17 00:00:00 2001 From: jsh Date: Tue, 12 May 2009 11:26:55 -0700 Subject: Use Phone.[get|set]SmscAddress() instead of OEMHookRaw. --- src/com/android/settings/RadioInfo.java | 41 +++------------------------------ 1 file changed, 3 insertions(+), 38 deletions(-) (limited to 'src/com') diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java index 79327f2..257122b 100644 --- a/src/com/android/settings/RadioInfo.java +++ b/src/com/android/settings/RadioInfo.java @@ -239,8 +239,7 @@ public class RadioInfo extends Activity { if (ar.exception != null) { smsc.setText("refresh error"); } else { - byte[] buf = (byte[]) ar.result; - smsc.setText(new String(buf)); + smsc.setText((String)ar.result); } break; case EVENT_UPDATE_SMSC_DONE: @@ -272,9 +271,6 @@ public class RadioInfo extends Activity { final int OEM_QXDM_SDLOG_LEN = 4; final int OEM_PS_AUTO_ATTACH_FUNCTAG = 0x00020000; final int OEM_CIPHERING_FUNCTAG = 0x00020001; - final int OEM_SMSC_UPDATE_FUNCTAG = 0x00020002; - final int OEM_SMSC_QUERY_FUNCTAG = 0x00020003; - final int OEM_SMSC_QUERY_LEN = 0; /** * The OEM interface to store QXDM to SD. @@ -339,32 +335,6 @@ public class RadioInfo extends Activity { return bos.toByteArray(); } - byte[] getSmscQueryData() { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - DataOutputStream dos = new DataOutputStream(bos); - try { - writeIntLittleEndian(dos, OEM_SMSC_QUERY_FUNCTAG); - writeIntLittleEndian(dos, OEM_SMSC_QUERY_LEN * SIZE_OF_INT); - } catch (IOException e) { - return null; - } - return bos.toByteArray(); - } - - byte[] getSmscUpdateData(String smsc) { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - DataOutputStream dos = new DataOutputStream(bos); - try { - byte[] smsc_bytes = smsc.getBytes(); - writeIntLittleEndian(dos, OEM_SMSC_UPDATE_FUNCTAG); - writeIntLittleEndian(dos, smsc_bytes.length); - dos.write(smsc_bytes); - } catch (IOException e) { - return null; - } - return bos.toByteArray(); - } - byte[] getPsAutoAttachData(boolean enable) { return getSimpleFeatureData(OEM_PS_AUTO_ATTACH_FUNCTAG, enable); } @@ -894,10 +864,7 @@ public class RadioInfo extends Activity { } private void refreshSmsc() { - byte[] data = mOem.getSmscQueryData(); - if (data == null) return; - phone.invokeOemRilRequestRaw(data, - mHandler.obtainMessage(EVENT_QUERY_SMSC_DONE)); + phone.getSmscAddress(mHandler.obtainMessage(EVENT_QUERY_SMSC_DONE)); } private final void updatePingState() { @@ -1141,9 +1108,7 @@ public class RadioInfo extends Activity { OnClickListener mUpdateSmscButtonHandler = new OnClickListener() { public void onClick(View v) { updateSmscButton.setEnabled(false); - byte[] data = mOem.getSmscUpdateData(smsc.getText().toString()); - if (data == null) return; - phone.invokeOemRilRequestRaw(data, + phone.setSmscAddress(smsc.getText().toString(), mHandler.obtainMessage(EVENT_UPDATE_SMSC_DONE)); } }; -- cgit v1.1