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.bluetooth.btservice; 18 19 import com.android.bluetooth.a2dp.A2dpService; 20 import com.android.bluetooth.avrcp.AvrcpTargetService; 21 import com.android.bluetooth.bas.BatteryService; 22 import com.android.bluetooth.bass_client.BassClientService; 23 import com.android.bluetooth.csip.CsipSetCoordinatorService; 24 import com.android.bluetooth.hap.HapClientService; 25 import com.android.bluetooth.hearingaid.HearingAidService; 26 import com.android.bluetooth.hfp.HeadsetService; 27 import com.android.bluetooth.hid.HidDeviceService; 28 import com.android.bluetooth.hid.HidHostService; 29 import com.android.bluetooth.le_audio.LeAudioService; 30 import com.android.bluetooth.mcp.McpService; 31 import com.android.bluetooth.pan.PanService; 32 import com.android.bluetooth.tbs.TbsService; 33 import com.android.bluetooth.vc.VolumeControlService; 34 35 // Factory class to create instances of static services. Useful in mocking the service objects. 36 public class ServiceFactory { getA2dpService()37 public A2dpService getA2dpService() { 38 return A2dpService.getA2dpService(); 39 } 40 getCsipSetCoordinatorService()41 public CsipSetCoordinatorService getCsipSetCoordinatorService() { 42 return CsipSetCoordinatorService.getCsipSetCoordinatorService(); 43 } 44 getHeadsetService()45 public HeadsetService getHeadsetService() { 46 return HeadsetService.getHeadsetService(); 47 } 48 getHidHostService()49 public HidHostService getHidHostService() { 50 return HidHostService.getHidHostService(); 51 } 52 getHidDeviceService()53 public HidDeviceService getHidDeviceService() { 54 return HidDeviceService.getHidDeviceService(); 55 } 56 getPanService()57 public PanService getPanService() { 58 return PanService.getPanService(); 59 } 60 getHearingAidService()61 public HearingAidService getHearingAidService() { 62 return HearingAidService.getHearingAidService(); 63 } 64 getLeAudioService()65 public LeAudioService getLeAudioService() { 66 return LeAudioService.getLeAudioService(); 67 } 68 getAvrcpTargetService()69 public AvrcpTargetService getAvrcpTargetService() { 70 return AvrcpTargetService.get(); 71 } 72 getMcpService()73 public McpService getMcpService() { 74 return McpService.getMcpService(); 75 } 76 getTbsService()77 public TbsService getTbsService() { 78 return TbsService.getTbsService(); 79 } 80 getVolumeControlService()81 public VolumeControlService getVolumeControlService() { 82 return VolumeControlService.getVolumeControlService(); 83 } 84 getHapClientService()85 public HapClientService getHapClientService() { 86 return HapClientService.getHapClientService(); 87 } 88 getBassClientService()89 public BassClientService getBassClientService() { 90 return BassClientService.getBassClientService(); 91 } 92 getBatteryService()93 public BatteryService getBatteryService() { 94 return BatteryService.getBatteryService(); 95 } 96 } 97