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 * Return {@code true} if the user can initiate a connection for this profile in UI. 30 */ accessProfileEnabled()31 boolean accessProfileEnabled(); 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 getProfileId()52 int getProfileId(); 53 54 /** Display order for device profile settings. */ getOrdinal()55 int getOrdinal(); 56 57 /** 58 * Returns the string resource ID for the localized name for this profile. 59 * @param device the Bluetooth device (to distinguish between PAN roles) 60 */ getNameResource(BluetoothDevice device)61 int getNameResource(BluetoothDevice device); 62 63 /** 64 * Returns the string resource ID for the summary text for this profile 65 * for the specified device, e.g. "Use for media audio" or 66 * "Connected to media audio". 67 * @param device the device to query for profile connection status 68 * @return a string resource ID for the profile summary text 69 */ getSummaryResourceForDevice(BluetoothDevice device)70 int getSummaryResourceForDevice(BluetoothDevice device); 71 getDrawableResource(BluetoothClass btClass)72 int getDrawableResource(BluetoothClass btClass); 73 } 74