• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2011 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 com.android.settingslib.bluetooth;
18 
19 import android.bluetooth.BluetoothClass;
20 import android.bluetooth.BluetoothDevice;
21 
22 /**
23  * LocalBluetoothProfile is an interface defining the basic
24  * functionality related to a Bluetooth profile.
25  */
26 public interface LocalBluetoothProfile {
27 
28     /**
29      * Returns true if the user can initiate a connection, false otherwise.
30      */
isConnectable()31     boolean isConnectable();
32 
33     /**
34      * Returns true if the user can enable auto connection for this profile.
35      */
isAutoConnectable()36     boolean isAutoConnectable();
37 
connect(BluetoothDevice device)38     boolean connect(BluetoothDevice device);
39 
disconnect(BluetoothDevice device)40     boolean disconnect(BluetoothDevice device);
41 
getConnectionStatus(BluetoothDevice device)42     int getConnectionStatus(BluetoothDevice device);
43 
isPreferred(BluetoothDevice device)44     boolean isPreferred(BluetoothDevice device);
45 
getPreferred(BluetoothDevice device)46     int getPreferred(BluetoothDevice device);
47 
setPreferred(BluetoothDevice device, boolean preferred)48     void setPreferred(BluetoothDevice device, boolean preferred);
49 
isProfileReady()50     boolean isProfileReady();
51 
52     /** Display order for device profile settings. */
getOrdinal()53     int getOrdinal();
54 
55     /**
56      * Returns the string resource ID for the localized name for this profile.
57      * @param device the Bluetooth device (to distinguish between PAN roles)
58      */
getNameResource(BluetoothDevice device)59     int getNameResource(BluetoothDevice device);
60 
61     /**
62      * Returns the string resource ID for the summary text for this profile
63      * for the specified device, e.g. "Use for media audio" or
64      * "Connected to media audio".
65      * @param device the device to query for profile connection status
66      * @return a string resource ID for the profile summary text
67      */
getSummaryResourceForDevice(BluetoothDevice device)68     int getSummaryResourceForDevice(BluetoothDevice device);
69 
getDrawableResource(BluetoothClass btClass)70     int getDrawableResource(BluetoothClass btClass);
71 }
72