OSDN Git Service

DO NOT MERGE: Fix DPM.ACTION_SET_NEW_PASSWORD
[android-x86/packages-apps-Settings.git] / src / com / android / settings / password / FingerprintManagerWrapper.java
1 /*
2  * Copyright (C) 2016 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.password;
18
19 import android.annotation.NonNull;
20 import android.hardware.fingerprint.FingerprintManager;
21
22 import com.android.internal.util.Preconditions;
23
24 /**
25  * Wrapper of {@link FingerprintManager}. Workaround for roboelectic testing. See
26  * {@link IFingerprintManager} for details.
27  */
28 public class FingerprintManagerWrapper implements IFingerprintManager {
29     private @NonNull FingerprintManager mFingerprintManager;
30
31     public FingerprintManagerWrapper(@NonNull FingerprintManager fingerprintManager) {
32         Preconditions.checkNotNull(fingerprintManager);
33         mFingerprintManager = fingerprintManager;
34     }
35
36     public boolean isHardwareDetected() {
37         return mFingerprintManager.isHardwareDetected();
38     }
39
40     public boolean hasEnrolledFingerprints(int userId) {
41         return mFingerprintManager.hasEnrolledFingerprints(userId);
42     }
43
44     public long preEnroll() {
45         return mFingerprintManager.preEnroll();
46     }
47 }