Joe Onorato | fce2bf3 | 2011-02-01 17:00:29 -0800 | [diff] [blame] | 1 | /* |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 2 | * Copyright (C) 2014 The Android Open Source Project |
Joe Onorato | fce2bf3 | 2011-02-01 17:00:29 -0800 | [diff] [blame] | 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.systemui.statusbar.policy; |
| 18 | |
Jason Monk | be3c5db | 2015-02-04 13:00:55 -0500 | [diff] [blame] | 19 | import com.android.settingslib.bluetooth.CachedBluetoothDevice; |
Jason Monk | 9c7844c | 2017-01-18 15:21:53 -0500 | [diff] [blame] | 20 | import com.android.systemui.Dumpable; |
Jason Monk | 8852905 | 2016-11-04 13:29:58 -0400 | [diff] [blame] | 21 | import com.android.systemui.statusbar.policy.BluetoothController.Callback; |
Jason Monk | be3c5db | 2015-02-04 13:00:55 -0500 | [diff] [blame] | 22 | |
| 23 | import java.util.Collection; |
Amin Shaikh | 45fb7a7 | 2018-04-18 14:14:38 -0400 | [diff] [blame] | 24 | import java.util.List; |
John Spurlock | 486b78e | 2014-07-07 08:37:56 -0400 | [diff] [blame] | 25 | |
Jason Monk | 9c7844c | 2017-01-18 15:21:53 -0500 | [diff] [blame] | 26 | public interface BluetoothController extends CallbackController<Callback>, Dumpable { |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 27 | boolean isBluetoothSupported(); |
| 28 | boolean isBluetoothEnabled(); |
Jason Monk | fac2538 | 2016-07-19 14:13:37 -0400 | [diff] [blame] | 29 | |
| 30 | int getBluetoothState(); |
| 31 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 32 | boolean isBluetoothConnected(); |
John Spurlock | d1c86e2 | 2014-06-01 00:04:53 -0400 | [diff] [blame] | 33 | boolean isBluetoothConnecting(); |
Amin Shaikh | 45fb7a7 | 2018-04-18 14:14:38 -0400 | [diff] [blame] | 34 | String getConnectedDeviceName(); |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 35 | void setBluetoothEnabled(boolean enabled); |
Jason Monk | be3c5db | 2015-02-04 13:00:55 -0500 | [diff] [blame] | 36 | Collection<CachedBluetoothDevice> getDevices(); |
| 37 | void connect(CachedBluetoothDevice device); |
| 38 | void disconnect(CachedBluetoothDevice device); |
Sudheer Shanka | b6fc931 | 2016-01-27 19:59:03 +0000 | [diff] [blame] | 39 | boolean canConfigBluetooth(); |
John Spurlock | d1c86e2 | 2014-06-01 00:04:53 -0400 | [diff] [blame] | 40 | |
Jason Monk | 9ef03b4 | 2017-06-13 12:49:55 -0400 | [diff] [blame] | 41 | int getMaxConnectionState(CachedBluetoothDevice device); |
| 42 | int getBondState(CachedBluetoothDevice device); |
Amin Shaikh | 45fb7a7 | 2018-04-18 14:14:38 -0400 | [diff] [blame] | 43 | List<CachedBluetoothDevice> getConnectedDevices(); |
Jason Monk | 9ef03b4 | 2017-06-13 12:49:55 -0400 | [diff] [blame] | 44 | |
John Spurlock | d1c86e2 | 2014-06-01 00:04:53 -0400 | [diff] [blame] | 45 | public interface Callback { |
Jason Monk | a7d92b6 | 2015-05-27 10:20:37 -0400 | [diff] [blame] | 46 | void onBluetoothStateChange(boolean enabled); |
Jason Monk | be3c5db | 2015-02-04 13:00:55 -0500 | [diff] [blame] | 47 | void onBluetoothDevicesChanged(); |
John Spurlock | d1c86e2 | 2014-06-01 00:04:53 -0400 | [diff] [blame] | 48 | } |
Joe Onorato | fce2bf3 | 2011-02-01 17:00:29 -0800 | [diff] [blame] | 49 | } |