Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 4 | * 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 Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 9 | * 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 Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 13 | */ |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 14 | |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 15 | package com.android.systemui.statusbar; |
| 16 | |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 17 | import android.content.pm.UserInfo; |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 18 | import android.util.SparseArray; |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 19 | |
Ned Burns | f81c4c4 | 2019-01-07 14:10:43 -0500 | [diff] [blame] | 20 | import com.android.systemui.statusbar.notification.collection.NotificationEntry; |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 21 | |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 22 | public interface NotificationLockscreenUserManager { |
| 23 | String PERMISSION_SELF = "com.android.systemui.permission.SELF"; |
| 24 | String NOTIFICATION_UNLOCKED_BY_WORK_CHALLENGE_ACTION |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 25 | = "com.android.systemui.statusbar.work_challenge_unlocked_notification_action"; |
| 26 | |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 27 | boolean shouldAllowLockscreenRemoteInput(); |
Evan Laird | db601aa | 2018-09-18 17:47:46 -0400 | [diff] [blame] | 28 | |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 29 | /** |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 30 | * @param userId user Id |
| 31 | * @return true if we re on a secure lock screen |
Chad Brubaker | ea8c5ef | 2018-03-15 16:37:43 -0700 | [diff] [blame] | 32 | */ |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 33 | boolean isLockscreenPublicMode(int userId); |
Chad Brubaker | ea8c5ef | 2018-03-15 16:37:43 -0700 | [diff] [blame] | 34 | |
Selim Cinek | 6f0a62a | 2019-04-09 18:40:12 -0700 | [diff] [blame] | 35 | /** |
| 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 Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 43 | void setUpWithPresenter(NotificationPresenter presenter); |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 44 | |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 45 | int getCurrentUserId(); |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 46 | |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 47 | boolean isCurrentProfile(int userId); |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 48 | |
Gus Prevas | a18dc57 | 2019-01-14 16:11:22 -0500 | [diff] [blame] | 49 | /** Adds a listener to be notified when the current user changes. */ |
| 50 | void addUserChangedListener(UserChangedListener listener); |
| 51 | |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 52 | SparseArray<UserInfo> getCurrentProfiles(); |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 53 | |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 54 | void setLockscreenPublicMode(boolean isProfilePublic, int userId); |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 55 | |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 56 | boolean shouldShowLockscreenNotifications(); |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 57 | |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 58 | boolean shouldHideNotifications(int userId); |
| 59 | boolean shouldHideNotifications(String key); |
Ned Burns | 8c1b763 | 2019-07-19 14:26:15 -0400 | [diff] [blame] | 60 | boolean shouldShowOnKeyguard(NotificationEntry entry); |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 61 | |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 62 | boolean isAnyProfilePublicMode(); |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 63 | |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 64 | void updatePublicMode(); |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 65 | |
Ned Burns | f81c4c4 | 2019-01-07 14:10:43 -0500 | [diff] [blame] | 66 | boolean needsRedaction(NotificationEntry entry); |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 67 | |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 68 | boolean userAllowsPrivateNotificationsInPublic(int currentUserId); |
Gus Prevas | a18dc57 | 2019-01-14 16:11:22 -0500 | [diff] [blame] | 69 | |
| 70 | /** Notified when the current user changes. */ |
| 71 | interface UserChangedListener { |
| 72 | void onUserChanged(int userId); |
| 73 | } |
Eliot Courtney | 0932228 | 2017-11-09 15:31:19 +0900 | [diff] [blame] | 74 | } |