Jim Miller | dcb3d84 | 2012-08-23 19:18:12 -0700 | [diff] [blame] | 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 | */ |
Jim Miller | 5ecd811 | 2013-01-09 18:50:26 -0800 | [diff] [blame] | 16 | package com.android.keyguard; |
Jim Miller | dcb3d84 | 2012-08-23 19:18:12 -0700 | [diff] [blame] | 17 | |
| 18 | import com.android.internal.widget.LockPatternUtils; |
| 19 | |
| 20 | public interface KeyguardSecurityView { |
Chris Wren | a042ac9 | 2012-11-07 11:37:06 -0500 | [diff] [blame] | 21 | static public final int SCREEN_ON = 1; |
| 22 | static public final int VIEW_REVEALED = 2; |
| 23 | |
Jim Miller | dcb3d84 | 2012-08-23 19:18:12 -0700 | [diff] [blame] | 24 | /** |
| 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 Wren | a042ac9 | 2012-11-07 11:37:06 -0500 | [diff] [blame] | 51 | * @param reason the root cause of the event. |
Jim Miller | dcb3d84 | 2012-08-23 19:18:12 -0700 | [diff] [blame] | 52 | */ |
Chris Wren | a042ac9 | 2012-11-07 11:37:06 -0500 | [diff] [blame] | 53 | void onResume(int reason); |
Jim Miller | dcb3d84 | 2012-08-23 19:18:12 -0700 | [diff] [blame] | 54 | |
| 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 Miller | 0b72824 | 2012-10-28 19:42:30 -0700 | [diff] [blame] | 68 | /** |
| 69 | * Instruct the view to show usability hints, if any. |
| 70 | * |
| 71 | */ |
Adam Cohen | 6fb841f | 2012-10-24 13:15:38 -0700 | [diff] [blame] | 72 | void showUsabilityHint(); |
Chris Wren | c0ae9e6 | 2012-11-05 13:16:31 -0500 | [diff] [blame] | 73 | |
| 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 Miller | dcb3d84 | 2012-08-23 19:18:12 -0700 | [diff] [blame] | 87 | } |