Brad Stenning | 034a04937 | 2018-06-15 15:29:19 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.systemui; |
| 18 | |
| 19 | import android.content.Context; |
Brad Stenning | 034a04937 | 2018-06-15 15:29:19 -0700 | [diff] [blame] | 20 | |
| 21 | import com.android.internal.widget.LockPatternUtils; |
| 22 | import com.android.keyguard.ViewMediatorCallback; |
Dave Mankoff | f473681 | 2019-10-18 17:25:50 -0400 | [diff] [blame^] | 23 | import com.android.systemui.dagger.SystemUIRootComponent; |
Heemin Seog | 1a39dea | 2019-10-16 15:58:21 -0700 | [diff] [blame] | 24 | import com.android.systemui.navigationbar.car.CarFacetButtonController; |
Brad Stenning | 034a04937 | 2018-06-15 15:29:19 -0700 | [diff] [blame] | 25 | import com.android.systemui.statusbar.car.CarStatusBarKeyguardViewManager; |
Brad Stenning | 034a04937 | 2018-06-15 15:29:19 -0700 | [diff] [blame] | 26 | import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; |
| 27 | |
Jason Monk | 27d01a62 | 2018-12-10 15:57:09 -0500 | [diff] [blame] | 28 | import javax.inject.Singleton; |
| 29 | |
| 30 | import dagger.Component; |
Jason Monk | 27d01a62 | 2018-12-10 15:57:09 -0500 | [diff] [blame] | 31 | |
Brad Stenning | 034a04937 | 2018-06-15 15:29:19 -0700 | [diff] [blame] | 32 | /** |
| 33 | * Class factory to provide car specific SystemUI components. |
| 34 | */ |
| 35 | public class CarSystemUIFactory extends SystemUIFactory { |
| 36 | |
Jason Monk | 27d01a62 | 2018-12-10 15:57:09 -0500 | [diff] [blame] | 37 | private CarDependencyComponent mCarDependencyComponent; |
| 38 | |
| 39 | @Override |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 40 | protected SystemUIRootComponent buildSystemUIRootComponent(Context context) { |
Jason Monk | 27d01a62 | 2018-12-10 15:57:09 -0500 | [diff] [blame] | 41 | mCarDependencyComponent = DaggerCarSystemUIFactory_CarDependencyComponent.builder() |
| 42 | .contextHolder(new ContextHolder(context)) |
| 43 | .build(); |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 44 | return DaggerCarSystemUIRootComponent.builder() |
Govinda Wasserman | 2e86fb6 | 2019-08-13 11:35:44 -0400 | [diff] [blame] | 45 | .contextHolder(new ContextHolder(context)) |
| 46 | .build(); |
Jason Monk | 27d01a62 | 2018-12-10 15:57:09 -0500 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | public CarDependencyComponent getCarDependencyComponent() { |
| 50 | return mCarDependencyComponent; |
| 51 | } |
| 52 | |
Brad Stenning | 034a04937 | 2018-06-15 15:29:19 -0700 | [diff] [blame] | 53 | public StatusBarKeyguardViewManager createStatusBarKeyguardViewManager(Context context, |
Adora Zhang | 0237b9c | 2019-03-08 12:27:09 -0800 | [diff] [blame] | 54 | ViewMediatorCallback viewMediatorCallback, LockPatternUtils lockPatternUtils) { |
Brad Stenning | 034a04937 | 2018-06-15 15:29:19 -0700 | [diff] [blame] | 55 | return new CarStatusBarKeyguardViewManager(context, viewMediatorCallback, lockPatternUtils); |
| 56 | } |
| 57 | |
Jason Monk | 27d01a62 | 2018-12-10 15:57:09 -0500 | [diff] [blame] | 58 | @Singleton |
| 59 | @Component(modules = ContextHolder.class) |
| 60 | public interface CarDependencyComponent { |
| 61 | CarFacetButtonController getCarFacetButtonController(); |
Brad Stenning | 034a04937 | 2018-06-15 15:29:19 -0700 | [diff] [blame] | 62 | } |
Brad Stenning | 034a04937 | 2018-06-15 15:29:19 -0700 | [diff] [blame] | 63 | } |