Package org.robolectric.shadows
Class ShadowSmsManager
java.lang.Object
org.robolectric.shadows.ShadowSmsManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final classTestable parameters from calls todownloadMultimediaMessage(android.content.Context, java.lang.String, android.net.Uri, android.os.Bundle, android.app.PendingIntent).static classBase class for testable parameters from calls to eitherdownloadMultimediaMessage(android.content.Context, java.lang.String, android.net.Uri, android.os.Bundle, android.app.PendingIntent)ordownloadMultimediaMessage(android.content.Context, java.lang.String, android.net.Uri, android.os.Bundle, android.app.PendingIntent).static final classTestable parameters from calls tosendMultimediaMessage(android.content.Context, android.net.Uri, java.lang.String, android.os.Bundle, android.app.PendingIntent).static classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ShadowSmsManager.DataMessageParamsprotected ShadowSmsManager.TextMultipartParamsprotected ShadowSmsManager.TextSmsParams -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClear last recorded parameters fordownloadMultimediaMessage(android.content.Context, java.lang.String, android.net.Uri, android.os.Bundle, android.app.PendingIntent).voidClear last recorded parameters forsendDataMessage(java.lang.String, java.lang.String, short, byte[], android.app.PendingIntent, android.app.PendingIntent).voidClear last recorded parameters forsendMultimediaMessage(android.content.Context, android.net.Uri, java.lang.String, android.os.Bundle, android.app.PendingIntent).voidvoidClear last recorded parameters forsendTextMessage(java.lang.String, java.lang.String, java.lang.String, android.app.PendingIntent, android.app.PendingIntent).protected voiddownloadMultimediaMessage(Context context, String locationUrl, Uri contentUri, Bundle configOverrides, PendingIntent sentIntent) protected voiddownloadMultimediaMessage(Context context, String locationUrl, Uri contentUri, Bundle configOverrides, PendingIntent sentIntent, long messageId) protected static intReturns-1by default or the value specified insetDefaultSmsSubscriptionId(int).protected StringReturnsnullby default or the value specified viasetSmscAddress(String).static voidreset()protected voidsendDataMessage(String destinationAddress, String scAddress, short destinationPort, byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent) protected voidsendMultimediaMessage(Context context, Uri contentUri, String locationUrl, Bundle configOverrides, PendingIntent sentIntent) protected voidsendMultimediaMessage(Context context, Uri contentUri, String locationUrl, Bundle configOverrides, PendingIntent sentIntent, long messageId) protected voidsendMultipartTextMessage(String destinationAddress, String scAddress, ArrayList<String> parts, ArrayList<PendingIntent> sentIntents, ArrayList<PendingIntent> deliveryIntents) protected voidsendMultipartTextMessage(String destinationAddress, String scAddress, List<String> parts, List<PendingIntent> sentIntents, List<PendingIntent> deliveryIntents, long messageId) protected voidsendTextMessage(String destinationAddress, String scAddress, String text, PendingIntent sentIntent, PendingIntent deliveryIntent) protected voidsendTextMessage(String destinationAddress, String scAddress, String text, PendingIntent sentIntent, PendingIntent deliveryIntent, long messageId) static voidsetDefaultSmsSubscriptionId(int id) Sets the value to be returned bygetDefaultSmsSubscriptionId().voidsetSmscAddress(String smscAddress) Sets the value returned bySmsManager.getSmscAddress().voidsetSmscAddressPermission(boolean smscAddressPermission) Sets a boolean value to simulate whether or not the required permissions to callgetSmscAddress()have been granted.
-
Field Details
-
lastTextSmsParams
-
lastTextMultipartParams
-
lastDataParams
-
lastSentMultimediaMessageParams
-
lastDownloadedMultimediaMessageParams
-
-
Constructor Details
-
ShadowSmsManager
public ShadowSmsManager()
-
-
Method Details
-
reset
-
sendDataMessage
@Implementation protected void sendDataMessage(String destinationAddress, String scAddress, short destinationPort, byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent) -
sendTextMessage
@Implementation protected void sendTextMessage(String destinationAddress, String scAddress, String text, PendingIntent sentIntent, PendingIntent deliveryIntent) -
sendTextMessage
@Implementation(minSdk=30) protected void sendTextMessage(String destinationAddress, String scAddress, String text, PendingIntent sentIntent, PendingIntent deliveryIntent, long messageId) -
sendMultipartTextMessage
@Implementation protected void sendMultipartTextMessage(String destinationAddress, String scAddress, ArrayList<String> parts, ArrayList<PendingIntent> sentIntents, ArrayList<PendingIntent> deliveryIntents) -
getLastSentDataMessageParams
- Returns:
- Parameters for last call to
sendDataMessage(java.lang.String, java.lang.String, short, byte[], android.app.PendingIntent, android.app.PendingIntent).
-
clearLastSentDataMessageParams
public void clearLastSentDataMessageParams()Clear last recorded parameters forsendDataMessage(java.lang.String, java.lang.String, short, byte[], android.app.PendingIntent, android.app.PendingIntent). -
getLastSentTextMessageParams
- Returns:
- Parameters for last call to
sendTextMessage(java.lang.String, java.lang.String, java.lang.String, android.app.PendingIntent, android.app.PendingIntent).
-
clearLastSentTextMessageParams
public void clearLastSentTextMessageParams()Clear last recorded parameters forsendTextMessage(java.lang.String, java.lang.String, java.lang.String, android.app.PendingIntent, android.app.PendingIntent). -
getLastSentMultipartTextMessageParams
-
clearLastSentMultipartTextMessageParams
public void clearLastSentMultipartTextMessageParams() -
sendMultimediaMessage
@Implementation protected void sendMultimediaMessage(Context context, Uri contentUri, String locationUrl, Bundle configOverrides, PendingIntent sentIntent) -
sendMultimediaMessage
@Implementation(minSdk=31) protected void sendMultimediaMessage(Context context, Uri contentUri, String locationUrl, Bundle configOverrides, PendingIntent sentIntent, long messageId) -
downloadMultimediaMessage
@Implementation protected void downloadMultimediaMessage(Context context, String locationUrl, Uri contentUri, Bundle configOverrides, PendingIntent sentIntent) -
downloadMultimediaMessage
@Implementation(minSdk=31) protected void downloadMultimediaMessage(Context context, String locationUrl, Uri contentUri, Bundle configOverrides, PendingIntent sentIntent, long messageId) -
getLastSentMultimediaMessageParams
- Returns:
- Parameters for last call to
sendMultimediaMessage(android.content.Context, android.net.Uri, java.lang.String, android.os.Bundle, android.app.PendingIntent).
-
clearLastSentMultimediaMessageParams
public void clearLastSentMultimediaMessageParams()Clear last recorded parameters forsendMultimediaMessage(android.content.Context, android.net.Uri, java.lang.String, android.os.Bundle, android.app.PendingIntent). -
getLastDownloadedMultimediaMessageParams
- Returns:
- Parameters for last call to
downloadMultimediaMessage(android.content.Context, java.lang.String, android.net.Uri, android.os.Bundle, android.app.PendingIntent).
-
clearLastDownloadedMultimediaMessageParams
public void clearLastDownloadedMultimediaMessageParams()Clear last recorded parameters fordownloadMultimediaMessage(android.content.Context, java.lang.String, android.net.Uri, android.os.Bundle, android.app.PendingIntent). -
sendMultipartTextMessage
@Implementation(minSdk=30) protected void sendMultipartTextMessage(String destinationAddress, String scAddress, List<String> parts, List<PendingIntent> sentIntents, List<PendingIntent> deliveryIntents, long messageId) -
setSmscAddressPermission
public void setSmscAddressPermission(boolean smscAddressPermission) Sets a boolean value to simulate whether or not the required permissions to callgetSmscAddress()have been granted. -
getSmscAddress
Returnsnullby default or the value specified viasetSmscAddress(String). Required permission is set bysetSmscAddressPermission(boolean). -
setDefaultSmsSubscriptionId
public static void setDefaultSmsSubscriptionId(int id) Sets the value to be returned bygetDefaultSmsSubscriptionId(). -
getDefaultSmsSubscriptionId
Returns-1by default or the value specified insetDefaultSmsSubscriptionId(int). -
setSmscAddress
Sets the value returned bySmsManager.getSmscAddress().
-