Home | History | Annotate | Download | only in keyguard
      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  */
     16 
     17 package com.android.keyguard;
     18 
     19 import android.view.View;
     20 
     21 interface BiometricSensorUnlock {
     22     /**
     23      * Initializes the view provided for the biometric unlock UI to work within.  The provided area
     24      * completely covers the backup unlock mechanism.
     25      * @param biometricUnlockView View provided for the biometric unlock UI.
     26      */
     27     public void initializeView(View biometricUnlockView);
     28 
     29     /**
     30      * Indicates whether the biometric unlock is running.  Before
     31      * {@link BiometricSensorUnlock#start} is called, isRunning() returns false.  After a successful
     32      * call to {@link BiometricSensorUnlock#start}, isRunning() returns true until the biometric
     33      * unlock completes, {@link BiometricSensorUnlock#stop} has been called, or an error has
     34      * forced the biometric unlock to stop.
     35      * @return whether the biometric unlock is currently running.
     36      */
     37     public boolean isRunning();
     38 
     39     /**
     40      * Stops and removes the biometric unlock and shows the backup unlock
     41      */
     42     public void stopAndShowBackup();
     43 
     44     /**
     45      * Binds to the biometric unlock service and starts the unlock procedure.  Called on the UI
     46      * thread.
     47      * @return false if it can't be started or the backup should be used.
     48      */
     49     public boolean start();
     50 
     51     /**
     52      * Stops the biometric unlock procedure and unbinds from the service.  Called on the UI thread.
     53      * @return whether the biometric unlock was running when called.
     54      */
     55     public boolean stop();
     56 
     57     /**
     58      * Cleans up any resources used by the biometric unlock.
     59      */
     60     public void cleanUp();
     61 
     62     /**
     63      * Gets the Device Policy Manager quality of the biometric unlock sensor
     64      * (e.g., PASSWORD_QUALITY_BIOMETRIC_WEAK).
     65      * @return biometric unlock sensor quality, as defined by Device Policy Manager.
     66      */
     67     public int getQuality();
     68 }
     69