1 /* 2 * Copyright (C) 2022 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.systemui.biometrics; 18 19 import android.annotation.Nullable; 20 21 /** 22 * Interface for toggling the optimal display mode for the under-display fingerprint sensor 23 * (UDFPS). For example, the implementation might change the refresh rate and activate a 24 * high-brightness mode. 25 */ 26 public interface UdfpsDisplayModeProvider { 27 28 /** 29 * Enables the optimal display mode for UDFPS. The mode will persist until 30 * {@link #disable(Runnable)} is called. 31 * 32 * This call must be made from the UI thread. The callback, if provided, will also be invoked 33 * from the UI thread. 34 * 35 * @param onEnabled A runnable that will be executed once the mode is enabled. 36 */ enable(@ullable Runnable onEnabled)37 void enable(@Nullable Runnable onEnabled); 38 39 /** 40 * Disables the mode that was enabled by {@link #enable(Runnable)}. 41 * 42 * The call must be made from the UI thread. The callback, if provided, will also be invoked 43 * from the UI thread. 44 * 45 * @param onDisabled A runnable that will be executed once mode is disabled. 46 */ disable(@ullable Runnable onDisabled)47 void disable(@Nullable Runnable onDisabled); 48 } 49