Home | History | Annotate | Download | only in bluetooth
      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      */
     31     boolean isConnectable();
     32 
     33     /**
     34      * Returns true if the user can enable auto connection for this profile.
     35      */
     36     boolean isAutoConnectable();
     37 
     38     boolean connect(BluetoothDevice device);
     39 
     40     boolean disconnect(BluetoothDevice device);
     41 
     42     int getConnectionStatus(BluetoothDevice device);
     43 
     44     boolean isPreferred(BluetoothDevice device);
     45 
     46     int getPreferred(BluetoothDevice device);
     47 
     48     void setPreferred(BluetoothDevice device, boolean preferred);
     49 
     50     boolean isProfileReady();
     51 
     52     int getProfileId();
     53 
     54     /** Display order for device profile settings. */
     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      */
     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      */
     70     int getSummaryResourceForDevice(BluetoothDevice device);
     71 
     72     int getDrawableResource(BluetoothClass btClass);
     73 }
     74