1 /*
2  * Copyright (C) 2023 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.wm.shell.keyguard;
18 
19 import android.annotation.NonNull;
20 import android.window.IRemoteTransition;
21 
22 import com.android.wm.shell.shared.annotations.ExternalThread;
23 
24 /**
25  * Interface exposed to SystemUI Keyguard to register handlers for running
26  * animations on keyguard visibility changes.
27  *
28  * TODO(b/274954192): Merge the occludeTransition and occludeByDream handlers and just let the
29  * keyguard handler make the decision on which version it wants to play.
30  */
31 @ExternalThread
32 public interface KeyguardTransitions {
33     /**
34      * Registers a set of remote transitions for Keyguard.
35      */
register( @onNull IRemoteTransition unlockTransition, @NonNull IRemoteTransition appearTransition, @NonNull IRemoteTransition occludeTransition, @NonNull IRemoteTransition occludeByDreamTransition, @NonNull IRemoteTransition unoccludeTransition)36     default void register(
37             @NonNull IRemoteTransition unlockTransition,
38             @NonNull IRemoteTransition appearTransition,
39             @NonNull IRemoteTransition occludeTransition,
40             @NonNull IRemoteTransition occludeByDreamTransition,
41             @NonNull IRemoteTransition unoccludeTransition) {}
42 
43     /**
44      * Notify whether keyguard has created a remote animation runner for next app launch.
45      */
setLaunchingActivityOverLockscreen(boolean isLaunchingActivityOverLockscreen)46     default void setLaunchingActivityOverLockscreen(boolean isLaunchingActivityOverLockscreen) {}
47 }
48