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.hardware.fingerprint.IUdfpsHbmListener; 22 import android.os.Bundle; 23 import android.os.IBinder; 24 import android.os.ParcelFileDescriptor; 25 import android.view.InsetsState.InternalInsetsType; 26 import android.view.InsetsVisibilities; 27 import android.view.WindowInsetsController.Appearance; 28 import android.view.WindowInsetsController.Behavior; 29 30 import com.android.internal.view.AppearanceRegion; 31 import com.android.server.notification.NotificationDelegate; 32 33 public interface StatusBarManagerInternal { setNotificationDelegate(NotificationDelegate delegate)34 void setNotificationDelegate(NotificationDelegate delegate); showScreenPinningRequest(int taskId)35 void showScreenPinningRequest(int taskId); showAssistDisclosure()36 void showAssistDisclosure(); 37 preloadRecentApps()38 void preloadRecentApps(); 39 cancelPreloadRecentApps()40 void cancelPreloadRecentApps(); 41 showRecentApps(boolean triggeredFromAltTab)42 void showRecentApps(boolean triggeredFromAltTab); 43 hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey)44 void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey); 45 46 /** Collapses the notification shade. */ collapsePanels()47 void collapsePanels(); 48 dismissKeyboardShortcutsMenu()49 void dismissKeyboardShortcutsMenu(); toggleKeyboardShortcutsMenu(int deviceId)50 void toggleKeyboardShortcutsMenu(int deviceId); 51 showChargingAnimation(int batteryLevel)52 void showChargingAnimation(int batteryLevel); 53 54 /** 55 * Show picture-in-picture menu. 56 */ showPictureInPictureMenu()57 void showPictureInPictureMenu(); 58 setWindowState(int displayId, int window, int state)59 void setWindowState(int displayId, int window, int state); 60 61 /** 62 * Notifies the status bar that an app transition is pending to delay applying some flags with 63 * visual impact until {@link #appTransitionReady} is called. 64 * 65 * @param displayId the ID of the display which has this event. 66 */ appTransitionPending(int displayId)67 void appTransitionPending(int displayId); 68 69 /** 70 * Notifies the status bar that a pending app transition has been cancelled. 71 * 72 * @param displayId the ID of the display which has this event. 73 */ appTransitionCancelled(int displayId)74 void appTransitionCancelled(int displayId); 75 76 /** 77 * Notifies the status bar that an app transition is now being executed. 78 * 79 * @param displayId the ID of the display which has this event. 80 * @param statusBarAnimationsStartTime the desired start time for all visual animations in the 81 * status bar caused by this app transition in uptime millis 82 * @param statusBarAnimationsDuration the duration for all visual animations in the status 83 * bar caused by this app transition in millis 84 */ appTransitionStarting(int displayId, long statusBarAnimationsStartTime, long statusBarAnimationsDuration)85 void appTransitionStarting(int displayId, long statusBarAnimationsStartTime, 86 long statusBarAnimationsDuration); 87 startAssist(Bundle args)88 void startAssist(Bundle args); onCameraLaunchGestureDetected(int source)89 void onCameraLaunchGestureDetected(int source); setDisableFlags(int displayId, int flags, String cause)90 void setDisableFlags(int displayId, int flags, String cause); toggleSplitScreen()91 void toggleSplitScreen(); appTransitionFinished(int displayId)92 void appTransitionFinished(int displayId); 93 94 /** 95 * Notifies the status bar that a Emergency Action launch gesture has been detected. 96 * 97 * TODO (b/169175022) Update method name and docs when feature name is locked. 98 */ onEmergencyActionLaunchGestureDetected()99 void onEmergencyActionLaunchGestureDetected(); 100 toggleRecentApps()101 void toggleRecentApps(); 102 setCurrentUser(int newUserId)103 void setCurrentUser(int newUserId); 104 105 /** 106 * Set whether the top app currently hides the statusbar. 107 * 108 * @param hidesStatusBar whether it is being hidden 109 */ setTopAppHidesStatusBar(boolean hidesStatusBar)110 void setTopAppHidesStatusBar(boolean hidesStatusBar); 111 showShutdownUi(boolean isReboot, String requestString)112 boolean showShutdownUi(boolean isReboot, String requestString); 113 114 /** 115 * Show a rotation suggestion that a user may approve to rotate the screen. 116 * 117 * @param rotation rotation suggestion 118 */ onProposedRotationChanged(int rotation, boolean isValid)119 void onProposedRotationChanged(int rotation, boolean isValid); 120 121 /** 122 * Notifies System UI that the display is ready to show system decorations. 123 * 124 * @param displayId display ID 125 */ onDisplayReady(int displayId)126 void onDisplayReady(int displayId); 127 128 /** 129 * Notifies System UI whether the recents animation is running. 130 */ onRecentsAnimationStateChanged(boolean running)131 void onRecentsAnimationStateChanged(boolean running); 132 133 /** @see com.android.internal.statusbar.IStatusBar#onSystemBarAttributesChanged */ onSystemBarAttributesChanged(int displayId, @Appearance int appearance, AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme, @Behavior int behavior, InsetsVisibilities requestedVisibilities, String packageName)134 void onSystemBarAttributesChanged(int displayId, @Appearance int appearance, 135 AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme, 136 @Behavior int behavior, InsetsVisibilities requestedVisibilities, String packageName); 137 138 /** @see com.android.internal.statusbar.IStatusBar#showTransient */ showTransient(int displayId, @InternalInsetsType int[] types, boolean isGestureOnSystemBar)139 void showTransient(int displayId, @InternalInsetsType int[] types, 140 boolean isGestureOnSystemBar); 141 142 /** @see com.android.internal.statusbar.IStatusBar#abortTransient */ abortTransient(int displayId, @InternalInsetsType int[] types)143 void abortTransient(int displayId, @InternalInsetsType int[] types); 144 145 /** 146 * @see com.android.internal.statusbar.IStatusBar#showToast(String, IBinder, CharSequence, 147 * IBinder, int, ITransientNotificationCallback) 148 */ showToast(int uid, String packageName, IBinder token, CharSequence text, IBinder windowToken, int duration, @Nullable ITransientNotificationCallback textCallback)149 void showToast(int uid, String packageName, IBinder token, CharSequence text, 150 IBinder windowToken, int duration, 151 @Nullable ITransientNotificationCallback textCallback); 152 153 /** @see com.android.internal.statusbar.IStatusBar#hideToast(String, IBinder) */ hideToast(String packageName, IBinder token)154 void hideToast(String packageName, IBinder token); 155 156 /** 157 * @see com.android.internal.statusbar.IStatusBar#requestWindowMagnificationConnection(boolean 158 * request) 159 */ requestWindowMagnificationConnection(boolean request)160 void requestWindowMagnificationConnection(boolean request); 161 162 /** 163 * Handles a logging command from the WM shell command. 164 */ handleWindowManagerLoggingCommand(String[] args, ParcelFileDescriptor outFd)165 void handleWindowManagerLoggingCommand(String[] args, ParcelFileDescriptor outFd); 166 167 /** 168 * @see com.android.internal.statusbar.IStatusBar#setNavigationBarLumaSamplingEnabled(int, 169 * boolean) 170 */ setNavigationBarLumaSamplingEnabled(int displayId, boolean enable)171 void setNavigationBarLumaSamplingEnabled(int displayId, boolean enable); 172 173 /** 174 * Sets the system-wide listener for UDFPS HBM status changes. 175 * 176 * @see com.android.internal.statusbar.IStatusBar#setUdfpsHbmListener(IUdfpsHbmListener) 177 */ setUdfpsHbmListener(IUdfpsHbmListener listener)178 void setUdfpsHbmListener(IUdfpsHbmListener listener); 179 } 180