1 /*
2  * Copyright (C) 2024 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.keyguard
18 
19 import android.view.MotionEvent
20 import com.android.systemui.dagger.SysUISingleton
21 import com.android.systemui.keyguard.ui.view.KeyguardRootView
22 import com.android.systemui.res.R
23 import dagger.Lazy
24 import javax.inject.Inject
25 
26 /**
27  * Lock icon view logic now lives in DeviceEntryIconViewBinder and ViewModels. Icon is positioned in
28  * [com.android.systemui.keyguard.ui.view.layout.sections.DefaultDeviceEntrySection].
29  *
30  * This class is to bridge the gap between the logic when the DeviceEntryUdfpsRefactor is enabled
31  * and the KeyguardBottomAreaRefactor is NOT enabled. This class can and should be removed when both
32  * flags are enabled.
33  */
34 @SysUISingleton
35 class EmptyLockIconViewController
36 @Inject
37 constructor(
38     private val keyguardRootView: Lazy<KeyguardRootView>,
39 ) : LockIconViewController {
40     private val deviceEntryIconViewId = R.id.device_entry_icon_view
setLockIconViewnull41     override fun setLockIconView(lockIconView: LockIconView) {
42         // no-op
43     }
44 
getTopnull45     override fun getTop(): Float {
46         return keyguardRootView.get().getViewById(deviceEntryIconViewId)?.top?.toFloat() ?: 0f
47     }
48 
getBottomnull49     override fun getBottom(): Float {
50         return keyguardRootView.get().getViewById(deviceEntryIconViewId)?.bottom?.toFloat() ?: 0f
51     }
52 
dozeTimeTicknull53     override fun dozeTimeTick() {
54         // no-op
55     }
56 
setAlphanull57     override fun setAlpha(alpha: Float) {
58         // no-op
59     }
60 
willHandleTouchWhileDozingnull61     override fun willHandleTouchWhileDozing(event: MotionEvent): Boolean {
62         return false
63     }
64 }
65