blob: 4cc5b2144adc451d8843bd8717bd6198a4a14476 [file] [log] [blame]
Eliot Courtney09322282017-11-09 15:31:19 +09001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
Jason Monk297c04e2018-08-23 17:16:59 -04004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
5 * except in compliance with the License. You may obtain a copy of the License at
Eliot Courtney09322282017-11-09 15:31:19 +09006 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
Jason Monk297c04e2018-08-23 17:16:59 -04009 * Unless required by applicable law or agreed to in writing, software distributed under the
10 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
11 * KIND, either express or implied. See the License for the specific language governing
12 * permissions and limitations under the License.
Eliot Courtney09322282017-11-09 15:31:19 +090013 */
Jason Monk297c04e2018-08-23 17:16:59 -040014
Eliot Courtney09322282017-11-09 15:31:19 +090015package com.android.systemui.statusbar;
16
Eliot Courtney09322282017-11-09 15:31:19 +090017import android.content.pm.UserInfo;
Eliot Courtney09322282017-11-09 15:31:19 +090018import android.util.SparseArray;
Eliot Courtney09322282017-11-09 15:31:19 +090019
Ned Burnsf81c4c42019-01-07 14:10:43 -050020import com.android.systemui.statusbar.notification.collection.NotificationEntry;
Eliot Courtney09322282017-11-09 15:31:19 +090021
Jason Monk297c04e2018-08-23 17:16:59 -040022public interface NotificationLockscreenUserManager {
23 String PERMISSION_SELF = "com.android.systemui.permission.SELF";
24 String NOTIFICATION_UNLOCKED_BY_WORK_CHALLENGE_ACTION
Eliot Courtney09322282017-11-09 15:31:19 +090025 = "com.android.systemui.statusbar.work_challenge_unlocked_notification_action";
26
Jason Monk297c04e2018-08-23 17:16:59 -040027 boolean shouldAllowLockscreenRemoteInput();
Evan Lairddb601aa2018-09-18 17:47:46 -040028
Eliot Courtney09322282017-11-09 15:31:19 +090029 /**
Jason Monk297c04e2018-08-23 17:16:59 -040030 * @param userId user Id
31 * @return true if we re on a secure lock screen
Chad Brubakerea8c5ef2018-03-15 16:37:43 -070032 */
Jason Monk297c04e2018-08-23 17:16:59 -040033 boolean isLockscreenPublicMode(int userId);
Chad Brubakerea8c5ef2018-03-15 16:37:43 -070034
Selim Cinek6f0a62a2019-04-09 18:40:12 -070035 /**
36 * Does a user require a separate work challenge? If so, the unlock mechanism is decoupled from
37 * the current user and has to be solved separately.
38 */
39 default boolean needsSeparateWorkChallenge(int userId) {
40 return false;
41 }
42
Jason Monk297c04e2018-08-23 17:16:59 -040043 void setUpWithPresenter(NotificationPresenter presenter);
Eliot Courtney09322282017-11-09 15:31:19 +090044
Jason Monk297c04e2018-08-23 17:16:59 -040045 int getCurrentUserId();
Eliot Courtney09322282017-11-09 15:31:19 +090046
Jason Monk297c04e2018-08-23 17:16:59 -040047 boolean isCurrentProfile(int userId);
Eliot Courtney09322282017-11-09 15:31:19 +090048
Gus Prevasa18dc572019-01-14 16:11:22 -050049 /** Adds a listener to be notified when the current user changes. */
50 void addUserChangedListener(UserChangedListener listener);
51
Jason Monk297c04e2018-08-23 17:16:59 -040052 SparseArray<UserInfo> getCurrentProfiles();
Eliot Courtney09322282017-11-09 15:31:19 +090053
Jason Monk297c04e2018-08-23 17:16:59 -040054 void setLockscreenPublicMode(boolean isProfilePublic, int userId);
Eliot Courtney09322282017-11-09 15:31:19 +090055
Jason Monk297c04e2018-08-23 17:16:59 -040056 boolean shouldShowLockscreenNotifications();
Eliot Courtney09322282017-11-09 15:31:19 +090057
Jason Monk297c04e2018-08-23 17:16:59 -040058 boolean shouldHideNotifications(int userId);
59 boolean shouldHideNotifications(String key);
Ned Burns8c1b7632019-07-19 14:26:15 -040060 boolean shouldShowOnKeyguard(NotificationEntry entry);
Eliot Courtney09322282017-11-09 15:31:19 +090061
Jason Monk297c04e2018-08-23 17:16:59 -040062 boolean isAnyProfilePublicMode();
Eliot Courtney09322282017-11-09 15:31:19 +090063
Jason Monk297c04e2018-08-23 17:16:59 -040064 void updatePublicMode();
Eliot Courtney09322282017-11-09 15:31:19 +090065
Ned Burnsf81c4c42019-01-07 14:10:43 -050066 boolean needsRedaction(NotificationEntry entry);
Eliot Courtney09322282017-11-09 15:31:19 +090067
Jason Monk297c04e2018-08-23 17:16:59 -040068 boolean userAllowsPrivateNotificationsInPublic(int currentUserId);
Gus Prevasa18dc572019-01-14 16:11:22 -050069
70 /** Notified when the current user changes. */
71 interface UserChangedListener {
72 void onUserChanged(int userId);
73 }
Eliot Courtney09322282017-11-09 15:31:19 +090074}