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.fingerprint2.ui.viewmodel 18 19 /** Represents the fingerprint data nad the relevant state. */ 20 data class FingerprintStateViewModel( 21 val fingerprintViewModels: List<FingerprintViewModel>, 22 val canEnroll: Boolean, 23 val maxFingerprints: Int, 24 val hasSideFps: Boolean, 25 val pressToAuth: Boolean, 26 ) 27 28 data class FingerprintViewModel( 29 val name: String, 30 val fingerId: Int, 31 val deviceId: Long, 32 ) 33 34 sealed class FingerprintAuthAttemptViewModel { 35 data class Success( 36 val fingerId: Int, 37 ) : FingerprintAuthAttemptViewModel() 38 39 data class Error( 40 val error: Int, 41 val message: String, 42 ) : FingerprintAuthAttemptViewModel() 43 } 44