1 /* 2 * Copyright (C) 2014 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 */ 16 17 package com.android.keyguard; 18 19 /** 20 * The callback used by the keyguard view to tell the {@link KeyguardViewMediator} 21 * various things. 22 */ 23 public interface ViewMediatorCallback { 24 /** 25 * Reports user activity and requests that the screen stay on. 26 */ userActivity()27 void userActivity(); 28 29 /** 30 * Report that the keyguard is done. 31 * @param authenticated Whether the user securely got past the keyguard. 32 * the only reason for this to be false is if the keyguard was instructed 33 * to appear temporarily to verify the user is supposed to get past the 34 * keyguard, and the user fails to do so. 35 */ keyguardDone(boolean authenticated)36 void keyguardDone(boolean authenticated); 37 38 /** 39 * Report that the keyguard is done drawing. 40 */ keyguardDoneDrawing()41 void keyguardDoneDrawing(); 42 43 /** 44 * Tell ViewMediator that the current view needs IME input 45 * @param needsInput 46 */ setNeedsInput(boolean needsInput)47 void setNeedsInput(boolean needsInput); 48 49 /** 50 * Tell view mediator that the keyguard view's desired user activity timeout 51 * has changed and needs to be reapplied to the window. 52 */ onUserActivityTimeoutChanged()53 void onUserActivityTimeoutChanged(); 54 55 /** 56 * Report that the keyguard is dismissable, pending the next keyguardDone call. 57 */ keyguardDonePending()58 void keyguardDonePending(); 59 60 /** 61 * Report when keyguard is actually gone 62 */ keyguardGone()63 void keyguardGone(); 64 65 /** 66 * Report when the UI is ready for dismissing the whole Keyguard. 67 */ readyForKeyguardDone()68 void readyForKeyguardDone(); 69 70 /** 71 * Play the "device trusted" sound. 72 */ playTrustedSound()73 void playTrustedSound(); 74 75 /** 76 * @return true if and only if Keyguard is showing or if Keyguard is disabled by an external app 77 * (legacy API) 78 */ isInputRestricted()79 boolean isInputRestricted(); 80 } 81