blob: 4f139addb9a2df75c35a4a2b9f748c838838c7cb [file] [log] [blame]
Jim Millerdcb3d842012-08-23 19:18:12 -07001/*
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 */
Jim Miller5ecd8112013-01-09 18:50:26 -080016package com.android.keyguard;
Jim Millerdcb3d842012-08-23 19:18:12 -070017
Jim Miller5ecd8112013-01-09 18:50:26 -080018import com.android.keyguard.KeyguardHostView.OnDismissAction;
John Spurlock14adfe42012-11-08 10:29:26 -050019
Jim Millerdcb3d842012-08-23 19:18:12 -070020public 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 /**
Jim Miller258341c2012-08-30 16:50:10 -070058 * Shows the backup security for the current method. If none available, this call is a no-op.
Jim Millerdcb3d842012-08-23 19:18:12 -070059 */
Jim Miller258341c2012-08-30 16:50:10 -070060 void showBackupSecurity();
Jim Millerdcb3d842012-08-23 19:18:12 -070061
Jim Miller5f75aa12012-08-29 15:10:34 -070062 /**
John Spurlock34c4fe52012-11-07 10:12:29 -050063 * Sets an action to perform after the user successfully enters their credentials.
64 * @param action
Jim Miller5f75aa12012-08-29 15:10:34 -070065 */
John Spurlock34c4fe52012-11-07 10:12:29 -050066 void setOnDismissAction(OnDismissAction action);
Jim Miller5f75aa12012-08-29 15:10:34 -070067
Jim Millerdcb3d842012-08-23 19:18:12 -070068}