blob: be4b8897d00b300e1ce01aa1c3ac57473b1bc1b6 [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;
Dave Mankofff4736812019-10-18 17:25:50 -040023import com.android.systemui.dagger.SystemUIRootComponent;
Heemin Seog1a39dea2019-10-16 15:58:21 -070024import com.android.systemui.navigationbar.car.CarFacetButtonController;
Brad Stenning034a049372018-06-15 15:29:19 -070025import com.android.systemui.statusbar.car.CarStatusBarKeyguardViewManager;
Brad Stenning034a049372018-06-15 15:29:19 -070026import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
27
Jason Monk27d01a622018-12-10 15:57:09 -050028import javax.inject.Singleton;
29
30import dagger.Component;
Jason Monk27d01a622018-12-10 15:57:09 -050031
Brad Stenning034a049372018-06-15 15:29:19 -070032/**
33 * Class factory to provide car specific SystemUI components.
34 */
35public class CarSystemUIFactory extends SystemUIFactory {
36
Jason Monk27d01a622018-12-10 15:57:09 -050037 private CarDependencyComponent mCarDependencyComponent;
38
39 @Override
Govinda Wasserman2e86fb62019-08-13 11:35:44 -040040 protected SystemUIRootComponent buildSystemUIRootComponent(Context context) {
Jason Monk27d01a622018-12-10 15:57:09 -050041 mCarDependencyComponent = DaggerCarSystemUIFactory_CarDependencyComponent.builder()
42 .contextHolder(new ContextHolder(context))
43 .build();
Govinda Wasserman2e86fb62019-08-13 11:35:44 -040044 return DaggerCarSystemUIRootComponent.builder()
Govinda Wasserman2e86fb62019-08-13 11:35:44 -040045 .contextHolder(new ContextHolder(context))
46 .build();
Jason Monk27d01a622018-12-10 15:57:09 -050047 }
48
49 public CarDependencyComponent getCarDependencyComponent() {
50 return mCarDependencyComponent;
51 }
52
Brad Stenning034a049372018-06-15 15:29:19 -070053 public StatusBarKeyguardViewManager createStatusBarKeyguardViewManager(Context context,
Adora Zhang0237b9c2019-03-08 12:27:09 -080054 ViewMediatorCallback viewMediatorCallback, LockPatternUtils lockPatternUtils) {
Brad Stenning034a049372018-06-15 15:29:19 -070055 return new CarStatusBarKeyguardViewManager(context, viewMediatorCallback, lockPatternUtils);
56 }
57
Jason Monk27d01a622018-12-10 15:57:09 -050058 @Singleton
59 @Component(modules = ContextHolder.class)
60 public interface CarDependencyComponent {
61 CarFacetButtonController getCarFacetButtonController();
Brad Stenning034a049372018-06-15 15:29:19 -070062 }
Brad Stenning034a049372018-06-15 15:29:19 -070063}