1 /* 2 * Copyright (C) 2020 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.cts.verifier.biometrics; 18 19 import android.security.keystore.KeyProperties; 20 21 import com.android.cts.verifier.R; 22 23 public class UserAuthenticationBiometricMacTest extends AbstractUserAuthenticationMacTest { 24 private static final String TAG = "UserAuthenticationBiometricMacTest"; 25 26 @Override getTag()27 String getTag() { 28 return TAG; 29 } 30 31 @Override getInstructionsResourceId()32 int getInstructionsResourceId() { 33 return R.string.biometric_test_set_user_authentication_biometric_instructions; 34 } 35 36 @Override getExpectedResults()37 ExpectedResults getExpectedResults() { 38 return new ExpectedResults() { 39 @Override 40 boolean shouldCredentialUnlockPerUseKey() { 41 return false; 42 } 43 44 @Override 45 boolean shouldCredentialUnlockTimedKey() { 46 return false; 47 } 48 49 @Override 50 boolean shouldBiometricUnlockPerUseKey() { 51 return true; 52 } 53 54 @Override 55 boolean shouldBiometricUnlockTimedKey() { 56 return true; 57 } 58 }; 59 } 60 61 @Override 62 int getKeyAuthenticators() { 63 return KeyProperties.AUTH_BIOMETRIC_STRONG; 64 } 65 } 66