Jorim Jaggi | 5cf1787 | 2014-03-26 18:31:48 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 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 |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 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 |
| 14 | * limitations under the License |
| 15 | */ |
| 16 | |
| 17 | package com.android.keyguard; |
| 18 | |
| 19 | /** |
| 20 | * The callback used by the keyguard view to tell the {@link KeyguardViewMediator} |
| 21 | * various things. |
| 22 | */ |
| 23 | public interface ViewMediatorCallback { |
| 24 | /** |
| 25 | * Reports user activity and requests that the screen stay on. |
| 26 | */ |
| 27 | void userActivity(); |
| 28 | |
| 29 | /** |
Jorim Jaggi | 5cf1787 | 2014-03-26 18:31:48 +0100 | [diff] [blame] | 30 | * Report that the keyguard is done. |
| 31 | * @param authenticated Whether the user securely got past the keyguard. |
| 32 | * the only reason for this to be false is if the keyguard was instructed |
| 33 | * to appear temporarily to verify the user is supposed to get past the |
| 34 | * keyguard, and the user fails to do so. |
| 35 | */ |
| 36 | void keyguardDone(boolean authenticated); |
| 37 | |
| 38 | /** |
| 39 | * Report that the keyguard is done drawing. |
| 40 | */ |
| 41 | void keyguardDoneDrawing(); |
| 42 | |
| 43 | /** |
| 44 | * Tell ViewMediator that the current view needs IME input |
| 45 | * @param needsInput |
| 46 | */ |
| 47 | void setNeedsInput(boolean needsInput); |
| 48 | |
| 49 | /** |
Jorim Jaggi | 5cf1787 | 2014-03-26 18:31:48 +0100 | [diff] [blame] | 50 | * Report that the keyguard is dismissable, pending the next keyguardDone call. |
| 51 | */ |
| 52 | void keyguardDonePending(); |
| 53 | |
| 54 | /** |
| 55 | * Report when keyguard is actually gone |
| 56 | */ |
| 57 | void keyguardGone(); |
Jorim Jaggi | 8de4311c | 2014-08-11 22:36:20 +0200 | [diff] [blame] | 58 | |
| 59 | /** |
| 60 | * Report when the UI is ready for dismissing the whole Keyguard. |
| 61 | */ |
| 62 | void readyForKeyguardDone(); |
Adrian Roos | 49e057d | 2014-08-13 17:14:51 +0200 | [diff] [blame] | 63 | |
| 64 | /** |
Andrew Lee | 72b46d4 | 2015-01-30 13:23:21 -0800 | [diff] [blame] | 65 | * Reset the keyguard and bouncer. |
| 66 | */ |
| 67 | void resetKeyguard(); |
| 68 | |
| 69 | /** |
Adrian Roos | 49e057d | 2014-08-13 17:14:51 +0200 | [diff] [blame] | 70 | * Play the "device trusted" sound. |
| 71 | */ |
| 72 | void playTrustedSound(); |
Jim Miller | ab95454 | 2014-10-10 18:21:49 -0700 | [diff] [blame] | 73 | |
| 74 | /** |
| 75 | * @return true if and only if Keyguard is showing or if Keyguard is disabled by an external app |
| 76 | * (legacy API) |
| 77 | */ |
| 78 | boolean isInputRestricted(); |
Adrian Roos | 94e15a5 | 2015-04-16 12:23:18 -0700 | [diff] [blame] | 79 | |
| 80 | /** |
| 81 | * @return true if the screen is on |
| 82 | */ |
| 83 | boolean isScreenOn(); |
Selim Cinek | 3122fa8 | 2015-06-18 01:38:59 -0700 | [diff] [blame] | 84 | |
| 85 | /** |
| 86 | * @return one of the reasons why the bouncer needs to be shown right now and the user can't use |
| 87 | * his normal unlock method like fingerprint or trust agents. See |
| 88 | * {@link KeyguardSecurityView#PROMPT_REASON_NONE} |
| 89 | * and {@link KeyguardSecurityView#PROMPT_REASON_RESTART}. |
| 90 | */ |
| 91 | int getBouncerPromptReason(); |
Jorim Jaggi | 5cf1787 | 2014-03-26 18:31:48 +0100 | [diff] [blame] | 92 | } |