Merge "Disable setting if sensor is convenience." into sc-v2-dev am: 1ca42ffc79
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16233490 Change-Id: I9a4e565b311d7a65091aca5294879366b9399265
This commit is contained in:
@@ -19,13 +19,17 @@ package com.android.settings.biometrics.face;
|
|||||||
import static android.provider.Settings.Secure.FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION;
|
import static android.provider.Settings.Secure.FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.hardware.biometrics.SensorProperties;
|
||||||
import android.hardware.face.FaceManager;
|
import android.hardware.face.FaceManager;
|
||||||
|
import android.hardware.face.FaceSensorProperties;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
|
|
||||||
import com.android.settings.Utils;
|
import com.android.settings.Utils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Preference controller giving the user an option to always require confirmation.
|
* Preference controller giving the user an option to always require confirmation.
|
||||||
*/
|
*/
|
||||||
@@ -75,6 +79,14 @@ public class FaceSettingsConfirmPreferenceController extends FaceSettingsPrefere
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
return AVAILABLE;
|
List<FaceSensorProperties> properties = mFaceManager.getSensorProperties();
|
||||||
|
// If a sensor is convenience, it is possible that it becomes weak or strong with
|
||||||
|
// an update. For this reason, the sensor is conditionally unavailable.
|
||||||
|
if (!properties.isEmpty()
|
||||||
|
&& properties.get(0).getSensorStrength() == SensorProperties.STRENGTH_CONVENIENCE) {
|
||||||
|
return CONDITIONALLY_UNAVAILABLE;
|
||||||
|
} else {
|
||||||
|
return AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user