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.back;
18 
19 import android.content.res.Configuration;
20 import android.window.BackNavigationInfo;
21 
22 import javax.inject.Qualifier;
23 
24 /** Base class for all back animations. */
25 public abstract class ShellBackAnimation {
26     @Qualifier
27     public @interface CrossActivity {}
28 
29     @Qualifier
30     public @interface CrossTask {}
31 
32     @Qualifier
33     public @interface CustomizeActivity {}
34 
35     @Qualifier
36     public @interface ReturnToHome {}
37 
38     @Qualifier
39     public @interface DialogClose {}
40 
41     /** Retrieve the {@link BackAnimationRunner} associated with this animation. */
getRunner()42     public abstract BackAnimationRunner getRunner();
43 
44     /**
45      * Prepare the next animation.
46      *
47      * @return true if this type of back animation should override the default.
48      */
prepareNextAnimation(BackNavigationInfo.CustomAnimationInfo animationInfo, int letterboxColor)49     public boolean prepareNextAnimation(BackNavigationInfo.CustomAnimationInfo animationInfo,
50             int letterboxColor) {
51         return false;
52     }
53 
onConfigurationChanged(Configuration newConfig)54     void onConfigurationChanged(Configuration newConfig) {
55 
56     }
57 }
58