1 /* 2 * Copyright (C) 2021 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 package com.android.settings.biometrics.combination; 17 18 import android.app.settings.SettingsEnums; 19 import android.content.Context; 20 21 import com.android.settings.R; 22 import com.android.settings.search.BaseSearchIndexProvider; 23 import com.android.settingslib.search.SearchIndexable; 24 25 /** 26 * Settings screen for multiple biometrics. 27 */ 28 @SearchIndexable 29 public class CombinedBiometricSettings extends BiometricsSettingsBase { 30 private static final String TAG = "BiometricSettings"; 31 private static final String KEY_FACE_SETTINGS = "biometric_face_settings"; 32 private static final String KEY_FINGERPRINT_SETTINGS = "biometric_fingerprint_settings"; 33 private static final String KEY_UNLOCK_PHONE = "biometric_settings_biometric_keyguard"; 34 private static final String KEY_USE_IN_APPS = "biometric_settings_biometric_app"; 35 36 @Override onAttach(Context context)37 public void onAttach(Context context) { 38 super.onAttach(context); 39 use(BiometricSettingsKeyguardPreferenceController.class).setUserId(mUserId); 40 use(BiometricSettingsAppPreferenceController.class).setUserId(mUserId); 41 } 42 43 @Override getPreferenceScreenResId()44 protected int getPreferenceScreenResId() { 45 return R.xml.security_settings_combined_biometric; 46 } 47 48 @Override getFacePreferenceKey()49 public String getFacePreferenceKey() { 50 return KEY_FACE_SETTINGS; 51 } 52 53 @Override getFingerprintPreferenceKey()54 public String getFingerprintPreferenceKey() { 55 return KEY_FINGERPRINT_SETTINGS; 56 } 57 58 @Override getUnlockPhonePreferenceKey()59 public String getUnlockPhonePreferenceKey() { 60 return KEY_UNLOCK_PHONE; 61 } 62 63 @Override getUseInAppsPreferenceKey()64 public String getUseInAppsPreferenceKey() { 65 return KEY_USE_IN_APPS; 66 } 67 68 @Override getLogTag()69 protected String getLogTag() { 70 return TAG; 71 } 72 73 @Override getMetricsCategory()74 public int getMetricsCategory() { 75 return SettingsEnums.COMBINED_BIOMETRIC; 76 } 77 78 public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = 79 new CombinedBiometricSearchIndexProvider(R.xml.security_settings_combined_biometric); 80 } 81