• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 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.settings.biometrics.fingerprint;
18 
19 import android.content.Context;
20 import android.content.Intent;
21 import android.os.Bundle;
22 
23 import androidx.annotation.NonNull;
24 import androidx.annotation.Nullable;
25 
26 import com.android.settings.biometrics.fingerprint.feature.ChallengeGeneratedInvoker;
27 import com.android.settings.biometrics.fingerprint.feature.FingerprintExtPreferencesProvider;
28 import com.android.settings.biometrics.fingerprint.feature.SfpsEnrollmentFeature;
29 import com.android.settings.biometrics.fingerprint.feature.SfpsRestToUnlockFeature;
30 
31 import java.util.Collections;
32 import java.util.List;
33 
34 public interface FingerprintFeatureProvider {
35     /**
36      * Gets the feature implementation of SFPS enrollment.
37      * @return the feature implementation
38      */
getSfpsEnrollmentFeature()39     SfpsEnrollmentFeature getSfpsEnrollmentFeature();
40 
41     /**
42      * Gets calibrator for udfps pre-enroll
43      * @param appContext application context
44      * @param activitySavedInstanceState activity savedInstanceState
45      * @param activityIntent activity intent
46      */
47     @Nullable
getUdfpsEnrollCalibrator(@onNull Context appContext, @Nullable Bundle activitySavedInstanceState, @Nullable Intent activityIntent)48     default UdfpsEnrollCalibrator getUdfpsEnrollCalibrator(@NonNull Context appContext,
49             @Nullable Bundle activitySavedInstanceState, @Nullable Intent activityIntent) {
50         return null;
51     }
52 
53     /**
54      * Gets the feature implementation of SFPS rest to unlock.
55      * @param context context
56      * @return the feature implementation
57      */
getSfpsRestToUnlockFeature(@onNull Context context)58     SfpsRestToUnlockFeature getSfpsRestToUnlockFeature(@NonNull Context context);
59 
60     /**
61      * Gets the provider for current fingerprint enrollment activity classes
62      * @return the provider
63      */
64     @NonNull
getEnrollActivityClassProvider(@onNull Context context)65     default FingerprintEnrollActivityClassProvider getEnrollActivityClassProvider(@NonNull Context context) {
66         return FingerprintEnrollActivityClassProvider.getInstance();
67     }
68 
69     /**
70      * Gets new Preferences in Fingerprint Settings
71      */
72     @NonNull
getExtPreferenceProvider( @onNull Context context )73     default FingerprintExtPreferencesProvider getExtPreferenceProvider(
74             @NonNull Context context
75     ) {
76         return new FingerprintExtPreferencesProvider(context);
77     }
78 
79     /**
80      * Gets the feature provider for FingerprintSettings page
81      * @return the provider
82      */
83     @NonNull
getFingerprintSettingsFeatureProvider()84     default FingerprintSettingsFeatureProvider getFingerprintSettingsFeatureProvider() {
85         return FingerprintSettingsFeatureProvider.getInstance();
86     }
87 
88     @NonNull
getChallengeGeneratedInvokers()89     default List<ChallengeGeneratedInvoker> getChallengeGeneratedInvokers() {
90         return Collections.emptyList();
91     }
92 }
93