Ensure feature is supported and enabled.

Fixes: 137285390
Test: Verified that SecuritySettings no longer crashes.
Test: Verified that this PrefenceController no longer shows up
if the device does not support it.
Test: Verified that this PreferenceController no longer
shows up when the work profile is disabled.

Change-Id: I10f015e18491b203db6f942f07034d55f620cfe5
diff --git a/src/com/android/settings/biometrics/face/FaceProfileStatusPreferenceController.java b/src/com/android/settings/biometrics/face/FaceProfileStatusPreferenceController.java
index eeb2cbf..56b325b 100644
--- a/src/com/android/settings/biometrics/face/FaceProfileStatusPreferenceController.java
+++ b/src/com/android/settings/biometrics/face/FaceProfileStatusPreferenceController.java
@@ -33,6 +33,11 @@
 
     @Override
     public int getAvailabilityStatus() {
+        // Check if Face for Profile is available.
+        final int isAvailable = super.getAvailabilityStatus();
+        if (isAvailable != AVAILABLE) {
+            return isAvailable;
+        }
         // Make the profile unsearchable so the user preference controller gets highlighted
         // when searched for.
         return AVAILABLE_UNSEARCHABLE;