1 /* 2 * Copyright (C) 2012 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 package com.android.keyguard; 17 18 import com.android.keyguard.KeyguardHostView.OnDismissAction; 19 20 public interface KeyguardSecurityCallback { 21 22 /** 23 * Dismiss the given security screen. 24 * @param securityVerified true if the user correctly entered credentials for the given screen. 25 */ 26 void dismiss(boolean securityVerified); 27 28 /** 29 * Manually report user activity to keep the device awake. If timeout is 0, 30 * uses user-defined timeout. 31 * @param timeout 32 */ 33 void userActivity(long timeout); 34 35 /** 36 * Checks if keyguard is in "verify credentials" mode. 37 * @return true if user has been asked to verify security. 38 */ 39 boolean isVerifyUnlockOnly(); 40 41 /** 42 * Call when user correctly enters their credentials 43 */ 44 void reportSuccessfulUnlockAttempt(); 45 46 /** 47 * Call when the user incorrectly enters their credentials 48 */ 49 void reportFailedUnlockAttempt(); 50 51 /** 52 * Gets the number of attempts thus far as reported by {@link #reportFailedUnlockAttempt()} 53 * @return number of failed attempts 54 */ 55 int getFailedAttempts(); 56 57 /** 58 * Shows the backup security for the current method. If none available, this call is a no-op. 59 */ 60 void showBackupSecurity(); 61 62 /** 63 * Sets an action to perform after the user successfully enters their credentials. 64 * @param action 65 */ 66 void setOnDismissAction(OnDismissAction action); 67 68 } 69