blob: 5ce83c2db44dd5ab5bab662745702b35b0e96aa1 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/**
2 * Copyright (c) 2007, The Android Open Source Project
3 *
Jorim Jaggi24bec7c2015-02-04 12:40:14 +01004 * 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
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007 *
Jorim Jaggi24bec7c2015-02-04 12:40:14 +01008 * http://www.apache.org/licenses/LICENSE-2.0
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009 *
Jorim Jaggi24bec7c2015-02-04 12:40:14 +010010 * 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
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080014 * limitations under the License.
15 */
Dianne Hackborn7d049322011-06-14 15:00:32 -070016
Joe Onorato0cbda992010-05-02 16:28:15 -070017package com.android.internal.statusbar;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080018
Tony Mak7d4b3a52018-11-27 17:29:36 +000019import android.app.Notification;
Aran Inkfd2bfd32019-10-04 16:30:01 -040020import android.net.Uri;
Jason Monk7e53f202016-01-28 10:40:20 -050021import android.content.ComponentName;
Jorim Jaggi86905582016-02-09 21:36:09 -080022import android.graphics.Rect;
Jorim Jaggi165ce062015-07-06 16:18:11 -070023import android.os.Bundle;
Aran Ink979c9762019-10-24 16:09:45 -040024import android.os.UserHandle;
Jorim Jaggi165ce062015-07-06 16:18:11 -070025import android.service.notification.StatusBarNotification;
Kevin Chyn23289ef2018-11-28 16:32:36 -080026import android.hardware.biometrics.IBiometricServiceReceiverInternal;
Jorim Jaggi165ce062015-07-06 16:18:11 -070027
Joe Onorato0cbda992010-05-02 16:28:15 -070028import com.android.internal.statusbar.IStatusBar;
Yohei Yukawa49efa712019-04-04 11:49:02 -070029import com.android.internal.statusbar.RegisterStatusBarResult;
Joe Onorato0cbda992010-05-02 16:28:15 -070030import com.android.internal.statusbar.StatusBarIcon;
31import com.android.internal.statusbar.StatusBarIconList;
Chris Wrend1dbc922015-06-19 17:51:16 -040032import com.android.internal.statusbar.NotificationVisibility;
Joe Onorato2314aab2010-04-08 16:41:23 -050033
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080034/** @hide */
Joe Onorato25f95f92010-04-08 18:37:10 -050035interface IStatusBarService
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080036{
Andrei Oneafa152f92019-02-27 15:58:05 +000037 @UnsupportedAppUsage
Daniel Sandler11cf1782012-09-27 14:03:08 -040038 void expandNotificationsPanel();
Andrei Oneafa152f92019-02-27 15:58:05 +000039 @UnsupportedAppUsage
Daniel Sandler11cf1782012-09-27 14:03:08 -040040 void collapsePanels();
Anthony Chen9ad00e02017-05-12 15:53:36 -070041 void togglePanel();
Andrei Oneafa152f92019-02-27 15:58:05 +000042 @UnsupportedAppUsage
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043 void disable(int what, IBinder token, String pkg);
Benjamin Franzea2ec972015-03-16 17:18:09 +000044 void disableForUser(int what, IBinder token, String pkg, int userId);
Benjamin Franzcde0a2a2015-04-23 17:19:48 +010045 void disable2(int what, IBinder token, String pkg);
46 void disable2ForUser(int what, IBinder token, String pkg, int userId);
Evan Lairdedd016f2019-01-23 18:36:29 -050047 int[] getDisableFlags(IBinder token, int userId);
Svetoslav Ganov6179ea32011-06-28 01:12:41 -070048 void setIcon(String slot, String iconPackage, int iconId, int iconLevel, String contentDescription);
Andrei Oneafa152f92019-02-27 15:58:05 +000049 @UnsupportedAppUsage
Joe Onorato0cbda992010-05-02 16:28:15 -070050 void setIconVisibility(String slot, boolean visible);
Andrei Oneafa152f92019-02-27 15:58:05 +000051 @UnsupportedAppUsage
Joe Onorato0cbda992010-05-02 16:28:15 -070052 void removeIcon(String slot);
lumark7570cac2019-03-07 22:14:38 +080053 void setImeWindowStatus(int displayId, in IBinder token, int vis, int backDisposition,
Tarandeep Singh07b318b2019-07-17 11:12:04 -070054 boolean showImeSwitcher, boolean isMultiClientImeEnabled);
Jason Monka9927322015-12-13 16:22:37 -050055 void expandSettingsPanel(String subPanel);
Joe Onorato2314aab2010-04-08 16:41:23 -050056
57 // ---- Methods below are for use by the status bar policy services ----
Joe Onorato8bc6c512010-06-04 16:21:12 -040058 // You need the STATUS_BAR_SERVICE permission
Yohei Yukawa49efa712019-04-04 11:49:02 -070059 RegisterStatusBarResult registerStatusBar(IStatusBar callbacks);
Chris Wrenb659c4f2015-06-25 17:12:27 -040060 void onPanelRevealed(boolean clearNotificationEffects, int numItems);
Christoph Studer760ea552014-03-21 13:10:21 +010061 void onPanelHidden();
Christoph Studer1f32c652014-11-26 15:32:20 +010062 // Mark current notifications as "seen" and stop ringing, vibrating, blinking.
63 void clearNotificationEffects();
Dieter Hsud39f0d52018-04-14 02:08:30 +080064 void onNotificationClick(String key, in NotificationVisibility nv);
Tony Mak7d4b3a52018-11-27 17:29:36 +000065 void onNotificationActionClick(String key, int actionIndex, in Notification.Action action, in NotificationVisibility nv, boolean generatedByAssistant);
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -070066 void onNotificationError(String pkg, String tag, int id,
Kenny Guy3a7c4a52014-03-03 18:24:03 +000067 int uid, int initialPid, String message, int userId);
68 void onClearAllNotifications(int userId);
Dieter Hsud39f0d52018-04-14 02:08:30 +080069 void onNotificationClear(String pkg, String tag, int id, int userId, String key,
Julia Reynoldsfd4099d2018-08-21 11:06:06 -040070 int dismissalSurface, int dismissalSentiment, in NotificationVisibility nv);
Chris Wrend1dbc922015-06-19 17:51:16 -040071 void onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys,
72 in NotificationVisibility[] noLongerVisibleKeys);
Gustav Senntona8e38aa2019-01-22 14:55:39 +000073 void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded, in int notificationLocation);
Julia Reynolds503ed942017-10-04 16:04:56 -040074 void onNotificationDirectReplied(String key);
Gustav Senntond25a64d2018-12-07 10:58:39 +000075 void onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount,
Milo Sredkov13d88112019-02-01 12:23:24 +000076 boolean generatedByAsssistant, boolean editBeforeSending);
77 void onNotificationSmartReplySent(in String key, in int replyIndex, in CharSequence reply,
78 in int notificationLocation, boolean modifiedBeforeSending);
Julia Reynolds503ed942017-10-04 16:04:56 -040079 void onNotificationSettingsViewed(String key);
Mady Mellora54e9fa2019-04-18 13:26:18 -070080 void onNotificationBubbleChanged(String key, boolean isBubble);
Mady Mellorf44b6832020-01-14 13:26:14 -080081 void onBubbleNotificationSuppressionChanged(String key, boolean isSuppressed);
Aran Ink979c9762019-10-24 16:09:45 -040082 void grantInlineReplyUriPermission(String key, in Uri uri, in UserHandle user, String packageName);
83 void clearInlineReplyUriPermissions(String key);
Jason Monk7e53f202016-01-28 10:40:20 -050084
Jason Monk361915c2017-03-21 20:33:59 -040085 void onGlobalActionsShown();
86 void onGlobalActionsHidden();
87
88 /**
89 * These methods are needed for global actions control which the UI is shown in sysui.
90 */
91 void shutdown();
92 void reboot(boolean safeMode);
93
Jason Monk7e53f202016-01-28 10:40:20 -050094 void addTile(in ComponentName tile);
95 void remTile(in ComponentName tile);
96 void clickTile(in ComponentName tile);
Andrei Oneafa152f92019-02-27 15:58:05 +000097 @UnsupportedAppUsage
Philip Quinnc3a503d2017-07-18 23:23:41 -070098 void handleSystemKey(in int key);
Kevin Chynaae4a152018-01-18 11:48:09 -080099
Matthew Ng9c3bce52018-02-01 22:00:31 +0000100 /**
101 * Methods to show toast messages for screen pinning
102 */
103 void showPinningEnterExitToast(boolean entering);
104 void showPinningEscapeToast();
105
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700106 // Used to show the authentication dialog (Biometrics, Device Credential)
107 void showAuthenticationDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver,
108 int biometricModality, boolean requireConfirmation, int userId, String opPackageName);
Ilya Matyukhin0f9da352019-10-03 14:10:01 -0700109 // Used to notify the authentication dialog that a biometric has been authenticated
110 void onBiometricAuthenticated();
Kevin Chynaae4a152018-01-18 11:48:09 -0800111 // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc
Kevin Chyne9275662018-07-23 16:42:06 -0700112 void onBiometricHelp(String message);
Ilya Matyukhin0f9da352019-10-03 14:10:01 -0700113 // Used to show an error - the dialog will dismiss after a certain amount of time
114 void onBiometricError(int modality, int error, int vendorCode);
Kevin Chyn86f1b8e2019-09-24 19:00:49 -0700115 // Used to hide the authentication dialog, e.g. when the application cancels authentication
116 void hideAuthenticationDialog();
Robert Horvath5560f382019-07-10 10:46:38 +0200117
118 /**
119 * Show a warning that the device is about to go to sleep due to user inactivity.
120 */
121 void showInattentiveSleepWarning();
122
123 /**
124 * Dismiss the warning that the device is about to go to sleep due to user inactivity.
125 */
Robert Horvath60e51fe2019-08-20 13:10:34 +0200126 void dismissInattentiveSleepWarning(boolean animated);
Winson Chungb53b30c2019-11-18 21:03:09 -0800127
128 /**
129 * Notifies SystemUI to start tracing.
130 */
131 void startTracing();
132
133 /**
134 * Notifies SystemUI to stop tracing.
135 */
136 void stopTracing();
137
138 /**
139 * Returns whether SystemUI tracing is enabled.
140 */
141 boolean isTracing();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800142}