public class IccSmsInterfaceManager extends Object
Modifier and Type | Field and Description |
---|---|
protected static int |
EVENT_SET_BROADCAST_ACTIVATION_DONE |
protected static int |
EVENT_SET_BROADCAST_CONFIG_DONE |
protected AppOpsManager |
mAppOps |
protected Context |
mContext |
protected SMSDispatcher |
mDispatcher |
protected Handler |
mHandler |
protected Object |
mLock |
protected Phone |
mPhone |
protected boolean |
mSuccess |
Modifier | Constructor and Description |
---|---|
protected |
IccSmsInterfaceManager(Phone phone) |
Modifier and Type | Method and Description |
---|---|
protected ArrayList<SmsRawData> |
buildValidRawData(ArrayList<byte[]> messages)
create SmsRawData lists from all sms record byte[]
Use null to indicate "free" record
|
boolean |
copyMessageToIccEf(String callingPackage,
int status,
byte[] pdu,
byte[] smsc)
Copy a raw SMS PDU to the Icc.
|
boolean |
disableCdmaBroadcastRange(int startMessageId,
int endMessageId) |
boolean |
disableCellBroadcast(int messageIdentifier,
int ranType) |
boolean |
disableCellBroadcastRange(int startMessageId,
int endMessageId,
int ranType) |
boolean |
disableGsmBroadcastRange(int startMessageId,
int endMessageId) |
boolean |
enableCdmaBroadcastRange(int startMessageId,
int endMessageId) |
boolean |
enableCellBroadcast(int messageIdentifier,
int ranType) |
boolean |
enableCellBroadcastRange(int startMessageId,
int endMessageId,
int ranType) |
boolean |
enableGsmBroadcastRange(int startMessageId,
int endMessageId) |
protected void |
enforceReceiveAndSend(String message) |
List<SmsRawData> |
getAllMessagesFromIccEf(String callingPackage)
Retrieves all messages currently stored on Icc.
|
String |
getImsSmsFormat() |
int |
getPremiumSmsPermission(String packageName) |
void |
injectSmsPdu(byte[] pdu,
String format,
PendingIntent receivedIntent)
Inject an SMS PDU into the android application framework.
|
boolean |
isImsSmsSupported() |
protected void |
log(String msg) |
protected byte[] |
makeSmsRecordData(int status,
byte[] pdu)
Generates an EF_SMS record from status and raw PDU.
|
protected void |
markMessagesAsRead(ArrayList<byte[]> messages) |
void |
sendData(String callingPackage,
String destAddr,
String scAddr,
int destPort,
byte[] data,
PendingIntent sentIntent,
PendingIntent deliveryIntent)
A permissions check before passing to
sendDataInternal(java.lang.String, java.lang.String, java.lang.String, int, byte[], android.app.PendingIntent, android.app.PendingIntent) . |
void |
sendDataWithSelfPermissions(String callingPackage,
String destAddr,
String scAddr,
int destPort,
byte[] data,
PendingIntent sentIntent,
PendingIntent deliveryIntent)
A permissions check before passing to
sendDataInternal(java.lang.String, java.lang.String, java.lang.String, int, byte[], android.app.PendingIntent, android.app.PendingIntent) . |
void |
sendMultipartText(String callingPackage,
String destAddr,
String scAddr,
List<String> parts,
List<PendingIntent> sentIntents,
List<PendingIntent> deliveryIntents,
boolean persistMessageForNonDefaultSmsApp)
Send a multi-part text based SMS.
|
void |
sendStoredMultipartText(String callingPkg,
Uri messageUri,
String scAddress,
List<PendingIntent> sentIntents,
List<PendingIntent> deliveryIntents) |
void |
sendStoredText(String callingPkg,
Uri messageUri,
String scAddress,
PendingIntent sentIntent,
PendingIntent deliveryIntent) |
void |
sendText(String callingPackage,
String destAddr,
String scAddr,
String text,
PendingIntent sentIntent,
PendingIntent deliveryIntent,
boolean persistMessageForNonDefaultSmsApp)
A permissions check before passing to
sendTextInternal(java.lang.String, java.lang.String, java.lang.String, java.lang.String, android.app.PendingIntent, android.app.PendingIntent, boolean) . |
void |
sendTextWithSelfPermissions(String callingPackage,
String destAddr,
String scAddr,
String text,
PendingIntent sentIntent,
PendingIntent deliveryIntent,
boolean persistMessage)
A permissions check before passing to
sendTextInternal(java.lang.String, java.lang.String, java.lang.String, java.lang.String, android.app.PendingIntent, android.app.PendingIntent, boolean) . |
void |
setPremiumSmsPermission(String packageName,
int permission) |
boolean |
updateMessageOnIccEf(String callingPackage,
int index,
int status,
byte[] pdu)
Update the specified message on the Icc.
|
protected void |
updatePhoneObject(Phone phone) |
protected final Object mLock
protected boolean mSuccess
protected static final int EVENT_SET_BROADCAST_ACTIVATION_DONE
protected static final int EVENT_SET_BROADCAST_CONFIG_DONE
protected Phone mPhone
protected final Context mContext
protected final AppOpsManager mAppOps
protected SMSDispatcher mDispatcher
protected Handler mHandler
protected IccSmsInterfaceManager(Phone phone)
protected void markMessagesAsRead(ArrayList<byte[]> messages)
protected void updatePhoneObject(Phone phone)
protected void enforceReceiveAndSend(String message)
public boolean updateMessageOnIccEf(String callingPackage, int index, int status, byte[] pdu)
index
- record index of message to updatestatus
- new message status (STATUS_ON_ICC_READ,
STATUS_ON_ICC_UNREAD, STATUS_ON_ICC_SENT,
STATUS_ON_ICC_UNSENT, STATUS_ON_ICC_FREE)pdu
- the raw PDU to storepublic boolean copyMessageToIccEf(String callingPackage, int status, byte[] pdu, byte[] smsc)
pdu
- the raw PDU to storestatus
- message status (STATUS_ON_ICC_READ, STATUS_ON_ICC_UNREAD,
STATUS_ON_ICC_SENT, STATUS_ON_ICC_UNSENT)public List<SmsRawData> getAllMessagesFromIccEf(String callingPackage)
public void sendDataWithSelfPermissions(String callingPackage, String destAddr, String scAddr, int destPort, byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent)
sendDataInternal(java.lang.String, java.lang.String, java.lang.String, int, byte[], android.app.PendingIntent, android.app.PendingIntent)
.
This method checks if the calling package or itself has the permission to send the data sms.public void sendData(String callingPackage, String destAddr, String scAddr, int destPort, byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent)
sendDataInternal(java.lang.String, java.lang.String, java.lang.String, int, byte[], android.app.PendingIntent, android.app.PendingIntent)
.
This method checks only if the calling package has the permission to send the data sms.public void sendText(String callingPackage, String destAddr, String scAddr, String text, PendingIntent sentIntent, PendingIntent deliveryIntent, boolean persistMessageForNonDefaultSmsApp)
sendTextInternal(java.lang.String, java.lang.String, java.lang.String, java.lang.String, android.app.PendingIntent, android.app.PendingIntent, boolean)
.
This method checks only if the calling package has the permission to send the sms.public void sendTextWithSelfPermissions(String callingPackage, String destAddr, String scAddr, String text, PendingIntent sentIntent, PendingIntent deliveryIntent, boolean persistMessage)
sendTextInternal(java.lang.String, java.lang.String, java.lang.String, java.lang.String, android.app.PendingIntent, android.app.PendingIntent, boolean)
.
This method checks if the calling package or itself has the permission to send the sms.public void injectSmsPdu(byte[] pdu, String format, PendingIntent receivedIntent)
pdu
- is the byte array of pdu to be injected into android application frameworkformat
- is the format of SMS pdu (3gpp or 3gpp2)receivedIntent
- if not NULL this PendingIntent
is
broadcast when the message is successfully received by the
android application framework. This intent is broadcasted at
the same time an SMS received from radio is acknowledged back.public void sendMultipartText(String callingPackage, String destAddr, String scAddr, List<String> parts, List<PendingIntent> sentIntents, List<PendingIntent> deliveryIntents, boolean persistMessageForNonDefaultSmsApp)
destAddr
- the address to send the message toscAddr
- is the service center address or null to use
the current default SMSCparts
- an ArrayList
of strings that, in order,
comprise the original messagesentIntents
- if not null, an ArrayList
of
PendingIntent
s (one for each message part) that is
broadcast when the corresponding message part has been sent.
The result code will be Activity.RESULT_OK for success,
or one of these errors:
RESULT_ERROR_GENERIC_FAILURE
RESULT_ERROR_RADIO_OFF
RESULT_ERROR_NULL_PDU
.
The per-application based SMS control checks sentIntent. If sentIntent
is NULL the caller will be checked against all unknown applications,
which cause smaller number of SMS to be sent in checking period.
deliveryIntents
- if not null, an ArrayList
of
PendingIntent
s (one for each message part) that is
broadcast when the corresponding message part has been delivered
to the recipient. The raw pdu of the status report is in the
extended data ("pdu").public int getPremiumSmsPermission(String packageName)
public void setPremiumSmsPermission(String packageName, int permission)
protected ArrayList<SmsRawData> buildValidRawData(ArrayList<byte[]> messages)
messages
- List of message records from EF_SMS.protected byte[] makeSmsRecordData(int status, byte[] pdu)
status
- Message status. See TS 51.011 10.5.3.pdu
- Raw message PDU.public boolean enableCellBroadcast(int messageIdentifier, int ranType)
public boolean disableCellBroadcast(int messageIdentifier, int ranType)
public boolean enableCellBroadcastRange(int startMessageId, int endMessageId, int ranType)
public boolean disableCellBroadcastRange(int startMessageId, int endMessageId, int ranType)
public boolean enableGsmBroadcastRange(int startMessageId, int endMessageId)
public boolean disableGsmBroadcastRange(int startMessageId, int endMessageId)
public boolean enableCdmaBroadcastRange(int startMessageId, int endMessageId)
public boolean disableCdmaBroadcastRange(int startMessageId, int endMessageId)
protected void log(String msg)
public boolean isImsSmsSupported()
public String getImsSmsFormat()
public void sendStoredText(String callingPkg, Uri messageUri, String scAddress, PendingIntent sentIntent, PendingIntent deliveryIntent)
public void sendStoredMultipartText(String callingPkg, Uri messageUri, String scAddress, List<PendingIntent> sentIntents, List<PendingIntent> deliveryIntents)