1 /* 2 * Copyright (C) 2014 The Android Open Source Project 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 19 import android.bluetooth.BluetoothAdapter; 20 21 import com.android.settingslib.bluetooth.CachedBluetoothDevice; 22 import com.android.systemui.Dumpable; 23 import com.android.systemui.statusbar.policy.BluetoothController.Callback; 24 25 import java.util.List; 26 import java.util.concurrent.Executor; 27 28 public interface BluetoothController extends CallbackController<Callback>, Dumpable { isBluetoothSupported()29 boolean isBluetoothSupported(); isBluetoothEnabled()30 boolean isBluetoothEnabled(); 31 getBluetoothState()32 int getBluetoothState(); 33 isBluetoothConnected()34 boolean isBluetoothConnected(); isBluetoothConnecting()35 boolean isBluetoothConnecting(); isBluetoothAudioProfileOnly()36 boolean isBluetoothAudioProfileOnly(); isBluetoothAudioActive()37 boolean isBluetoothAudioActive(); getConnectedDeviceName()38 String getConnectedDeviceName(); setBluetoothEnabled(boolean enabled)39 void setBluetoothEnabled(boolean enabled); 40 canConfigBluetooth()41 boolean canConfigBluetooth(); 42 getConnectedDevices()43 List<CachedBluetoothDevice> getConnectedDevices(); 44 addOnMetadataChangedListener(CachedBluetoothDevice device, Executor executor, BluetoothAdapter.OnMetadataChangedListener listener)45 void addOnMetadataChangedListener(CachedBluetoothDevice device, Executor executor, 46 BluetoothAdapter.OnMetadataChangedListener listener); removeOnMetadataChangedListener(CachedBluetoothDevice device, BluetoothAdapter.OnMetadataChangedListener listener)47 void removeOnMetadataChangedListener(CachedBluetoothDevice device, 48 BluetoothAdapter.OnMetadataChangedListener listener); 49 50 public interface Callback { onBluetoothStateChange(boolean enabled)51 void onBluetoothStateChange(boolean enabled); onBluetoothDevicesChanged()52 void onBluetoothDevicesChanged(); 53 } 54 } 55