aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/google/android/mobly/snippet
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/android/mobly/snippet')
-rw-r--r--src/main/java/com/google/android/mobly/snippet/bundled/SmsSnippet.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/com/google/android/mobly/snippet/bundled/SmsSnippet.java b/src/main/java/com/google/android/mobly/snippet/bundled/SmsSnippet.java
index 4a38798..ec6d470 100644
--- a/src/main/java/com/google/android/mobly/snippet/bundled/SmsSnippet.java
+++ b/src/main/java/com/google/android/mobly/snippet/bundled/SmsSnippet.java
@@ -115,12 +115,11 @@ public class SmsSnippet implements Snippet {
@TargetApi(Build.VERSION_CODES.KITKAT)
@Rpc(description = "Wait for incoming SMS message.")
- public JSONObject waitForSms() throws Throwable {
+ public JSONObject waitForSms(int timeoutMillis) throws Throwable {
String callbackId = SMS_CALLBACK_ID_PREFIX + (++mCallbackCounter);
SmsReceiver receiver = new SmsReceiver(mContext, callbackId);
mContext.registerReceiver(receiver, new IntentFilter(Intents.SMS_RECEIVED_ACTION));
- return Utils.waitForSnippetEvent(
- callbackId, SMS_RECEIVED_EVENT_NAME, DEFAULT_TIMEOUT_MILLISECOND)
+ return Utils.waitForSnippetEvent(callbackId, SMS_RECEIVED_EVENT_NAME, timeoutMillis)
.toJson();
}