blob: 42e02d5846bc8fa1ca6a85b305fd0f6c4640717c [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;
Jason Monk9c7844c2017-01-18 15:21:53 -050020import com.android.systemui.Dumpable;
Jason Monk88529052016-11-04 13:29:58 -040021import com.android.systemui.statusbar.policy.BluetoothController.Callback;
Jason Monkbe3c5db2015-02-04 13:00:55 -050022
23import java.util.Collection;
Amin Shaikh45fb7a72018-04-18 14:14:38 -040024import java.util.List;
John Spurlock486b78e2014-07-07 08:37:56 -040025
Jason Monk9c7844c2017-01-18 15:21:53 -050026public interface BluetoothController extends CallbackController<Callback>, Dumpable {
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();
Amin Shaikh45fb7a72018-04-18 14:14:38 -040034 String getConnectedDeviceName();
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
Jason Monk9ef03b42017-06-13 12:49:55 -040041 int getMaxConnectionState(CachedBluetoothDevice device);
42 int getBondState(CachedBluetoothDevice device);
Amin Shaikh45fb7a72018-04-18 14:14:38 -040043 List<CachedBluetoothDevice> getConnectedDevices();
Jason Monk9ef03b42017-06-13 12:49:55 -040044
John Spurlockd1c86e22014-06-01 00:04:53 -040045 public interface Callback {
Jason Monka7d92b62015-05-27 10:20:37 -040046 void onBluetoothStateChange(boolean enabled);
Jason Monkbe3c5db2015-02-04 13:00:55 -050047 void onBluetoothDevicesChanged();
John Spurlockd1c86e22014-06-01 00:04:53 -040048 }
Joe Onoratofce2bf32011-02-01 17:00:29 -080049}