KeyguardSecurityView.java revision c0ae9e67ebe6f1298800feaed1b43e867139a904
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 */
16package com.android.internal.policy.impl.keyguard;
17
18import com.android.internal.widget.LockPatternUtils;
19
20public interface KeyguardSecurityView {
21    /**
22     * Interface back to keyguard to tell it when security
23     * @param callback
24     */
25    void setKeyguardCallback(KeyguardSecurityCallback callback);
26
27    /**
28     * Set {@link LockPatternUtils} object. Useful for providing a mock interface.
29     * @param utils
30     */
31    void setLockPatternUtils(LockPatternUtils utils);
32
33    /**
34     * Reset the view and prepare to take input. This should do things like clearing the
35     * password or pattern and clear error messages.
36     */
37    void reset();
38
39    /**
40     * Emulate activity life cycle within the view. When called, the view should clean up
41     * and prepare to be removed.
42     */
43    void onPause();
44
45    /**
46     * Emulate activity life cycle within this view.  When called, the view should prepare itself
47     * to be shown.
48     */
49    void onResume();
50
51    /**
52     * Inquire whether this view requires IME (keyboard) interaction.
53     *
54     * @return true if IME interaction is required.
55     */
56    boolean needsInput();
57
58    /**
59     * Get {@link KeyguardSecurityCallback} for the given object
60     * @return KeyguardSecurityCallback
61     */
62    KeyguardSecurityCallback getCallback();
63
64    /**
65     * Instruct the view to show usability hints, if any.
66     *
67     */
68    void showUsabilityHint();
69
70    /**
71     * Place the security view into bouncer mode.
72     * Animate transisiton if duration is non-zero.
73     * @param duration millisends for the transisiton animation.
74     */
75    void showBouncer(int duration);
76
77    /**
78     * Place the security view into non-bouncer mode.
79     * Animate transisiton if duration is non-zero.
80     * @param duration millisends for the transisiton animation.
81     */
82    void hideBouncer(int duration);
83}
84