• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 package com.android.settingslib.bluetooth;
18 
19 import android.bluetooth.BluetoothA2dp;
20 import android.bluetooth.BluetoothCodecStatus;
21 import android.bluetooth.BluetoothDevice;
22 
23 public class BluetoothA2dpWrapperImpl implements BluetoothA2dpWrapper {
24 
25     public static class Factory implements BluetoothA2dpWrapper.Factory {
26         @Override
getInstance(BluetoothA2dp service)27         public BluetoothA2dpWrapper getInstance(BluetoothA2dp service) {
28             return new BluetoothA2dpWrapperImpl(service);
29         }
30     }
31 
32     private BluetoothA2dp mService;
33 
BluetoothA2dpWrapperImpl(BluetoothA2dp service)34     public BluetoothA2dpWrapperImpl(BluetoothA2dp service) {
35         mService = service;
36     }
37 
38     @Override
getService()39     public BluetoothA2dp getService() {
40         return mService;
41     }
42 
43     @Override
getCodecStatus()44     public BluetoothCodecStatus getCodecStatus() {
45         return mService.getCodecStatus();
46     }
47 
48     @Override
supportsOptionalCodecs(BluetoothDevice device)49     public int supportsOptionalCodecs(BluetoothDevice device) {
50         return mService.supportsOptionalCodecs(device);
51     }
52 
53     @Override
getOptionalCodecsEnabled(BluetoothDevice device)54     public int getOptionalCodecsEnabled(BluetoothDevice device) {
55         return mService.getOptionalCodecsEnabled(device);
56     }
57 
58     @Override
setOptionalCodecsEnabled(BluetoothDevice device, int value)59     public void setOptionalCodecsEnabled(BluetoothDevice device, int value) {
60         mService.setOptionalCodecsEnabled(device, value);
61     }
62 }
63