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 package com.android.systemui.shade.domain.interactor 17 18 import kotlinx.coroutines.flow.StateFlow 19 20 /** Allows the lockscreen to control the shade. */ 21 interface ShadeLockscreenInteractor { 22 23 /** Amount shade has expanded with regard to the UDFPS location */ 24 val udfpsTransitionToFullShadeProgress: StateFlow<Float> 25 26 /** 27 * Expand shade so that notifications are visible. Non-split shade: just expanding shade or 28 * collapsing QS when they're expanded. Split shade: only expanding shade, notifications are 29 * always visible 30 * 31 * Called when `adb shell cmd statusbar expand-notifications` is executed. 32 */ expandToNotificationsnull33 @Deprecated("Use ShadeInteractor instead") fun expandToNotifications() 34 35 /** 36 * Returns whether the shade height is greater than zero (i.e. partially or fully expanded), 37 * there is a HUN, the shade is animating, or the shade is instantly expanding. 38 */ 39 @Deprecated("Use ShadeInteractor instead") val isExpanded: Boolean 40 41 /** Called before animating Keyguard dismissal, i.e. the animation dismissing the bouncer. */ 42 fun startBouncerPreHideAnimation() 43 44 /** Called once every minute while dozing. */ 45 fun dozeTimeTick() 46 47 /** 48 * Do not let the user drag the shade up and down for the current touch session. This is 49 * necessary to avoid shade expansion while/after the bouncer is dismissed. 50 */ 51 @Deprecated("Not supported by scenes") fun blockExpansionForCurrentTouch() 52 53 /** Close guts, notification menus, and QS. Set scroll and overscroll to 0. */ 54 fun resetViews(animate: Boolean) 55 56 /** Sets whether the screen has temporarily woken up to display notifications. */ 57 @Deprecated("Not supported by scenes") fun setPulsing(pulsing: Boolean) 58 59 /** Animate to expanded shade after a delay in ms. Used for lockscreen to shade transition. */ 60 fun transitionToExpandedShade(delay: Long) 61 62 /** @see ViewGroupFadeHelper.reset */ 63 @Deprecated("Not supported by scenes") fun resetViewGroupFade() 64 65 /** 66 * Set the alpha and translationY of the keyguard elements which only show on the lockscreen, 67 * but not in shade locked / shade. This is used when dragging down to the full shade. 68 */ 69 @Deprecated("Not supported by scenes") 70 fun setKeyguardTransitionProgress(keyguardAlpha: Float, keyguardTranslationY: Int) 71 72 /** Sets the overstretch amount in raw pixels when dragging down. */ 73 @Deprecated("Not supported by scenes") fun setOverStretchAmount(amount: Float) 74 75 /** 76 * Sets the alpha value to be set on the keyguard status bar. 77 * 78 * @param alpha value between 0 and 1. -1 if the value is to be reset. 79 */ 80 @Deprecated("TODO(b/325072511) delete this") fun setKeyguardStatusBarAlpha(alpha: Float) 81 82 /** 83 * Reconfigures the shade to show the AOD UI (clock, smartspace, etc). This is called by the 84 * screen off animation controller in order to animate in AOD without "actually" fully switching 85 * to the KEYGUARD state, which is a heavy transition that causes jank as 10+ files react to the 86 * change. 87 */ 88 fun showAodUi() 89 } 90