1dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller/*
2dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller * Copyright (C) 2012 The Android Open Source Project
3dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller *
4dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller * Licensed under the Apache License, Version 2.0 (the "License");
5dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller * you may not use this file except in compliance with the License.
6dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller * You may obtain a copy of the License at
7dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller *
8dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller *      http://www.apache.org/licenses/LICENSE-2.0
9dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller *
10dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller * Unless required by applicable law or agreed to in writing, software
11dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller * distributed under the License is distributed on an "AS IS" BASIS,
12dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller * See the License for the specific language governing permissions and
14dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller * limitations under the License.
15dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller */
165ecd81154fa039961f65bb4e36d18ac555b0d1d6Jim Millerpackage com.android.keyguard;
17dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller
1814adfe425e67c9ec12b0841a62c5c03ce00838eaJohn Spurlockpublic interface KeyguardSecurityCallback {
1934c4fe523ad96fb59cec28832b38806d04a6bebfJohn Spurlock
20dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller    /**
21dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller     * Dismiss the given security screen.
22dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller     * @param securityVerified true if the user correctly entered credentials for the given screen.
238702ca7e2d6a1a66e580d039a1f662cfb94ee4acVadim Tryshev     * @param targetUserId a user that needs to be the foreground user at the dismissal completion.
24dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller     */
258702ca7e2d6a1a66e580d039a1f662cfb94ee4acVadim Tryshev    void dismiss(boolean securityVerified, int targetUserId);
26dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller
27dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller    /**
28b690f0d5023fcf144f2701058d5a6f88d66cc97aJorim Jaggi     * Manually report user activity to keep the device awake.
29dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller     */
30b690f0d5023fcf144f2701058d5a6f88d66cc97aJorim Jaggi    void userActivity();
31dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller
32dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller    /**
33dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller     * Checks if keyguard is in "verify credentials" mode.
34dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller     * @return true if user has been asked to verify security.
35dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller     */
36dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller    boolean isVerifyUnlockOnly();
37dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller
38dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller    /**
395a8daad469c22b9b48fdf3ac478991e4ddefdf1eJim Miller     * Call to report an unlock attempt.
40ce64cea38389a75def2f3d933a007515af288714Xiyuan Xia     * @param userId id of the user whose unlock attempt is recorded.
415a8daad469c22b9b48fdf3ac478991e4ddefdf1eJim Miller     * @param success set to 'true' if user correctly entered security credentials.
422397427cb1a0bad8a42e6a342dcf29b31e40a234Andres Morales     * @param timeoutMs timeout in milliseconds to wait before reattempting an unlock.
432397427cb1a0bad8a42e6a342dcf29b31e40a234Andres Morales     *                  Only nonzero if 'success' is false
44dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller     */
45ce64cea38389a75def2f3d933a007515af288714Xiyuan Xia    void reportUnlockAttempt(int userId, boolean success, int timeoutMs);
46dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller
4772b46d429cbab54af962c25ffe087c5f927f7340Andrew Lee    /**
4872b46d429cbab54af962c25ffe087c5f927f7340Andrew Lee     * Resets the keyguard view.
4972b46d429cbab54af962c25ffe087c5f927f7340Andrew Lee     */
5072b46d429cbab54af962c25ffe087c5f927f7340Andrew Lee    void reset();
51dcb3d84b82cc2448d04e73359a716581bfb657dbJim Miller}
52