aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/BluetoothAdapterSnippet.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/BluetoothAdapterSnippet.java')
-rw-r--r--src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/BluetoothAdapterSnippet.java16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/BluetoothAdapterSnippet.java b/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/BluetoothAdapterSnippet.java
index 37e7c5f..14393be 100644
--- a/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/BluetoothAdapterSnippet.java
+++ b/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/BluetoothAdapterSnippet.java
@@ -23,7 +23,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
-import android.support.test.InstrumentationRegistry;
+import androidx.test.platform.app.InstrumentationRegistry;
import com.google.android.mobly.snippet.Snippet;
import com.google.android.mobly.snippet.bundled.utils.JsonSerializer;
import com.google.android.mobly.snippet.bundled.utils.Utils;
@@ -55,7 +55,7 @@ public class BluetoothAdapterSnippet implements Snippet {
private volatile boolean mIsDiscoveryFinished = false;
public BluetoothAdapterSnippet() {
- mContext = InstrumentationRegistry.getContext();
+ mContext = InstrumentationRegistry.getInstrumentation().getContext();
}
/**
@@ -138,9 +138,8 @@ public class BluetoothAdapterSnippet implements Snippet {
}
@Rpc(
- description =
- "Get bluetooth discovery results, which is a list of serialized BluetoothDevice objects."
- )
+ description =
+ "Get bluetooth discovery results, which is a list of serialized BluetoothDevice objects.")
public ArrayList<Bundle> btGetCachedScanResults() {
return mJsonSerializer.serializeBluetoothDeviceList(mDiscoveryResults.values());
}
@@ -168,10 +167,9 @@ public class BluetoothAdapterSnippet implements Snippet {
}
@Rpc(
- description =
- "Start discovery, wait for discovery to complete, and return results, which is a list of "
- + "serialized BluetoothDevice objects."
- )
+ description =
+ "Start discovery, wait for discovery to complete, and return results, which is a list of "
+ + "serialized BluetoothDevice objects.")
public List<Bundle> btDiscoverAndGetResults()
throws InterruptedException, BluetoothAdapterSnippetException {
IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);