• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.content.ComponentName;
22 import android.hardware.fingerprint.IUdfpsRefreshRateRequestCallback;
23 import android.inputmethodservice.InputMethodService.BackDispositionMode;
24 import android.inputmethodservice.InputMethodService.ImeWindowVisibility;
25 import android.os.Bundle;
26 import android.os.IBinder;
27 import android.os.UserHandle;
28 import android.view.WindowInsets.Type.InsetsType;
29 import android.view.WindowInsetsController.Appearance;
30 import android.view.WindowInsetsController.Behavior;
31 
32 import com.android.internal.statusbar.LetterboxDetails;
33 import com.android.internal.view.AppearanceRegion;
34 import com.android.server.notification.NotificationDelegate;
35 
36 import java.io.FileDescriptor;
37 
38 public interface StatusBarManagerInternal {
setNotificationDelegate(NotificationDelegate delegate)39     void setNotificationDelegate(NotificationDelegate delegate);
40     /** Show a screen pinning request for a specific task. */
showScreenPinningRequest(int taskId, int userId)41     void showScreenPinningRequest(int taskId, int userId);
showAssistDisclosure()42     void showAssistDisclosure();
43 
preloadRecentApps()44     void preloadRecentApps();
45 
cancelPreloadRecentApps()46     void cancelPreloadRecentApps();
47 
showRecentApps(boolean triggeredFromAltTab)48     void showRecentApps(boolean triggeredFromAltTab);
49 
hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey)50     void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey);
51 
52     /** Collapses the notification shade. */
collapsePanels()53     void collapsePanels();
54 
dismissKeyboardShortcutsMenu()55     void dismissKeyboardShortcutsMenu();
toggleKeyboardShortcutsMenu(int deviceId)56     void toggleKeyboardShortcutsMenu(int deviceId);
57 
58     /**
59      * Sets the new IME window status.
60      *
61      * @param displayId The id of the display to which the IME is bound.
62      * @param vis The IME window visibility.
63      * @param backDisposition The IME back disposition mode.
64      * @param showImeSwitcher Whether the IME Switcher button should be shown.
65      */
setImeWindowStatus(int displayId, @ImeWindowVisibility int vis, @BackDispositionMode int backDisposition, boolean showImeSwitcher)66     void setImeWindowStatus(int displayId, @ImeWindowVisibility int vis,
67             @BackDispositionMode int backDisposition, boolean showImeSwitcher);
68 
69     /**
70      * See {@link android.app.StatusBarManager#setIcon(String, int, int, String)}.
71      */
setIcon(String slot, String iconPackage, int iconId, int iconLevel, String contentDescription)72     void setIcon(String slot, String iconPackage, int iconId, int iconLevel,
73             String contentDescription);
74 
75     /**
76      * See {@link android.app.StatusBarManager#setIconVisibility(String, boolean)}.
77      */
setIconVisibility(String slot, boolean visibility)78     void setIconVisibility(String slot, boolean visibility);
79 
showChargingAnimation(int batteryLevel)80     void showChargingAnimation(int batteryLevel);
81 
82     /**
83      * Show picture-in-picture menu.
84      */
showPictureInPictureMenu()85     void showPictureInPictureMenu();
86 
setWindowState(int displayId, int window, int state)87     void setWindowState(int displayId, int window, int state);
88 
89     /**
90      * Notifies the status bar that an app transition is pending to delay applying some flags with
91      * visual impact until {@link #appTransitionReady} is called.
92      *
93      * @param displayId the ID of the display which has this event.
94      */
appTransitionPending(int displayId)95     void appTransitionPending(int displayId);
96 
97     /**
98      * Notifies the status bar that a pending app transition has been cancelled.
99      *
100      * @param displayId the ID of the display which has this event.
101      */
appTransitionCancelled(int displayId)102     void appTransitionCancelled(int displayId);
103 
104     /**
105      * Notifies the status bar that an app transition is now being executed.
106      *
107      * @param displayId the ID of the display which has this event.
108      * @param statusBarAnimationsStartTime the desired start time for all visual animations in the
109      *        status bar caused by this app transition in uptime millis
110      * @param statusBarAnimationsDuration the duration for all visual animations in the status
111      *        bar caused by this app transition in millis
112      */
appTransitionStarting(int displayId, long statusBarAnimationsStartTime, long statusBarAnimationsDuration)113     void appTransitionStarting(int displayId, long statusBarAnimationsStartTime,
114             long statusBarAnimationsDuration);
115 
startAssist(Bundle args)116     void startAssist(Bundle args);
onCameraLaunchGestureDetected(int source)117     void onCameraLaunchGestureDetected(int source);
118 
119     /**
120      * Notifies SysUI that the wallet launch gesture has been detected.
121      */
onWalletLaunchGestureDetected()122     void onWalletLaunchGestureDetected();
setDisableFlags(int displayId, int flags, String cause)123     void setDisableFlags(int displayId, int flags, String cause);
toggleSplitScreen()124     void toggleSplitScreen();
appTransitionFinished(int displayId)125     void appTransitionFinished(int displayId);
126 
127     /**
128      * Notifies the status bar that a Emergency Action launch gesture has been detected.
129      *
130      * TODO (b/169175022) Update method name and docs when feature name is locked.
131      */
onEmergencyActionLaunchGestureDetected()132     void onEmergencyActionLaunchGestureDetected();
133 
134     /** Toggle the task bar stash state. */
toggleTaskbar()135     void toggleTaskbar();
136 
137     /** Toggle recents. */
toggleRecentApps()138     void toggleRecentApps();
139 
setCurrentUser(int newUserId)140     void setCurrentUser(int newUserId);
141 
142     /**
143      * Set whether the top app currently hides the statusbar.
144      *
145      * @param hidesStatusBar whether it is being hidden
146      */
setTopAppHidesStatusBar(int displayId, boolean hidesStatusBar)147     void setTopAppHidesStatusBar(int displayId, boolean hidesStatusBar);
148 
showShutdownUi(boolean isReboot, String requestString)149     boolean showShutdownUi(boolean isReboot, String requestString);
150 
151     /**
152      * Notify system UI the immersive prompt should be dismissed as confirmed, and the confirmed
153      * status should be saved without user clicking on the button. This could happen when a user
154      * swipe on the edge with the confirmation prompt showing.
155      */
confirmImmersivePrompt()156     void confirmImmersivePrompt();
157 
158     /**
159      * Notify System UI that the system get into or exit immersive mode.
160      * @param displayId The changed display Id.
161      * @param rootDisplayAreaId The changed display area Id.
162      * @param isImmersiveMode {@code true} if the display area get into immersive mode.
163      * @param windowType The window type of the controlling window.
164      */
immersiveModeChanged(int displayId, int rootDisplayAreaId, boolean isImmersiveMode, int windowType)165     void immersiveModeChanged(int displayId, int rootDisplayAreaId, boolean isImmersiveMode,
166             int windowType);
167 
168     /**
169      * Show a rotation suggestion that a user may approve to rotate the screen.
170      *
171      * @param rotation rotation suggestion
172      */
onProposedRotationChanged(int displayId, int rotation, boolean isValid)173     void onProposedRotationChanged(int displayId, int rotation, boolean isValid);
174 
175     /**
176      * Notifies System UI that the system decorations should be added on the display.
177      *
178      * @param displayId display ID
179      */
onDisplayAddSystemDecorations(int displayId)180     void onDisplayAddSystemDecorations(int displayId);
181 
182     /**
183      * Notifies System UI that the system decorations should be removed from the display.
184      *
185      * @param displayId display ID
186      */
onDisplayRemoveSystemDecorations(int displayId)187     void onDisplayRemoveSystemDecorations(int displayId);
188 
189     /** @see com.android.internal.statusbar.IStatusBar#onSystemBarAttributesChanged */
onSystemBarAttributesChanged(int displayId, @Appearance int appearance, AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme, @Behavior int behavior, @InsetsType int requestedVisibleTypes, String packageName, LetterboxDetails[] letterboxDetails)190     void onSystemBarAttributesChanged(int displayId, @Appearance int appearance,
191             AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme,
192             @Behavior int behavior, @InsetsType int requestedVisibleTypes, String packageName,
193             LetterboxDetails[] letterboxDetails);
194 
195     /** @see com.android.internal.statusbar.IStatusBar#showTransient */
showTransient(int displayId, @InsetsType int types, boolean isGestureOnSystemBar)196     void showTransient(int displayId, @InsetsType int types, boolean isGestureOnSystemBar);
197 
198     /** @see com.android.internal.statusbar.IStatusBar#abortTransient */
abortTransient(int displayId, @InsetsType int types)199     void abortTransient(int displayId, @InsetsType int types);
200 
201     /**
202      * @see com.android.internal.statusbar.IStatusBar#showToast(String, IBinder, CharSequence,
203      * IBinder, int, ITransientNotificationCallback, int)
204      */
showToast(int uid, String packageName, IBinder token, CharSequence text, IBinder windowToken, int duration, @Nullable ITransientNotificationCallback textCallback, int displayId)205     void showToast(int uid, String packageName, IBinder token, CharSequence text,
206             IBinder windowToken, int duration,
207             @Nullable ITransientNotificationCallback textCallback, int displayId);
208 
209     /** @see com.android.internal.statusbar.IStatusBar#hideToast(String, IBinder)  */
hideToast(String packageName, IBinder token)210     void hideToast(String packageName, IBinder token);
211 
212     /**
213      * @see com.android.internal.statusbar.IStatusBar#requestMagnificationConnection(boolean
214      * request)
215      */
requestMagnificationConnection(boolean request)216     boolean requestMagnificationConnection(boolean request);
217 
218     /**
219      * @see com.android.internal.statusbar.IStatusBar#setNavigationBarLumaSamplingEnabled(int,
220      * boolean)
221      */
setNavigationBarLumaSamplingEnabled(int displayId, boolean enable)222     void setNavigationBarLumaSamplingEnabled(int displayId, boolean enable);
223 
224     /**
225      * Sets the system-wide callback for UDFPS refresh rate changes.
226      *
227      * @see com.android.internal.statusbar.IStatusBar#setUdfpsRefreshRateCallback
228      * (IUdfpsRefreshRateRequestCallback)
229      */
setUdfpsRefreshRateCallback(IUdfpsRefreshRateRequestCallback callback)230     void setUdfpsRefreshRateCallback(IUdfpsRefreshRateRequestCallback callback);
231 
232     /**
233      * Shows the rear display educational dialog
234      *
235      * @see com.android.internal.statusbar.IStatusBar#showRearDisplayDialog
236      */
showRearDisplayDialog(int currentBaseState)237     void showRearDisplayDialog(int currentBaseState);
238 
239     /**
240      * Called when requested to go to fullscreen from the focused app.
241      *
242      * @param displayId of the current display.
243      */
moveFocusedTaskToFullscreen(int displayId)244     void moveFocusedTaskToFullscreen(int displayId);
245 
246     /**
247      * Enters stage split from a current running app.
248      *
249      * @see com.android.internal.statusbar.IStatusBar#moveFocusedTaskToStageSplit
250      */
moveFocusedTaskToStageSplit(int displayId, boolean leftOrTop)251     void moveFocusedTaskToStageSplit(int displayId, boolean leftOrTop);
252 
253     /**
254      * Change the split screen focus to the left / top app or the right / bottom app based on
255      * {@param leftOrTop}.
256      *
257      * @see com.android.internal.statusbar.IStatusBar#setSplitscreenFocus
258      */
setSplitscreenFocus(boolean leftOrTop)259     void setSplitscreenFocus(boolean leftOrTop);
260 
261     /**
262      * Shows the media output switcher dialog.
263      *
264      * @param targetPackageName of the session for which the output switcher is shown.
265      * @see com.android.internal.statusbar.IStatusBar#showMediaOutputSwitcher
266      */
showMediaOutputSwitcher(String targetPackageName, UserHandle targetUserHandle)267     void showMediaOutputSwitcher(String targetPackageName, UserHandle targetUserHandle);
268 
269     /**
270      * Add a tile to the Quick Settings Panel
271      * @param tile the ComponentName of the {@link android.service.quicksettings.TileService}
272      * @param end if true, the tile will be added at the end. If false, at the beginning.
273      */
addQsTileToFrontOrEnd(ComponentName tile, boolean end)274     void addQsTileToFrontOrEnd(ComponentName tile, boolean end);
275 
276     /**
277      * Remove the tile from the Quick Settings Panel
278      * @param tile the ComponentName of the {@link android.service.quicksettings.TileService}
279      */
removeQsTile(ComponentName tile)280     void removeQsTile(ComponentName tile);
281 
282     /**
283      * Called when requested to enter desktop from a focused app.
284      */
moveFocusedTaskToDesktop(int displayId)285     void moveFocusedTaskToDesktop(int displayId);
286 
287     /** Passes through the given shell commands to SystemUI */
passThroughShellCommand(String[] args, FileDescriptor fd)288     void passThroughShellCommand(String[] args, FileDescriptor fd);
289 }
290