1 /** 2 * Copyright (c) 2007, 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.internal.statusbar; 18 19 import android.content.ComponentName; 20 import android.graphics.Rect; 21 import android.os.Bundle; 22 import android.service.notification.StatusBarNotification; 23 import android.hardware.biometrics.IBiometricPromptReceiver; 24 25 import com.android.internal.statusbar.IStatusBar; 26 import com.android.internal.statusbar.StatusBarIcon; 27 import com.android.internal.statusbar.StatusBarIconList; 28 import com.android.internal.statusbar.NotificationVisibility; 29 30 /** @hide */ 31 interface IStatusBarService 32 { expandNotificationsPanel()33 void expandNotificationsPanel(); collapsePanels()34 void collapsePanels(); togglePanel()35 void togglePanel(); disable(int what, IBinder token, String pkg)36 void disable(int what, IBinder token, String pkg); disableForUser(int what, IBinder token, String pkg, int userId)37 void disableForUser(int what, IBinder token, String pkg, int userId); disable2(int what, IBinder token, String pkg)38 void disable2(int what, IBinder token, String pkg); disable2ForUser(int what, IBinder token, String pkg, int userId)39 void disable2ForUser(int what, IBinder token, String pkg, int userId); setIcon(String slot, String iconPackage, int iconId, int iconLevel, String contentDescription)40 void setIcon(String slot, String iconPackage, int iconId, int iconLevel, String contentDescription); setIconVisibility(String slot, boolean visible)41 void setIconVisibility(String slot, boolean visible); removeIcon(String slot)42 void removeIcon(String slot); setImeWindowStatus(in IBinder token, int vis, int backDisposition, boolean showImeSwitcher)43 void setImeWindowStatus(in IBinder token, int vis, int backDisposition, 44 boolean showImeSwitcher); expandSettingsPanel(String subPanel)45 void expandSettingsPanel(String subPanel); 46 47 // ---- Methods below are for use by the status bar policy services ---- 48 // You need the STATUS_BAR_SERVICE permission registerStatusBar(IStatusBar callbacks, out List<String> iconSlots, out List<StatusBarIcon> iconList, out int[] switches, out List<IBinder> binders, out Rect fullscreenStackBounds, out Rect dockedStackBounds)49 void registerStatusBar(IStatusBar callbacks, out List<String> iconSlots, 50 out List<StatusBarIcon> iconList, 51 out int[] switches, out List<IBinder> binders, out Rect fullscreenStackBounds, 52 out Rect dockedStackBounds); onPanelRevealed(boolean clearNotificationEffects, int numItems)53 void onPanelRevealed(boolean clearNotificationEffects, int numItems); onPanelHidden()54 void onPanelHidden(); 55 // Mark current notifications as "seen" and stop ringing, vibrating, blinking. clearNotificationEffects()56 void clearNotificationEffects(); onNotificationClick(String key, in NotificationVisibility nv)57 void onNotificationClick(String key, in NotificationVisibility nv); onNotificationActionClick(String key, int actionIndex, in NotificationVisibility nv)58 void onNotificationActionClick(String key, int actionIndex, in NotificationVisibility nv); onNotificationError(String pkg, String tag, int id, int uid, int initialPid, String message, int userId)59 void onNotificationError(String pkg, String tag, int id, 60 int uid, int initialPid, String message, int userId); onClearAllNotifications(int userId)61 void onClearAllNotifications(int userId); onNotificationClear(String pkg, String tag, int id, int userId, String key, int dismissalSurface, in NotificationVisibility nv)62 void onNotificationClear(String pkg, String tag, int id, int userId, String key, 63 int dismissalSurface, in NotificationVisibility nv); onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys, in NotificationVisibility[] noLongerVisibleKeys)64 void onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys, 65 in NotificationVisibility[] noLongerVisibleKeys); onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded)66 void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded); onNotificationDirectReplied(String key)67 void onNotificationDirectReplied(String key); onNotificationSmartRepliesAdded(in String key, in int replyCount)68 void onNotificationSmartRepliesAdded(in String key, in int replyCount); onNotificationSmartReplySent(in String key, in int replyIndex)69 void onNotificationSmartReplySent(in String key, in int replyIndex); onNotificationSettingsViewed(String key)70 void onNotificationSettingsViewed(String key); setSystemUiVisibility(int vis, int mask, String cause)71 void setSystemUiVisibility(int vis, int mask, String cause); 72 onGlobalActionsShown()73 void onGlobalActionsShown(); onGlobalActionsHidden()74 void onGlobalActionsHidden(); 75 76 /** 77 * These methods are needed for global actions control which the UI is shown in sysui. 78 */ shutdown()79 void shutdown(); reboot(boolean safeMode)80 void reboot(boolean safeMode); 81 addTile(in ComponentName tile)82 void addTile(in ComponentName tile); remTile(in ComponentName tile)83 void remTile(in ComponentName tile); clickTile(in ComponentName tile)84 void clickTile(in ComponentName tile); handleSystemKey(in int key)85 void handleSystemKey(in int key); 86 87 /** 88 * Methods to show toast messages for screen pinning 89 */ showPinningEnterExitToast(boolean entering)90 void showPinningEnterExitToast(boolean entering); showPinningEscapeToast()91 void showPinningEscapeToast(); 92 93 // Used to show the dialog when FingerprintService starts authentication showFingerprintDialog(in Bundle bundle, IBiometricPromptReceiver receiver)94 void showFingerprintDialog(in Bundle bundle, IBiometricPromptReceiver receiver); 95 // Used to hide the dialog when a finger is authenticated onFingerprintAuthenticated()96 void onFingerprintAuthenticated(); 97 // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc onFingerprintHelp(String message)98 void onFingerprintHelp(String message); 99 // Used to set a message - the dialog will dismiss after a certain amount of time onFingerprintError(String error)100 void onFingerprintError(String error); 101 // Used to hide the fingerprint dialog when the authenticationclient is stopped hideFingerprintDialog()102 void hideFingerprintDialog(); 103 } 104