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; |
| 20 | |
| 21 | import java.util.Collection; |
John Spurlock | 486b78e | 2014-07-07 08:37:56 -0400 | [diff] [blame] | 22 | |
John Spurlock | af8d6c4 | 2014-05-07 17:49:08 -0400 | [diff] [blame] | 23 | public interface BluetoothController { |
John Spurlock | d1c86e2 | 2014-06-01 00:04:53 -0400 | [diff] [blame] | 24 | void addStateChangedCallback(Callback callback); |
| 25 | void removeStateChangedCallback(Callback callback); |
Winson Chung | 5f62301 | 2012-09-14 14:58:43 -0700 | [diff] [blame] | 26 | |
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(); |
| 34 | String getLastDeviceName(); |
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 | |
| 41 | public interface Callback { |
Jason Monk | a7d92b6 | 2015-05-27 10:20:37 -0400 | [diff] [blame] | 42 | void onBluetoothStateChange(boolean enabled); |
Jason Monk | be3c5db | 2015-02-04 13:00:55 -0500 | [diff] [blame] | 43 | void onBluetoothDevicesChanged(); |
John Spurlock | d1c86e2 | 2014-06-01 00:04:53 -0400 | [diff] [blame] | 44 | } |
Joe Onorato | fce2bf3 | 2011-02-01 17:00:29 -0800 | [diff] [blame] | 45 | } |