1 /* 2 * Copyright (C) 2018 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.settings.bluetooth; 18 19 import android.bluetooth.BluetoothDevice; 20 import android.content.ComponentName; 21 import android.content.Context; 22 import android.media.Spatializer; 23 import android.net.Uri; 24 25 import androidx.preference.Preference; 26 27 import com.android.settingslib.bluetooth.CachedBluetoothDevice; 28 29 import java.util.List; 30 import java.util.Set; 31 32 /** 33 * Provider for bluetooth related features. 34 */ 35 public interface BluetoothFeatureProvider { 36 37 /** 38 * Gets the {@link Uri} that represents extra settings for a specific bluetooth device 39 * 40 * @param bluetoothDevice bluetooth device 41 * @return {@link Uri} for extra settings 42 */ getBluetoothDeviceSettingsUri(BluetoothDevice bluetoothDevice)43 Uri getBluetoothDeviceSettingsUri(BluetoothDevice bluetoothDevice); 44 45 /** 46 * Gets the {@link Uri} that represents extra control for a specific bluetooth device 47 * 48 * @param bluetoothDevice bluetooth device 49 * @return {@link String} uri string for extra control 50 */ getBluetoothDeviceControlUri(BluetoothDevice bluetoothDevice)51 String getBluetoothDeviceControlUri(BluetoothDevice bluetoothDevice); 52 53 /** 54 * Gets the {@link ComponentName} of services or activities that need to be shown in related 55 * tools. 56 * 57 * @return list of {@link ComponentName} 58 */ getRelatedTools()59 List<ComponentName> getRelatedTools(); 60 61 /** 62 * Gets the instance of {@link Spatializer}. 63 * 64 * @param context Context 65 * @return the Spatializer instance 66 */ getSpatializer(Context context)67 Spatializer getSpatializer(Context context); 68 69 /** 70 * Gets bluetooth device extra options 71 * 72 * @param context Context 73 * @param device the bluetooth device 74 * @return the extra bluetooth preference list 75 */ getBluetoothExtraOptions(Context context, CachedBluetoothDevice device)76 List<Preference> getBluetoothExtraOptions(Context context, CachedBluetoothDevice device); 77 78 /** 79 * Gets the bluetooth profile preference keys which should be hidden in the device details page. 80 * 81 * @param context Context 82 * @param bluetoothDevice the bluetooth device 83 * @return the profiles which should be hidden 84 */ getInvisibleProfilePreferenceKeys( Context context, BluetoothDevice bluetoothDevice)85 Set<String> getInvisibleProfilePreferenceKeys( 86 Context context, BluetoothDevice bluetoothDevice); 87 } 88