1 /* 2 * Copyright (C) 2009 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.bluetooth; 18 19 import android.annotation.RequiresPermission; 20 import android.annotation.SdkConstant; 21 import android.annotation.SdkConstant.SdkConstantType; 22 import android.bluetooth.annotations.RequiresBluetoothConnectPermission; 23 24 /** 25 * A helper to show a system "Device Picker" activity to the user. 26 * 27 * @hide 28 */ 29 public interface BluetoothDevicePicker { 30 public static final String EXTRA_NEED_AUTH = 31 "android.bluetooth.devicepicker.extra.NEED_AUTH"; 32 public static final String EXTRA_FILTER_TYPE = 33 "android.bluetooth.devicepicker.extra.FILTER_TYPE"; 34 public static final String EXTRA_LAUNCH_PACKAGE = 35 "android.bluetooth.devicepicker.extra.LAUNCH_PACKAGE"; 36 public static final String EXTRA_LAUNCH_CLASS = 37 "android.bluetooth.devicepicker.extra.DEVICE_PICKER_LAUNCH_CLASS"; 38 39 /** 40 * Broadcast when one BT device is selected from BT device picker screen. 41 * Selected {@link BluetoothDevice} is returned in extra data named 42 * {@link BluetoothDevice#EXTRA_DEVICE}. 43 */ 44 @RequiresBluetoothConnectPermission 45 @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) 46 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 47 public static final String ACTION_DEVICE_SELECTED = 48 "android.bluetooth.devicepicker.action.DEVICE_SELECTED"; 49 50 /** 51 * Broadcast when someone want to select one BT device from devices list. 52 * This intent contains below extra data: 53 * - {@link #EXTRA_NEED_AUTH} (boolean): if need authentication 54 * - {@link #EXTRA_FILTER_TYPE} (int): what kinds of device should be 55 * listed 56 * - {@link #EXTRA_LAUNCH_PACKAGE} (string): where(which package) this 57 * intent come from 58 * - {@link #EXTRA_LAUNCH_CLASS} (string): where(which class) this intent 59 * come from 60 */ 61 @RequiresBluetoothConnectPermission 62 @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) 63 @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) 64 public static final String ACTION_LAUNCH = 65 "android.bluetooth.devicepicker.action.LAUNCH"; 66 67 /** Ask device picker to show all kinds of BT devices */ 68 public static final int FILTER_TYPE_ALL = 0; 69 /** Ask device picker to show BT devices that support AUDIO profiles */ 70 public static final int FILTER_TYPE_AUDIO = 1; 71 /** Ask device picker to show BT devices that support Object Transfer */ 72 public static final int FILTER_TYPE_TRANSFER = 2; 73 /** 74 * Ask device picker to show BT devices that support 75 * Personal Area Networking User (PANU) profile 76 */ 77 public static final int FILTER_TYPE_PANU = 3; 78 /** Ask device picker to show BT devices that support Network Access Point (NAP) profile */ 79 public static final int FILTER_TYPE_NAP = 4; 80 } 81