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.systemui.navigationbar;
18 
19 import androidx.annotation.Nullable;
20 
21 import com.android.internal.statusbar.RegisterStatusBarResult;
22 import com.android.systemui.statusbar.phone.BarTransitions;
23 
24 /** A controller to handle navigation bars. */
25 public interface NavigationBarController {
26     /**
27      * Creates navigation bars when car/status bar initializes.
28      * <p>
29      * TODO(b/117478341): I use {@code includeDefaultDisplay} to make this method compatible to
30      * CarStatusBar because they have their own nav bar. Think about a better way for it.
31      *
32      * @param includeDefaultDisplay {@code true} to create navigation bar on default display.
33      */
createNavigationBars( boolean includeDefaultDisplay, RegisterStatusBarResult result)34     void createNavigationBars(
35             boolean includeDefaultDisplay,
36             RegisterStatusBarResult result);
37 
38     /** Removes the navigation bar for the given display ID. */
removeNavigationBar(int displayId)39     void removeNavigationBar(int displayId);
40 
41     /** @see NavigationBar#checkNavBarModes() */
checkNavBarModes(int displayId)42     void checkNavBarModes(int displayId);
43 
44     /** @see NavigationBar#finishBarAnimations() */
finishBarAnimations(int displayId)45     void finishBarAnimations(int displayId);
46 
47     /** @see NavigationBar#touchAutoDim() */
touchAutoDim(int displayId)48     void touchAutoDim(int displayId);
49 
50     /** @see NavigationBar#transitionTo(int, boolean) */
transitionTo(int displayId, @BarTransitions.TransitionMode int barMode, boolean animate)51     void transitionTo(int displayId, @BarTransitions.TransitionMode int barMode, boolean animate);
52 
53     /** @see NavigationBar#disableAnimationsDuringHide(long) */
disableAnimationsDuringHide(int displayId, long delay)54     void disableAnimationsDuringHide(int displayId, long delay);
55 
56     /** @return {@link NavigationBarView} on the default display. */
57     @Nullable
getDefaultNavigationBarView()58     NavigationBarView getDefaultNavigationBarView();
59 
60     /**
61      * @param displayId the ID of display which Navigation bar is on
62      * @return {@link NavigationBarView} on the display with {@code displayId}.
63      *         {@code null} if no navigation bar on that display.
64      */
65     @Nullable
getNavigationBarView(int displayId)66     NavigationBarView getNavigationBarView(int displayId);
67 
isOverviewEnabled(int displayId)68     boolean isOverviewEnabled(int displayId);
69 
70     /** @return {@link NavigationBar} on the default display. */
71     @Nullable
getDefaultNavigationBar()72     NavigationBar getDefaultNavigationBar();
73 }
74