1 /* 2 * Copyright (C) 2022 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 package android.car.oem; 17 18 import android.annotation.NonNull; 19 import android.media.AudioAttributes; 20 21 import java.io.PrintWriter; 22 import java.util.List; 23 24 /** 25 * This code will be running as part of the OEM Service. This implements 26 * {@code IOemCarAudioDuckingService} as hidden class. It is exposed as IBinder from {@link 27 * OemCarService#getOemAudioDuckingService()} 28 * 29 * @hide 30 */ 31 final class OemCarAudioDuckingServiceImpl extends IOemCarAudioDuckingService.Stub 32 implements OemCarServiceComponent { 33 34 private final OemCarAudioDuckingService mOemCarAudioDuckingService; 35 OemCarAudioDuckingServiceImpl(@onNull OemCarAudioDuckingService oemCarAudioDuckingService)36 OemCarAudioDuckingServiceImpl(@NonNull OemCarAudioDuckingService oemCarAudioDuckingService) { 37 mOemCarAudioDuckingService = oemCarAudioDuckingService; 38 } 39 40 @Override 41 @NonNull evaluateAttributesToDuck( @onNull OemCarAudioVolumeRequest request)42 public List<AudioAttributes> evaluateAttributesToDuck( 43 @NonNull OemCarAudioVolumeRequest request) { 44 return mOemCarAudioDuckingService.evaluateAttributesToDuck(request); 45 } 46 47 @Override init()48 public void init() { 49 mOemCarAudioDuckingService.init(); 50 } 51 52 @Override release()53 public void release() { 54 mOemCarAudioDuckingService.release(); 55 } 56 57 @Override dump(PrintWriter writer, String[] args)58 public void dump(PrintWriter writer, String[] args) { 59 mOemCarAudioDuckingService.dump(writer, args); 60 } 61 62 @Override onCarServiceReady()63 public void onCarServiceReady() { 64 mOemCarAudioDuckingService.onCarServiceReady(); 65 } 66 } 67