1 /* 2 * Copyright (C) 2020 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.systemui.car.volume; 18 19 import android.content.Context; 20 21 import com.android.systemui.car.CarServiceProvider; 22 import com.android.systemui.dagger.SysUISingleton; 23 import com.android.systemui.demomode.DemoModeController; 24 import com.android.systemui.keyguard.KeyguardViewMediator; 25 import com.android.systemui.plugins.VolumeDialog; 26 import com.android.systemui.volume.VolumeDialogComponent; 27 import com.android.systemui.volume.VolumeDialogControllerImpl; 28 29 import javax.inject.Inject; 30 31 /** 32 * Allows for adding car specific dialog when the volume dialog is created. 33 */ 34 @SysUISingleton 35 public class CarVolumeDialogComponent extends VolumeDialogComponent { 36 37 private CarVolumeDialogImpl mCarVolumeDialog; 38 39 @Inject CarVolumeDialogComponent(Context context, KeyguardViewMediator keyguardViewMediator, VolumeDialogControllerImpl volumeDialogController, DemoModeController demoModeController, CarServiceProvider carServiceProvider)40 public CarVolumeDialogComponent(Context context, KeyguardViewMediator keyguardViewMediator, 41 VolumeDialogControllerImpl volumeDialogController, 42 DemoModeController demoModeController, 43 CarServiceProvider carServiceProvider) { 44 super(context, keyguardViewMediator, volumeDialogController, demoModeController); 45 mCarVolumeDialog.setCarServiceProvider(carServiceProvider); 46 } 47 48 /** This method is called while calling the super constructor. */ 49 @Override createDefault()50 protected VolumeDialog createDefault() { 51 mCarVolumeDialog = new CarVolumeDialogImpl(mContext); 52 return mCarVolumeDialog; 53 } 54 } 55