1 /**
2  * Copyright (c) 2013, 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.server.statusbar;
18 
19 import android.annotation.Nullable;
20 import android.app.ITransientNotificationCallback;
21 import android.os.Bundle;
22 import android.os.IBinder;
23 import android.view.InsetsState.InternalInsetsType;
24 import android.view.WindowInsetsController.Appearance;
25 
26 import com.android.internal.view.AppearanceRegion;
27 import com.android.server.notification.NotificationDelegate;
28 
29 public interface StatusBarManagerInternal {
setNotificationDelegate(NotificationDelegate delegate)30     void setNotificationDelegate(NotificationDelegate delegate);
showScreenPinningRequest(int taskId)31     void showScreenPinningRequest(int taskId);
showAssistDisclosure()32     void showAssistDisclosure();
33 
preloadRecentApps()34     void preloadRecentApps();
35 
cancelPreloadRecentApps()36     void cancelPreloadRecentApps();
37 
showRecentApps(boolean triggeredFromAltTab)38     void showRecentApps(boolean triggeredFromAltTab);
39 
hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey)40     void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey);
41 
dismissKeyboardShortcutsMenu()42     void dismissKeyboardShortcutsMenu();
toggleKeyboardShortcutsMenu(int deviceId)43     void toggleKeyboardShortcutsMenu(int deviceId);
44 
showChargingAnimation(int batteryLevel)45     void showChargingAnimation(int batteryLevel);
46 
47     /**
48      * Show picture-in-picture menu.
49      */
showPictureInPictureMenu()50     void showPictureInPictureMenu();
51 
setWindowState(int displayId, int window, int state)52     void setWindowState(int displayId, int window, int state);
53 
54     /**
55      * Notifies the status bar that an app transition is pending to delay applying some flags with
56      * visual impact until {@link #appTransitionReady} is called.
57      *
58      * @param displayId the ID of the display which has this event.
59      */
appTransitionPending(int displayId)60     void appTransitionPending(int displayId);
61 
62     /**
63      * Notifies the status bar that a pending app transition has been cancelled.
64      *
65      * @param displayId the ID of the display which has this event.
66      */
appTransitionCancelled(int displayId)67     void appTransitionCancelled(int displayId);
68 
69     /**
70      * Notifies the status bar that an app transition is now being executed.
71      *
72      * @param displayId the ID of the display which has this event.
73      * @param statusBarAnimationsStartTime the desired start time for all visual animations in the
74      *        status bar caused by this app transition in uptime millis
75      * @param statusBarAnimationsDuration the duration for all visual animations in the status
76      *        bar caused by this app transition in millis
77      */
appTransitionStarting(int displayId, long statusBarAnimationsStartTime, long statusBarAnimationsDuration)78     void appTransitionStarting(int displayId, long statusBarAnimationsStartTime,
79             long statusBarAnimationsDuration);
80 
startAssist(Bundle args)81     void startAssist(Bundle args);
onCameraLaunchGestureDetected(int source)82     void onCameraLaunchGestureDetected(int source);
topAppWindowChanged(int displayId, boolean isFullscreen, boolean isImmersive)83     void topAppWindowChanged(int displayId, boolean isFullscreen, boolean isImmersive);
setDisableFlags(int displayId, int flags, String cause)84     void setDisableFlags(int displayId, int flags, String cause);
toggleSplitScreen()85     void toggleSplitScreen();
appTransitionFinished(int displayId)86     void appTransitionFinished(int displayId);
87 
toggleRecentApps()88     void toggleRecentApps();
89 
setCurrentUser(int newUserId)90     void setCurrentUser(int newUserId);
91 
92     /**
93      * Set whether the top app currently hides the statusbar.
94      *
95      * @param hidesStatusBar whether it is being hidden
96      */
setTopAppHidesStatusBar(boolean hidesStatusBar)97     void setTopAppHidesStatusBar(boolean hidesStatusBar);
98 
showShutdownUi(boolean isReboot, String requestString)99     boolean showShutdownUi(boolean isReboot, String requestString);
100 
101     /**
102      * Show a rotation suggestion that a user may approve to rotate the screen.
103      *
104      * @param rotation rotation suggestion
105      */
onProposedRotationChanged(int rotation, boolean isValid)106     void onProposedRotationChanged(int rotation, boolean isValid);
107 
108     /**
109      * Notifies System UI that the display is ready to show system decorations.
110      *
111      * @param displayId display ID
112      */
onDisplayReady(int displayId)113     void onDisplayReady(int displayId);
114 
115     /**
116      * Notifies System UI whether the recents animation is running.
117      */
onRecentsAnimationStateChanged(boolean running)118     void onRecentsAnimationStateChanged(boolean running);
119 
120     /** @see com.android.internal.statusbar.IStatusBar#onSystemBarAppearanceChanged */
onSystemBarAppearanceChanged(int displayId, @Appearance int appearance, AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme)121     void onSystemBarAppearanceChanged(int displayId, @Appearance int appearance,
122             AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme);
123 
124     /** @see com.android.internal.statusbar.IStatusBar#showTransient */
showTransient(int displayId, @InternalInsetsType int[] types)125     void showTransient(int displayId, @InternalInsetsType int[] types);
126 
127     /** @see com.android.internal.statusbar.IStatusBar#abortTransient */
abortTransient(int displayId, @InternalInsetsType int[] types)128     void abortTransient(int displayId, @InternalInsetsType int[] types);
129 
130     /**
131      * @see com.android.internal.statusbar.IStatusBar#showToast(String, IBinder, CharSequence,
132      * IBinder, int, ITransientNotificationCallback)
133      */
showToast(int uid, String packageName, IBinder token, CharSequence text, IBinder windowToken, int duration, @Nullable ITransientNotificationCallback textCallback)134     void showToast(int uid, String packageName, IBinder token, CharSequence text,
135             IBinder windowToken, int duration,
136             @Nullable ITransientNotificationCallback textCallback);
137 
138     /** @see com.android.internal.statusbar.IStatusBar#hideToast(String, IBinder)  */
hideToast(String packageName, IBinder token)139     void hideToast(String packageName, IBinder token);
140 }
141