Use Phone.[get|set]SmscAddress() instead of OEMHookRaw.
This commit is contained in:
@@ -239,8 +239,7 @@ public class RadioInfo extends Activity {
|
|||||||
if (ar.exception != null) {
|
if (ar.exception != null) {
|
||||||
smsc.setText("refresh error");
|
smsc.setText("refresh error");
|
||||||
} else {
|
} else {
|
||||||
byte[] buf = (byte[]) ar.result;
|
smsc.setText((String)ar.result);
|
||||||
smsc.setText(new String(buf));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EVENT_UPDATE_SMSC_DONE:
|
case EVENT_UPDATE_SMSC_DONE:
|
||||||
@@ -272,9 +271,6 @@ public class RadioInfo extends Activity {
|
|||||||
final int OEM_QXDM_SDLOG_LEN = 4;
|
final int OEM_QXDM_SDLOG_LEN = 4;
|
||||||
final int OEM_PS_AUTO_ATTACH_FUNCTAG = 0x00020000;
|
final int OEM_PS_AUTO_ATTACH_FUNCTAG = 0x00020000;
|
||||||
final int OEM_CIPHERING_FUNCTAG = 0x00020001;
|
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.
|
* The OEM interface to store QXDM to SD.
|
||||||
@@ -339,32 +335,6 @@ public class RadioInfo extends Activity {
|
|||||||
return bos.toByteArray();
|
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) {
|
byte[] getPsAutoAttachData(boolean enable) {
|
||||||
return getSimpleFeatureData(OEM_PS_AUTO_ATTACH_FUNCTAG, enable);
|
return getSimpleFeatureData(OEM_PS_AUTO_ATTACH_FUNCTAG, enable);
|
||||||
}
|
}
|
||||||
@@ -894,10 +864,7 @@ public class RadioInfo extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void refreshSmsc() {
|
private void refreshSmsc() {
|
||||||
byte[] data = mOem.getSmscQueryData();
|
phone.getSmscAddress(mHandler.obtainMessage(EVENT_QUERY_SMSC_DONE));
|
||||||
if (data == null) return;
|
|
||||||
phone.invokeOemRilRequestRaw(data,
|
|
||||||
mHandler.obtainMessage(EVENT_QUERY_SMSC_DONE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void updatePingState() {
|
private final void updatePingState() {
|
||||||
@@ -1141,9 +1108,7 @@ public class RadioInfo extends Activity {
|
|||||||
OnClickListener mUpdateSmscButtonHandler = new OnClickListener() {
|
OnClickListener mUpdateSmscButtonHandler = new OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
updateSmscButton.setEnabled(false);
|
updateSmscButton.setEnabled(false);
|
||||||
byte[] data = mOem.getSmscUpdateData(smsc.getText().toString());
|
phone.setSmscAddress(smsc.getText().toString(),
|
||||||
if (data == null) return;
|
|
||||||
phone.invokeOemRilRequestRaw(data,
|
|
||||||
mHandler.obtainMessage(EVENT_UPDATE_SMSC_DONE));
|
mHandler.obtainMessage(EVENT_UPDATE_SMSC_DONE));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user