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 /** 30 * Report that the keyguard is done. 31 * 32 * @param strongAuth whether the user has authenticated with strong authentication like 33 * pattern, password or PIN but not by trust agents or fingerprint 34 * @param targetUserId a user that needs to be the foreground user at the completion. 35 */ 36 void keyguardDone(boolean strongAuth, int targetUserId); 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 /** 50 * Report that the keyguard is dismissable, pending the next keyguardDone call. 51 * 52 * @param strongAuth whether the user has authenticated with strong authentication like 53 * pattern, password or PIN but not by trust agents or fingerprint 54 * @param targetUserId a user that needs to be the foreground user at the completion. 55 */ 56 void keyguardDonePending(boolean strongAuth, int targetUserId); 57 58 /** 59 * Report when keyguard is actually gone 60 */ 61 void keyguardGone(); 62 63 /** 64 * Report when the UI is ready for dismissing the whole Keyguard. 65 */ 66 void readyForKeyguardDone(); 67 68 /** 69 * Reset the keyguard and bouncer. 70 */ 71 void resetKeyguard(); 72 73 /** 74 * Play the "device trusted" sound. 75 */ 76 void playTrustedSound(); 77 78 /** 79 * @return true if the screen is on 80 */ 81 boolean isScreenOn(); 82 83 /** 84 * @return one of the reasons why the bouncer needs to be shown right now and the user can't use 85 * his normal unlock method like fingerprint or trust agents. See 86 * {@link KeyguardSecurityView#PROMPT_REASON_NONE}, 87 * {@link KeyguardSecurityView#PROMPT_REASON_RESTART} and 88 * {@link KeyguardSecurityView#PROMPT_REASON_TIMEOUT}. 89 */ 90 int getBouncerPromptReason(); 91 92 /** 93 * Invoked when the secondary display showing a keyguard window changes. 94 */ 95 void onSecondaryDisplayShowingChanged(int displayId); 96 } 97