summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Lambert <joshualambert@google.com>2021-02-08 16:18:29 -0800
committerJoshua Lambert <joshualambert@google.com>2021-02-08 16:18:29 -0800
commitac0536d0fe1db92a128326fca81fa42897f4d96d (patch)
treea2606ba77dc42eecc0ac33968ed5426755d92ab6
parent70d2316f74338382507c855842a88bc211316efb (diff)
downloadTvSettings-ac0536d0fe1db92a128326fca81fa42897f4d96d.tar.gz
Fix BluetoothAdapter setScanMode parameter
Note that the other values should be kept as seconds, as the Intent Extras are expected to be in seconds. We only need to convert to millis at the time of calling the BT Adapter api. Test: Compiles Bug: 179109849 Change-Id: I7f2f878ff0b11ea67b96ee0af0494d82bcd372c0
-rw-r--r--Settings/src/com/android/tv/settings/accessories/BluetoothRequestPermissionActivity.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/Settings/src/com/android/tv/settings/accessories/BluetoothRequestPermissionActivity.java b/Settings/src/com/android/tv/settings/accessories/BluetoothRequestPermissionActivity.java
index 1a0303dda..8378d5ff1 100644
--- a/Settings/src/com/android/tv/settings/accessories/BluetoothRequestPermissionActivity.java
+++ b/Settings/src/com/android/tv/settings/accessories/BluetoothRequestPermissionActivity.java
@@ -25,6 +25,8 @@ import android.util.Log;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;
+import java.util.concurrent.TimeUnit;
+
public class BluetoothRequestPermissionActivity extends FragmentActivity {
private static final String TAG = "BluetoothRequestPermissionActivity";
@@ -54,8 +56,8 @@ public class BluetoothRequestPermissionActivity extends FragmentActivity {
return;
}
- mBluetoothAdapter.setScanMode(
- BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE, mTimeoutSeconds);
+ mBluetoothAdapter.setScanMode(BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE,
+ TimeUnit.SECONDS.toMillis(mTimeoutSeconds));
setResult(Activity.RESULT_OK);
finish();