Adam Lesinski | 182f73f | 2013-12-05 16:48:06 -0800 | [diff] [blame] | 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 | |
Bernardo Rufino | ab338ac | 2019-12-20 18:35:30 +0000 | [diff] [blame] | 19 | import android.annotation.Nullable; |
| 20 | import android.app.ITransientNotificationCallback; |
Jorim Jaggi | 165ce06 | 2015-07-06 16:18:11 -0700 | [diff] [blame] | 21 | import android.os.Bundle; |
Bernardo Rufino | ab338ac | 2019-12-20 18:35:30 +0000 | [diff] [blame] | 22 | import android.os.IBinder; |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 23 | import android.view.InsetsState.InternalInsetsType; |
Jorim Jaggi | 956ca41 | 2019-01-07 14:49:14 +0100 | [diff] [blame] | 24 | import android.view.WindowInsetsController.Appearance; |
Jorim Jaggi | 165ce06 | 2015-07-06 16:18:11 -0700 | [diff] [blame] | 25 | |
Jorim Jaggi | 956ca41 | 2019-01-07 14:49:14 +0100 | [diff] [blame] | 26 | import com.android.internal.view.AppearanceRegion; |
Adam Lesinski | 182f73f | 2013-12-05 16:48:06 -0800 | [diff] [blame] | 27 | import com.android.server.notification.NotificationDelegate; |
| 28 | |
Adam Lesinski | 182f73f | 2013-12-05 16:48:06 -0800 | [diff] [blame] | 29 | public interface StatusBarManagerInternal { |
| 30 | void setNotificationDelegate(NotificationDelegate delegate); |
Andrii Kulian | 0f051f5 | 2016-04-14 00:41:51 -0700 | [diff] [blame] | 31 | void showScreenPinningRequest(int taskId); |
Adrian Roos | 4f43dc0 | 2015-06-17 16:43:38 -0700 | [diff] [blame] | 32 | void showAssistDisclosure(); |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 33 | |
| 34 | void preloadRecentApps(); |
| 35 | |
| 36 | void cancelPreloadRecentApps(); |
| 37 | |
Winson Chung | dff7a73 | 2017-12-11 12:17:06 -0800 | [diff] [blame] | 38 | void showRecentApps(boolean triggeredFromAltTab); |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 39 | |
| 40 | void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey); |
| 41 | |
Andrei Stingaceanu | 0bf096f | 2016-04-14 18:11:57 +0100 | [diff] [blame] | 42 | void dismissKeyboardShortcutsMenu(); |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 43 | void toggleKeyboardShortcutsMenu(int deviceId); |
| 44 | |
Beverly | ae79ab9 | 2017-12-11 09:20:02 -0500 | [diff] [blame] | 45 | void showChargingAnimation(int batteryLevel); |
| 46 | |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 47 | /** |
Winson Chung | ac52f28 | 2017-03-30 14:44:52 -0700 | [diff] [blame] | 48 | * Show picture-in-picture menu. |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 49 | */ |
Winson Chung | ac52f28 | 2017-03-30 14:44:52 -0700 | [diff] [blame] | 50 | void showPictureInPictureMenu(); |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 51 | |
Tiger Huang | 7c610aa | 2018-10-27 00:01:01 +0800 | [diff] [blame] | 52 | void setWindowState(int displayId, int window, int state); |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 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. |
Tiger Huang | 7c610aa | 2018-10-27 00:01:01 +0800 | [diff] [blame] | 57 | * |
| 58 | * @param displayId the ID of the display which has this event. |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 59 | */ |
Tiger Huang | 7c610aa | 2018-10-27 00:01:01 +0800 | [diff] [blame] | 60 | void appTransitionPending(int displayId); |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 61 | |
| 62 | /** |
| 63 | * Notifies the status bar that a pending app transition has been cancelled. |
Tiger Huang | 7c610aa | 2018-10-27 00:01:01 +0800 | [diff] [blame] | 64 | * |
| 65 | * @param displayId the ID of the display which has this event. |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 66 | */ |
Tiger Huang | 7c610aa | 2018-10-27 00:01:01 +0800 | [diff] [blame] | 67 | void appTransitionCancelled(int displayId); |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 68 | |
| 69 | /** |
| 70 | * Notifies the status bar that an app transition is now being executed. |
| 71 | * |
Tiger Huang | 7c610aa | 2018-10-27 00:01:01 +0800 | [diff] [blame] | 72 | * @param displayId the ID of the display which has this event. |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 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 | */ |
Tiger Huang | 7c610aa | 2018-10-27 00:01:01 +0800 | [diff] [blame] | 78 | void appTransitionStarting(int displayId, long statusBarAnimationsStartTime, |
| 79 | long statusBarAnimationsDuration); |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 80 | |
Jorim Jaggi | 165ce06 | 2015-07-06 16:18:11 -0700 | [diff] [blame] | 81 | void startAssist(Bundle args); |
Jorim Jaggi | 40aa881 | 2015-09-23 12:59:22 -0700 | [diff] [blame] | 82 | void onCameraLaunchGestureDetected(int source); |
Jorim Jaggi | 956ca41 | 2019-01-07 14:49:14 +0100 | [diff] [blame] | 83 | void topAppWindowChanged(int displayId, boolean isFullscreen, boolean isImmersive); |
Tiger Huang | 0dbd537 | 2019-10-26 00:24:22 +0800 | [diff] [blame] | 84 | void setDisableFlags(int displayId, int flags, String cause); |
Phil Weaver | 315c34e | 2016-02-19 15:12:29 -0800 | [diff] [blame] | 85 | void toggleSplitScreen(); |
Tiger Huang | 7c610aa | 2018-10-27 00:01:01 +0800 | [diff] [blame] | 86 | void appTransitionFinished(int displayId); |
Adrian Roos | f2efdd8 | 2016-04-15 17:43:18 -0700 | [diff] [blame] | 87 | |
| 88 | void toggleRecentApps(); |
| 89 | |
| 90 | void setCurrentUser(int newUserId); |
Jason Monk | 361915c | 2017-03-21 20:33:59 -0400 | [diff] [blame] | 91 | |
Selim Cinek | 3a49ba2 | 2017-08-10 11:17:39 -0700 | [diff] [blame] | 92 | /** |
| 93 | * Set whether the top app currently hides the statusbar. |
| 94 | * |
| 95 | * @param hidesStatusBar whether it is being hidden |
| 96 | */ |
| 97 | void setTopAppHidesStatusBar(boolean hidesStatusBar); |
| 98 | |
Jason Monk | b430218 | 2017-08-04 13:39:17 -0400 | [diff] [blame] | 99 | boolean showShutdownUi(boolean isReboot, String requestString); |
| 100 | |
Mike Digman | 93f0834 | 2017-11-24 21:46:53 -0800 | [diff] [blame] | 101 | /** |
| 102 | * Show a rotation suggestion that a user may approve to rotate the screen. |
| 103 | * |
| 104 | * @param rotation rotation suggestion |
| 105 | */ |
Mike Digman | e077731 | 2018-01-19 12:41:51 -0800 | [diff] [blame] | 106 | void onProposedRotationChanged(int rotation, boolean isValid); |
Charles Chen | 3dedec3 | 2019-01-24 22:19:37 +0800 | [diff] [blame] | 107 | |
| 108 | /** |
| 109 | * Notifies System UI that the display is ready to show system decorations. |
| 110 | * |
| 111 | * @param displayId display ID |
| 112 | */ |
| 113 | void onDisplayReady(int displayId); |
Winson Chung | 67e4936 | 2019-05-17 16:40:38 -0700 | [diff] [blame] | 114 | |
| 115 | /** |
| 116 | * Notifies System UI whether the recents animation is running. |
| 117 | */ |
| 118 | void onRecentsAnimationStateChanged(boolean running); |
Jorim Jaggi | 956ca41 | 2019-01-07 14:49:14 +0100 | [diff] [blame] | 119 | |
| 120 | /** @see com.android.internal.statusbar.IStatusBar#onSystemBarAppearanceChanged */ |
| 121 | void onSystemBarAppearanceChanged(int displayId, @Appearance int appearance, |
| 122 | AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme); |
| 123 | |
| 124 | /** @see com.android.internal.statusbar.IStatusBar#showTransient */ |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 125 | void showTransient(int displayId, @InternalInsetsType int[] types); |
Jorim Jaggi | 956ca41 | 2019-01-07 14:49:14 +0100 | [diff] [blame] | 126 | |
| 127 | /** @see com.android.internal.statusbar.IStatusBar#abortTransient */ |
Tiger Huang | 332793b | 2019-10-29 23:21:27 +0800 | [diff] [blame] | 128 | void abortTransient(int displayId, @InternalInsetsType int[] types); |
Bernardo Rufino | ab338ac | 2019-12-20 18:35:30 +0000 | [diff] [blame] | 129 | |
| 130 | /** |
| 131 | * @see com.android.internal.statusbar.IStatusBar#showToast(String, IBinder, CharSequence, |
| 132 | * IBinder, int, ITransientNotificationCallback) |
| 133 | */ |
| 134 | void showToast(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) */ |
| 139 | void hideToast(String packageName, IBinder token); |
Adam Lesinski | 182f73f | 2013-12-05 16:48:06 -0800 | [diff] [blame] | 140 | } |