1/*
2 * Copyright (C) 2017 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
17package com.android.settingslib.bluetooth;
18
19import android.bluetooth.BluetoothA2dp;
20import android.bluetooth.BluetoothCodecStatus;
21import android.bluetooth.BluetoothDevice;
22
23/**
24 * This interface replicates some methods of android.bluetooth.BluetoothA2dp that are new and not
25 * yet available in our current version of  Robolectric. It provides a thin wrapper to call the real
26 * methods in production and a mock in tests.
27 */
28public interface BluetoothA2dpWrapper {
29
30    static interface Factory {
31        BluetoothA2dpWrapper getInstance(BluetoothA2dp service);
32    }
33
34    /**
35     * @return the real {@code BluetoothA2dp} object
36     */
37    BluetoothA2dp getService();
38
39    /**
40     * Wraps {@code BluetoothA2dp.getCodecStatus}
41     */
42    public BluetoothCodecStatus getCodecStatus();
43
44    /**
45     * Wraps {@code BluetoothA2dp.supportsOptionalCodecs}
46     */
47    int supportsOptionalCodecs(BluetoothDevice device);
48
49    /**
50     * Wraps {@code BluetoothA2dp.getOptionalCodecsEnabled}
51     */
52    int getOptionalCodecsEnabled(BluetoothDevice device);
53
54    /**
55     * Wraps {@code BluetoothA2dp.setOptionalCodecsEnabled}
56     */
57    void setOptionalCodecsEnabled(BluetoothDevice device, int value);
58}
59