blob: dfeacf301de5f6498d08ef639db00491b42ec1a5 [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
18import com.android.internal.widget.LockPatternUtils;
19
20public interface KeyguardSecurityView {
Chris Wrena042ac92012-11-07 11:37:06 -050021 static public final int SCREEN_ON = 1;
22 static public final int VIEW_REVEALED = 2;
23
Jim Millerdcb3d842012-08-23 19:18:12 -070024 /**
25 * Interface back to keyguard to tell it when security
26 * @param callback
27 */
28 void setKeyguardCallback(KeyguardSecurityCallback callback);
29
30 /**
31 * Set {@link LockPatternUtils} object. Useful for providing a mock interface.
32 * @param utils
33 */
34 void setLockPatternUtils(LockPatternUtils utils);
35
36 /**
37 * Reset the view and prepare to take input. This should do things like clearing the
38 * password or pattern and clear error messages.
39 */
40 void reset();
41
42 /**
43 * Emulate activity life cycle within the view. When called, the view should clean up
44 * and prepare to be removed.
45 */
46 void onPause();
47
48 /**
49 * Emulate activity life cycle within this view. When called, the view should prepare itself
50 * to be shown.
Chris Wrena042ac92012-11-07 11:37:06 -050051 * @param reason the root cause of the event.
Jim Millerdcb3d842012-08-23 19:18:12 -070052 */
Chris Wrena042ac92012-11-07 11:37:06 -050053 void onResume(int reason);
Jim Millerdcb3d842012-08-23 19:18:12 -070054
55 /**
56 * Inquire whether this view requires IME (keyboard) interaction.
57 *
58 * @return true if IME interaction is required.
59 */
60 boolean needsInput();
61
62 /**
63 * Get {@link KeyguardSecurityCallback} for the given object
64 * @return KeyguardSecurityCallback
65 */
66 KeyguardSecurityCallback getCallback();
67
Jim Miller0b728242012-10-28 19:42:30 -070068 /**
69 * Instruct the view to show usability hints, if any.
70 *
71 */
Adam Cohen6fb841f2012-10-24 13:15:38 -070072 void showUsabilityHint();
Chris Wrenc0ae9e62012-11-05 13:16:31 -050073
74 /**
75 * Place the security view into bouncer mode.
76 * Animate transisiton if duration is non-zero.
77 * @param duration millisends for the transisiton animation.
78 */
79 void showBouncer(int duration);
80
81 /**
82 * Place the security view into non-bouncer mode.
83 * Animate transisiton if duration is non-zero.
84 * @param duration millisends for the transisiton animation.
85 */
86 void hideBouncer(int duration);
Jim Millerdcb3d842012-08-23 19:18:12 -070087}