The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /** |
| 2 | * Copyright (c) 2007, The Android Open Source Project |
| 3 | * |
Jorim Jaggi | 24bec7c | 2015-02-04 12:40:14 +0100 | [diff] [blame] | 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 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7 | * |
Jorim Jaggi | 24bec7c | 2015-02-04 12:40:14 +0100 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 9 | * |
Jorim Jaggi | 24bec7c | 2015-02-04 12:40:14 +0100 | [diff] [blame] | 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 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 14 | * limitations under the License. |
| 15 | */ |
Dianne Hackborn | 7d04932 | 2011-06-14 15:00:32 -0700 | [diff] [blame] | 16 | |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 17 | package com.android.internal.statusbar; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 18 | |
Tony Mak | 7d4b3a5 | 2018-11-27 17:29:36 +0000 | [diff] [blame] | 19 | import android.app.Notification; |
Aran Ink | fd2bfd3 | 2019-10-04 16:30:01 -0400 | [diff] [blame] | 20 | import android.net.Uri; |
Jason Monk | 7e53f20 | 2016-01-28 10:40:20 -0500 | [diff] [blame] | 21 | import android.content.ComponentName; |
Jorim Jaggi | 8690558 | 2016-02-09 21:36:09 -0800 | [diff] [blame] | 22 | import android.graphics.Rect; |
Jorim Jaggi | 165ce06 | 2015-07-06 16:18:11 -0700 | [diff] [blame] | 23 | import android.os.Bundle; |
Aran Ink | 979c976 | 2019-10-24 16:09:45 -0400 | [diff] [blame] | 24 | import android.os.UserHandle; |
Jorim Jaggi | 165ce06 | 2015-07-06 16:18:11 -0700 | [diff] [blame] | 25 | import android.service.notification.StatusBarNotification; |
Kevin Chyn | 23289ef | 2018-11-28 16:32:36 -0800 | [diff] [blame] | 26 | import android.hardware.biometrics.IBiometricServiceReceiverInternal; |
Jorim Jaggi | 165ce06 | 2015-07-06 16:18:11 -0700 | [diff] [blame] | 27 | |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 28 | import com.android.internal.statusbar.IStatusBar; |
Yohei Yukawa | 49efa71 | 2019-04-04 11:49:02 -0700 | [diff] [blame] | 29 | import com.android.internal.statusbar.RegisterStatusBarResult; |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 30 | import com.android.internal.statusbar.StatusBarIcon; |
| 31 | import com.android.internal.statusbar.StatusBarIconList; |
Chris Wren | d1dbc92 | 2015-06-19 17:51:16 -0400 | [diff] [blame] | 32 | import com.android.internal.statusbar.NotificationVisibility; |
Joe Onorato | 2314aab | 2010-04-08 16:41:23 -0500 | [diff] [blame] | 33 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 34 | /** @hide */ |
Joe Onorato | 25f95f9 | 2010-04-08 18:37:10 -0500 | [diff] [blame] | 35 | interface IStatusBarService |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 36 | { |
Andrei Onea | fa152f9 | 2019-02-27 15:58:05 +0000 | [diff] [blame] | 37 | @UnsupportedAppUsage |
Daniel Sandler | 11cf1781 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 38 | void expandNotificationsPanel(); |
Andrei Onea | fa152f9 | 2019-02-27 15:58:05 +0000 | [diff] [blame] | 39 | @UnsupportedAppUsage |
Daniel Sandler | 11cf1781 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 40 | void collapsePanels(); |
Anthony Chen | 9ad00e0 | 2017-05-12 15:53:36 -0700 | [diff] [blame] | 41 | void togglePanel(); |
Andrei Onea | fa152f9 | 2019-02-27 15:58:05 +0000 | [diff] [blame] | 42 | @UnsupportedAppUsage |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | void disable(int what, IBinder token, String pkg); |
Benjamin Franz | ea2ec97 | 2015-03-16 17:18:09 +0000 | [diff] [blame] | 44 | void disableForUser(int what, IBinder token, String pkg, int userId); |
Benjamin Franz | cde0a2a | 2015-04-23 17:19:48 +0100 | [diff] [blame] | 45 | void disable2(int what, IBinder token, String pkg); |
| 46 | void disable2ForUser(int what, IBinder token, String pkg, int userId); |
Evan Laird | edd016f | 2019-01-23 18:36:29 -0500 | [diff] [blame] | 47 | int[] getDisableFlags(IBinder token, int userId); |
Svetoslav Ganov | 6179ea3 | 2011-06-28 01:12:41 -0700 | [diff] [blame] | 48 | void setIcon(String slot, String iconPackage, int iconId, int iconLevel, String contentDescription); |
Andrei Onea | fa152f9 | 2019-02-27 15:58:05 +0000 | [diff] [blame] | 49 | @UnsupportedAppUsage |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 50 | void setIconVisibility(String slot, boolean visible); |
Andrei Onea | fa152f9 | 2019-02-27 15:58:05 +0000 | [diff] [blame] | 51 | @UnsupportedAppUsage |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 52 | void removeIcon(String slot); |
lumark | 7570cac | 2019-03-07 22:14:38 +0800 | [diff] [blame] | 53 | void setImeWindowStatus(int displayId, in IBinder token, int vis, int backDisposition, |
Tarandeep Singh | 07b318b | 2019-07-17 11:12:04 -0700 | [diff] [blame] | 54 | boolean showImeSwitcher, boolean isMultiClientImeEnabled); |
Jason Monk | a992732 | 2015-12-13 16:22:37 -0500 | [diff] [blame] | 55 | void expandSettingsPanel(String subPanel); |
Joe Onorato | 2314aab | 2010-04-08 16:41:23 -0500 | [diff] [blame] | 56 | |
| 57 | // ---- Methods below are for use by the status bar policy services ---- |
Joe Onorato | 8bc6c51 | 2010-06-04 16:21:12 -0400 | [diff] [blame] | 58 | // You need the STATUS_BAR_SERVICE permission |
Yohei Yukawa | 49efa71 | 2019-04-04 11:49:02 -0700 | [diff] [blame] | 59 | RegisterStatusBarResult registerStatusBar(IStatusBar callbacks); |
Chris Wren | b659c4f | 2015-06-25 17:12:27 -0400 | [diff] [blame] | 60 | void onPanelRevealed(boolean clearNotificationEffects, int numItems); |
Christoph Studer | 760ea55 | 2014-03-21 13:10:21 +0100 | [diff] [blame] | 61 | void onPanelHidden(); |
Christoph Studer | 1f32c65 | 2014-11-26 15:32:20 +0100 | [diff] [blame] | 62 | // Mark current notifications as "seen" and stop ringing, vibrating, blinking. |
| 63 | void clearNotificationEffects(); |
Dieter Hsu | d39f0d5 | 2018-04-14 02:08:30 +0800 | [diff] [blame] | 64 | void onNotificationClick(String key, in NotificationVisibility nv); |
Tony Mak | 7d4b3a5 | 2018-11-27 17:29:36 +0000 | [diff] [blame] | 65 | void onNotificationActionClick(String key, int actionIndex, in Notification.Action action, in NotificationVisibility nv, boolean generatedByAssistant); |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 66 | void onNotificationError(String pkg, String tag, int id, |
Kenny Guy | 3a7c4a56 | 2014-03-03 18:24:03 +0000 | [diff] [blame] | 67 | int uid, int initialPid, String message, int userId); |
| 68 | void onClearAllNotifications(int userId); |
Dieter Hsu | d39f0d5 | 2018-04-14 02:08:30 +0800 | [diff] [blame] | 69 | void onNotificationClear(String pkg, String tag, int id, int userId, String key, |
Julia Reynolds | fd4099d | 2018-08-21 11:06:06 -0400 | [diff] [blame] | 70 | int dismissalSurface, int dismissalSentiment, in NotificationVisibility nv); |
Chris Wren | d1dbc92 | 2015-06-19 17:51:16 -0400 | [diff] [blame] | 71 | void onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys, |
| 72 | in NotificationVisibility[] noLongerVisibleKeys); |
Gustav Sennton | a8e38aa | 2019-01-22 14:55:39 +0000 | [diff] [blame] | 73 | void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded, in int notificationLocation); |
Julia Reynolds | 503ed94 | 2017-10-04 16:04:56 -0400 | [diff] [blame] | 74 | void onNotificationDirectReplied(String key); |
Gustav Sennton | d25a64d | 2018-12-07 10:58:39 +0000 | [diff] [blame] | 75 | void onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount, |
Milo Sredkov | 13d8811 | 2019-02-01 12:23:24 +0000 | [diff] [blame] | 76 | boolean generatedByAsssistant, boolean editBeforeSending); |
| 77 | void onNotificationSmartReplySent(in String key, in int replyIndex, in CharSequence reply, |
| 78 | in int notificationLocation, boolean modifiedBeforeSending); |
Julia Reynolds | 503ed94 | 2017-10-04 16:04:56 -0400 | [diff] [blame] | 79 | void onNotificationSettingsViewed(String key); |
Mady Mellor | a54e9fa | 2019-04-18 13:26:18 -0700 | [diff] [blame] | 80 | void onNotificationBubbleChanged(String key, boolean isBubble); |
Mady Mellor | f44b683 | 2020-01-14 13:26:14 -0800 | [diff] [blame] | 81 | void onBubbleNotificationSuppressionChanged(String key, boolean isSuppressed); |
Aran Ink | 979c976 | 2019-10-24 16:09:45 -0400 | [diff] [blame] | 82 | void grantInlineReplyUriPermission(String key, in Uri uri, in UserHandle user, String packageName); |
| 83 | void clearInlineReplyUriPermissions(String key); |
Jason Monk | 7e53f20 | 2016-01-28 10:40:20 -0500 | [diff] [blame] | 84 | |
Jason Monk | 361915c | 2017-03-21 20:33:59 -0400 | [diff] [blame] | 85 | 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 Monk | 7e53f20 | 2016-01-28 10:40:20 -0500 | [diff] [blame] | 94 | void addTile(in ComponentName tile); |
| 95 | void remTile(in ComponentName tile); |
| 96 | void clickTile(in ComponentName tile); |
Andrei Onea | fa152f9 | 2019-02-27 15:58:05 +0000 | [diff] [blame] | 97 | @UnsupportedAppUsage |
Philip Quinn | c3a503d | 2017-07-18 23:23:41 -0700 | [diff] [blame] | 98 | void handleSystemKey(in int key); |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 99 | |
Matthew Ng | 9c3bce5 | 2018-02-01 22:00:31 +0000 | [diff] [blame] | 100 | /** |
| 101 | * Methods to show toast messages for screen pinning |
| 102 | */ |
| 103 | void showPinningEnterExitToast(boolean entering); |
| 104 | void showPinningEscapeToast(); |
| 105 | |
Kevin Chyn | 86f1b8e | 2019-09-24 19:00:49 -0700 | [diff] [blame] | 106 | // 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 Matyukhin | 0f9da35 | 2019-10-03 14:10:01 -0700 | [diff] [blame] | 109 | // Used to notify the authentication dialog that a biometric has been authenticated |
| 110 | void onBiometricAuthenticated(); |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 111 | // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 112 | void onBiometricHelp(String message); |
Ilya Matyukhin | 0f9da35 | 2019-10-03 14:10:01 -0700 | [diff] [blame] | 113 | // 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 Chyn | 86f1b8e | 2019-09-24 19:00:49 -0700 | [diff] [blame] | 115 | // Used to hide the authentication dialog, e.g. when the application cancels authentication |
| 116 | void hideAuthenticationDialog(); |
Robert Horvath | 5560f38 | 2019-07-10 10:46:38 +0200 | [diff] [blame] | 117 | |
| 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 Horvath | 60e51fe | 2019-08-20 13:10:34 +0200 | [diff] [blame] | 126 | void dismissInattentiveSleepWarning(boolean animated); |
Winson Chung | b53b30c | 2019-11-18 21:03:09 -0800 | [diff] [blame] | 127 | |
| 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 Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 142 | } |