blob: c7654e81e0b17ed2f7138974ec12a650a38db2d7 [file] [log] [blame]
Brad Stenning034a049372018-06-15 15:29:19 -07001/*
2 * Copyright (C) 2018 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.systemui;
18
19import android.content.Context;
Brad Stenning034a049372018-06-15 15:29:19 -070020
21import com.android.internal.widget.LockPatternUtils;
22import com.android.keyguard.ViewMediatorCallback;
Brad Stenning034a049372018-06-15 15:29:19 -070023import com.android.systemui.statusbar.car.CarFacetButtonController;
24import com.android.systemui.statusbar.car.CarStatusBarKeyguardViewManager;
Brad Stenning034a049372018-06-15 15:29:19 -070025import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
Brad Stenning8d1a51c2018-11-20 17:34:16 -080026import com.android.systemui.volume.CarVolumeDialogComponent;
27import com.android.systemui.volume.VolumeDialogComponent;
Brad Stenning034a049372018-06-15 15:29:19 -070028
Jason Monk27d01a622018-12-10 15:57:09 -050029import javax.inject.Singleton;
30
31import dagger.Component;
Jason Monk27d01a622018-12-10 15:57:09 -050032
Brad Stenning034a049372018-06-15 15:29:19 -070033/**
34 * Class factory to provide car specific SystemUI components.
35 */
36public class CarSystemUIFactory extends SystemUIFactory {
37
Jason Monk27d01a622018-12-10 15:57:09 -050038 private CarDependencyComponent mCarDependencyComponent;
39
40 @Override
Govinda Wasserman8d49d0d2019-08-22 16:51:48 -040041 protected SystemUIRootComponent buildSystemUIRootComponent(Context context) {
Jason Monk27d01a622018-12-10 15:57:09 -050042 mCarDependencyComponent = DaggerCarSystemUIFactory_CarDependencyComponent.builder()
43 .contextHolder(new ContextHolder(context))
44 .build();
Govinda Wasserman8d49d0d2019-08-22 16:51:48 -040045 return DaggerCarSystemUIRootComponent.builder()
46 .dependencyProvider(new com.android.systemui.DependencyProvider())
47 .contextHolder(new ContextHolder(context))
48 .build();
Jason Monk27d01a622018-12-10 15:57:09 -050049 }
50
51 public CarDependencyComponent getCarDependencyComponent() {
52 return mCarDependencyComponent;
53 }
54
Brad Stenning034a049372018-06-15 15:29:19 -070055 public StatusBarKeyguardViewManager createStatusBarKeyguardViewManager(Context context,
Adora Zhang0237b9c2019-03-08 12:27:09 -080056 ViewMediatorCallback viewMediatorCallback, LockPatternUtils lockPatternUtils) {
Brad Stenning034a049372018-06-15 15:29:19 -070057 return new CarStatusBarKeyguardViewManager(context, viewMediatorCallback, lockPatternUtils);
58 }
59
Brad Stenning8d1a51c2018-11-20 17:34:16 -080060 public VolumeDialogComponent createVolumeDialogComponent(SystemUI systemUi, Context context) {
61 return new CarVolumeDialogComponent(systemUi, context);
62 }
63
Jason Monk27d01a622018-12-10 15:57:09 -050064 @Singleton
65 @Component(modules = ContextHolder.class)
66 public interface CarDependencyComponent {
67 CarFacetButtonController getCarFacetButtonController();
Brad Stenning034a049372018-06-15 15:29:19 -070068 }
Brad Stenning034a049372018-06-15 15:29:19 -070069}