1fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato/*
2af8d6c44f06d2f8baac2c5774a9efdae3fc36797John Spurlock * Copyright (C) 2014 The Android Open Source Project
3fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato *
4fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato * Licensed under the Apache License, Version 2.0 (the "License");
5fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato * you may not use this file except in compliance with the License.
6fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato * You may obtain a copy of the License at
7fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato *
8fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato *      http://www.apache.org/licenses/LICENSE-2.0
9fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato *
10fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato * Unless required by applicable law or agreed to in writing, software
11fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato * distributed under the License is distributed on an "AS IS" BASIS,
12fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato * See the License for the specific language governing permissions and
14fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato * limitations under the License.
15fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato */
16fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato
17fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onoratopackage com.android.systemui.statusbar.policy;
18fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato
19be3c5dbee66758517a8198f98ed2e20c80af326bJason Monkimport com.android.settingslib.bluetooth.CachedBluetoothDevice;
209c7844cb91b43929d0a86b1c90aa1efb37f5463aJason Monkimport com.android.systemui.Dumpable;
218852905b0b3837e326127c6dfef6f699124ce715Jason Monkimport com.android.systemui.statusbar.policy.BluetoothController.Callback;
22be3c5dbee66758517a8198f98ed2e20c80af326bJason Monk
23be3c5dbee66758517a8198f98ed2e20c80af326bJason Monkimport java.util.Collection;
24486b78e42652466f6241eb87d5bed60040db7a25John Spurlock
259c7844cb91b43929d0a86b1c90aa1efb37f5463aJason Monkpublic interface BluetoothController extends CallbackController<Callback>, Dumpable {
26af8d6c44f06d2f8baac2c5774a9efdae3fc36797John Spurlock    boolean isBluetoothSupported();
27af8d6c44f06d2f8baac2c5774a9efdae3fc36797John Spurlock    boolean isBluetoothEnabled();
28fac2538e463138a8a1a92bc94af3f310d28718b4Jason Monk
29fac2538e463138a8a1a92bc94af3f310d28718b4Jason Monk    int getBluetoothState();
30fac2538e463138a8a1a92bc94af3f310d28718b4Jason Monk
31af8d6c44f06d2f8baac2c5774a9efdae3fc36797John Spurlock    boolean isBluetoothConnected();
32d1c86e2cb272f8b8be5b9b47aa4ec7084fe61c22John Spurlock    boolean isBluetoothConnecting();
33d1c86e2cb272f8b8be5b9b47aa4ec7084fe61c22John Spurlock    String getLastDeviceName();
34af8d6c44f06d2f8baac2c5774a9efdae3fc36797John Spurlock    void setBluetoothEnabled(boolean enabled);
35be3c5dbee66758517a8198f98ed2e20c80af326bJason Monk    Collection<CachedBluetoothDevice> getDevices();
36be3c5dbee66758517a8198f98ed2e20c80af326bJason Monk    void connect(CachedBluetoothDevice device);
37be3c5dbee66758517a8198f98ed2e20c80af326bJason Monk    void disconnect(CachedBluetoothDevice device);
38b6fc931204a3e7a40ac2dfda67f4b61aef9e4b5bSudheer Shanka    boolean canConfigBluetooth();
39d1c86e2cb272f8b8be5b9b47aa4ec7084fe61c22John Spurlock
409ef03b463c0926ab60b5e6528f94a221e0dd5631Jason Monk    int getMaxConnectionState(CachedBluetoothDevice device);
419ef03b463c0926ab60b5e6528f94a221e0dd5631Jason Monk    int getBondState(CachedBluetoothDevice device);
42f8745fc19a4168b38e053f23e2ce2078d1b6f407Jason Monk    CachedBluetoothDevice getLastDevice();
439ef03b463c0926ab60b5e6528f94a221e0dd5631Jason Monk
44d1c86e2cb272f8b8be5b9b47aa4ec7084fe61c22John Spurlock    public interface Callback {
45a7d92b6fdec6b4f572144611b768022e6a654736Jason Monk        void onBluetoothStateChange(boolean enabled);
46be3c5dbee66758517a8198f98ed2e20c80af326bJason Monk        void onBluetoothDevicesChanged();
47d1c86e2cb272f8b8be5b9b47aa4ec7084fe61c22John Spurlock    }
48fce2bf3735177828ccf823b49d3396dfaccc8fd4Joe Onorato}
49