summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothDevicePicker.java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2022-01-18 23:59:58 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-01-18 23:59:58 +0000
commitd15d8266b900c549d2eed52c56f82d7c3c3792c8 (patch)
tree0b7c4c70453c091e24e37758ff1b1fd49bf20eb3 /framework/java/android/bluetooth/BluetoothDevicePicker.java
parent7d69d903a5ee30dac4abc82e056f2b8ec0278708 (diff)
parentaa6d8f71ae61c0e57b35258c00d28fcba5154f09 (diff)
Merge changes from topic "migrate-sc-bt" into sc-v2-dev-plus-aosp
* changes: Migrating BT files into packages/modules/Bluetooth Merge history of Bluetooth API from frameworks/base
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothDevicePicker.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothDevicePicker.java80
1 files changed, 80 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothDevicePicker.java b/framework/java/android/bluetooth/BluetoothDevicePicker.java
new file mode 100644
index 0000000000..26e46573dd
--- /dev/null
+++ b/framework/java/android/bluetooth/BluetoothDevicePicker.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.bluetooth;
+
+import android.annotation.RequiresPermission;
+import android.annotation.SdkConstant;
+import android.annotation.SdkConstant.SdkConstantType;
+import android.bluetooth.annotations.RequiresBluetoothConnectPermission;
+
+/**
+ * A helper to show a system "Device Picker" activity to the user.
+ *
+ * @hide
+ */
+public interface BluetoothDevicePicker {
+ public static final String EXTRA_NEED_AUTH =
+ "android.bluetooth.devicepicker.extra.NEED_AUTH";
+ public static final String EXTRA_FILTER_TYPE =
+ "android.bluetooth.devicepicker.extra.FILTER_TYPE";
+ public static final String EXTRA_LAUNCH_PACKAGE =
+ "android.bluetooth.devicepicker.extra.LAUNCH_PACKAGE";
+ public static final String EXTRA_LAUNCH_CLASS =
+ "android.bluetooth.devicepicker.extra.DEVICE_PICKER_LAUNCH_CLASS";
+
+ /**
+ * Broadcast when one BT device is selected from BT device picker screen.
+ * Selected {@link BluetoothDevice} is returned in extra data named
+ * {@link BluetoothDevice#EXTRA_DEVICE}.
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_DEVICE_SELECTED =
+ "android.bluetooth.devicepicker.action.DEVICE_SELECTED";
+
+ /**
+ * Broadcast when someone want to select one BT device from devices list.
+ * This intent contains below extra data:
+ * - {@link #EXTRA_NEED_AUTH} (boolean): if need authentication
+ * - {@link #EXTRA_FILTER_TYPE} (int): what kinds of device should be
+ * listed
+ * - {@link #EXTRA_LAUNCH_PACKAGE} (string): where(which package) this
+ * intent come from
+ * - {@link #EXTRA_LAUNCH_CLASS} (string): where(which class) this intent
+ * come from
+ */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_LAUNCH =
+ "android.bluetooth.devicepicker.action.LAUNCH";
+
+ /** Ask device picker to show all kinds of BT devices */
+ public static final int FILTER_TYPE_ALL = 0;
+ /** Ask device picker to show BT devices that support AUDIO profiles */
+ public static final int FILTER_TYPE_AUDIO = 1;
+ /** Ask device picker to show BT devices that support Object Transfer */
+ public static final int FILTER_TYPE_TRANSFER = 2;
+ /**
+ * Ask device picker to show BT devices that support
+ * Personal Area Networking User (PANU) profile
+ */
+ public static final int FILTER_TYPE_PANU = 3;
+ /** Ask device picker to show BT devices that support Network Access Point (NAP) profile */
+ public static final int FILTER_TYPE_NAP = 4;
+}