blob: 08675c4f027c7c2fa509c562f7f1aefb5d16df5d [file] [log] [blame]
Joe Onoratofce2bf32011-02-01 17:00:29 -08001/*
John Spurlockaf8d6c42014-05-07 17:49:08 -04002 * Copyright (C) 2014 The Android Open Source Project
Joe Onoratofce2bf32011-02-01 17:00:29 -08003 *
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
17package com.android.systemui.statusbar.policy;
18
Jason Monkbe3c5db2015-02-04 13:00:55 -050019import com.android.settingslib.bluetooth.CachedBluetoothDevice;
20
21import java.util.Collection;
John Spurlock486b78e2014-07-07 08:37:56 -040022
John Spurlockaf8d6c42014-05-07 17:49:08 -040023public interface BluetoothController {
John Spurlockd1c86e22014-06-01 00:04:53 -040024 void addStateChangedCallback(Callback callback);
25 void removeStateChangedCallback(Callback callback);
Winson Chung5f623012012-09-14 14:58:43 -070026
John Spurlockaf8d6c42014-05-07 17:49:08 -040027 boolean isBluetoothSupported();
28 boolean isBluetoothEnabled();
Jason Monkfac25382016-07-19 14:13:37 -040029
30 int getBluetoothState();
31
John Spurlockaf8d6c42014-05-07 17:49:08 -040032 boolean isBluetoothConnected();
John Spurlockd1c86e22014-06-01 00:04:53 -040033 boolean isBluetoothConnecting();
34 String getLastDeviceName();
John Spurlockaf8d6c42014-05-07 17:49:08 -040035 void setBluetoothEnabled(boolean enabled);
Jason Monkbe3c5db2015-02-04 13:00:55 -050036 Collection<CachedBluetoothDevice> getDevices();
37 void connect(CachedBluetoothDevice device);
38 void disconnect(CachedBluetoothDevice device);
Sudheer Shankab6fc9312016-01-27 19:59:03 +000039 boolean canConfigBluetooth();
John Spurlockd1c86e22014-06-01 00:04:53 -040040
41 public interface Callback {
Jason Monka7d92b62015-05-27 10:20:37 -040042 void onBluetoothStateChange(boolean enabled);
Jason Monkbe3c5db2015-02-04 13:00:55 -050043 void onBluetoothDevicesChanged();
John Spurlockd1c86e22014-06-01 00:04:53 -040044 }
Joe Onoratofce2bf32011-02-01 17:00:29 -080045}