blob: 343761430762258b92851a1ea82c2e0a6ef47acd [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;
Jason Monk7e53f202016-01-28 10:40:20 -050020import android.content.ComponentName;
Jorim Jaggi86905582016-02-09 21:36:09 -080021import android.graphics.Rect;
Jorim Jaggi165ce062015-07-06 16:18:11 -070022import android.os.Bundle;
23import android.service.notification.StatusBarNotification;
Kevin Chyn23289ef2018-11-28 16:32:36 -080024import android.hardware.biometrics.IBiometricServiceReceiverInternal;
Jorim Jaggi165ce062015-07-06 16:18:11 -070025
Joe Onorato0cbda992010-05-02 16:28:15 -070026import com.android.internal.statusbar.IStatusBar;
27import com.android.internal.statusbar.StatusBarIcon;
28import com.android.internal.statusbar.StatusBarIconList;
Chris Wrend1dbc922015-06-19 17:51:16 -040029import com.android.internal.statusbar.NotificationVisibility;
Joe Onorato2314aab2010-04-08 16:41:23 -050030
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080031/** @hide */
Joe Onorato25f95f92010-04-08 18:37:10 -050032interface IStatusBarService
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033{
Andrei Oneafa152f92019-02-27 15:58:05 +000034 @UnsupportedAppUsage
Daniel Sandler11cf1782012-09-27 14:03:08 -040035 void expandNotificationsPanel();
Andrei Oneafa152f92019-02-27 15:58:05 +000036 @UnsupportedAppUsage
Daniel Sandler11cf1782012-09-27 14:03:08 -040037 void collapsePanels();
Anthony Chen9ad00e02017-05-12 15:53:36 -070038 void togglePanel();
Andrei Oneafa152f92019-02-27 15:58:05 +000039 @UnsupportedAppUsage
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080040 void disable(int what, IBinder token, String pkg);
Benjamin Franzea2ec972015-03-16 17:18:09 +000041 void disableForUser(int what, IBinder token, String pkg, int userId);
Benjamin Franzcde0a2a2015-04-23 17:19:48 +010042 void disable2(int what, IBinder token, String pkg);
43 void disable2ForUser(int what, IBinder token, String pkg, int userId);
Evan Lairdedd016f2019-01-23 18:36:29 -050044 int[] getDisableFlags(IBinder token, int userId);
Svetoslav Ganov6179ea32011-06-28 01:12:41 -070045 void setIcon(String slot, String iconPackage, int iconId, int iconLevel, String contentDescription);
Andrei Oneafa152f92019-02-27 15:58:05 +000046 @UnsupportedAppUsage
Joe Onorato0cbda992010-05-02 16:28:15 -070047 void setIconVisibility(String slot, boolean visible);
Andrei Oneafa152f92019-02-27 15:58:05 +000048 @UnsupportedAppUsage
Joe Onorato0cbda992010-05-02 16:28:15 -070049 void removeIcon(String slot);
Charles Chen24e7a9f2018-11-21 11:59:07 +080050 // TODO(b/117478341): support back button change when IME is showing on a external display.
Jason Monkb605fec2014-05-02 17:04:10 -040051 void setImeWindowStatus(in IBinder token, int vis, int backDisposition,
52 boolean showImeSwitcher);
Jason Monka9927322015-12-13 16:22:37 -050053 void expandSettingsPanel(String subPanel);
Joe Onorato2314aab2010-04-08 16:41:23 -050054
55 // ---- Methods below are for use by the status bar policy services ----
Joe Onorato8bc6c512010-06-04 16:21:12 -040056 // You need the STATUS_BAR_SERVICE permission
Jason Monk07473ce2016-01-05 14:59:19 -050057 void registerStatusBar(IStatusBar callbacks, out List<String> iconSlots,
58 out List<StatusBarIcon> iconList,
Jorim Jaggi86905582016-02-09 21:36:09 -080059 out int[] switches, out List<IBinder> binders, out Rect fullscreenStackBounds,
60 out Rect dockedStackBounds);
Chris Wrenb659c4f2015-06-25 17:12:27 -040061 void onPanelRevealed(boolean clearNotificationEffects, int numItems);
Christoph Studer760ea552014-03-21 13:10:21 +010062 void onPanelHidden();
Christoph Studer1f32c652014-11-26 15:32:20 +010063 // Mark current notifications as "seen" and stop ringing, vibrating, blinking.
64 void clearNotificationEffects();
Dieter Hsud39f0d52018-04-14 02:08:30 +080065 void onNotificationClick(String key, in NotificationVisibility nv);
Tony Mak7d4b3a52018-11-27 17:29:36 +000066 void onNotificationActionClick(String key, int actionIndex, in Notification.Action action, in NotificationVisibility nv, boolean generatedByAssistant);
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -070067 void onNotificationError(String pkg, String tag, int id,
Kenny Guy3a7c4a52014-03-03 18:24:03 +000068 int uid, int initialPid, String message, int userId);
69 void onClearAllNotifications(int userId);
Dieter Hsud39f0d52018-04-14 02:08:30 +080070 void onNotificationClear(String pkg, String tag, int id, int userId, String key,
Julia Reynoldsfd4099d2018-08-21 11:06:06 -040071 int dismissalSurface, int dismissalSentiment, in NotificationVisibility nv);
Chris Wrend1dbc922015-06-19 17:51:16 -040072 void onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys,
73 in NotificationVisibility[] noLongerVisibleKeys);
Gustav Senntona8e38aa2019-01-22 14:55:39 +000074 void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded, in int notificationLocation);
Julia Reynolds503ed942017-10-04 16:04:56 -040075 void onNotificationDirectReplied(String key);
Gustav Senntond25a64d2018-12-07 10:58:39 +000076 void onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount,
Milo Sredkov13d88112019-02-01 12:23:24 +000077 boolean generatedByAsssistant, boolean editBeforeSending);
78 void onNotificationSmartReplySent(in String key, in int replyIndex, in CharSequence reply,
79 in int notificationLocation, boolean modifiedBeforeSending);
Julia Reynolds503ed942017-10-04 16:04:56 -040080 void onNotificationSettingsViewed(String key);
Charles Chen24e7a9f2018-11-21 11:59:07 +080081 void setSystemUiVisibility(int displayId, int vis, int mask, String cause);
Jason Monk7e53f202016-01-28 10:40:20 -050082
Jason Monk361915c2017-03-21 20:33:59 -040083 void onGlobalActionsShown();
84 void onGlobalActionsHidden();
85
86 /**
87 * These methods are needed for global actions control which the UI is shown in sysui.
88 */
89 void shutdown();
90 void reboot(boolean safeMode);
91
Jason Monk7e53f202016-01-28 10:40:20 -050092 void addTile(in ComponentName tile);
93 void remTile(in ComponentName tile);
94 void clickTile(in ComponentName tile);
Andrei Oneafa152f92019-02-27 15:58:05 +000095 @UnsupportedAppUsage
Philip Quinnc3a503d2017-07-18 23:23:41 -070096 void handleSystemKey(in int key);
Kevin Chynaae4a152018-01-18 11:48:09 -080097
Matthew Ng9c3bce52018-02-01 22:00:31 +000098 /**
99 * Methods to show toast messages for screen pinning
100 */
101 void showPinningEnterExitToast(boolean entering);
102 void showPinningEscapeToast();
103
Kevin Chyne9275662018-07-23 16:42:06 -0700104 // Used to show the dialog when BiometricService starts authentication
Kevin Chyn23289ef2018-11-28 16:32:36 -0800105 void showBiometricDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver, int type,
Kevin Chyn1b9f8df2018-11-12 19:04:55 -0800106 boolean requireConfirmation, int userId);
Kevin Chyne9275662018-07-23 16:42:06 -0700107 // Used to hide the dialog when a biometric is authenticated
Kevin Chyne1912712019-01-04 14:22:34 -0800108 void onBiometricAuthenticated(boolean authenticated);
Kevin Chynaae4a152018-01-18 11:48:09 -0800109 // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc
Kevin Chyne9275662018-07-23 16:42:06 -0700110 void onBiometricHelp(String message);
Kevin Chynaae4a152018-01-18 11:48:09 -0800111 // Used to set a message - the dialog will dismiss after a certain amount of time
Kevin Chyne9275662018-07-23 16:42:06 -0700112 void onBiometricError(String error);
113 // Used to hide the biometric dialog when the AuthenticationClient is stopped
114 void hideBiometricDialog();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800115}