diff options
author | Ang Li <angli@google.com> | 2019-01-11 12:51:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-11 12:51:57 -0800 |
commit | 35e1bfad098f65db344d4d6fd7abb5830d8aa7a2 (patch) | |
tree | beaaeacddf74b89951433c7c37cec0e10a605a2a /src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/profiles | |
parent | 2fa52efb68751e9729ac733548687889e8cfb884 (diff) | |
download | mobly-bundled-snippets-35e1bfad098f65db344d4d6fd7abb5830d8aa7a2.tar.gz |
Migrate to androidx packages (#105)
Diffstat (limited to 'src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/profiles')
-rw-r--r-- | src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/profiles/BluetoothA2dpSnippet.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/profiles/BluetoothA2dpSnippet.java b/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/profiles/BluetoothA2dpSnippet.java index b218723..ec148ca 100644 --- a/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/profiles/BluetoothA2dpSnippet.java +++ b/src/main/java/com/google/android/mobly/snippet/bundled/bluetooth/profiles/BluetoothA2dpSnippet.java @@ -9,7 +9,7 @@ import android.content.Context; import android.content.IntentFilter; import android.os.Build; 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.bluetooth.BluetoothAdapterSnippet; import com.google.android.mobly.snippet.bundled.bluetooth.PairingBroadcastReceiver; @@ -34,7 +34,7 @@ public class BluetoothA2dpSnippet implements Snippet { private final JsonSerializer mJsonSerializer = new JsonSerializer(); public BluetoothA2dpSnippet() { - mContext = InstrumentationRegistry.getContext(); + mContext = InstrumentationRegistry.getInstrumentation().getContext(); BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); bluetoothAdapter.getProfileProxy( mContext, new A2dpServiceListener(), BluetoothProfile.A2DP); @@ -55,10 +55,9 @@ public class BluetoothA2dpSnippet implements Snippet { @TargetApi(Build.VERSION_CODES.KITKAT) @RpcMinSdk(Build.VERSION_CODES.KITKAT) @Rpc( - description = - "Connects to a paired or discovered device with A2DP profile." - + "If a device has been discovered but not paired, this will pair it." - ) + description = + "Connects to a paired or discovered device with A2DP profile." + + "If a device has been discovered but not paired, this will pair it.") public void btA2dpConnect(String deviceAddress) throws Throwable { BluetoothDevice device = BluetoothAdapterSnippet.getKnownDeviceByAddress(deviceAddress); IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_PAIRING_REQUEST); |