Merge "Fix exception on non face-enabled devices" into qt-r1-dev am: 1a3112ab32

am: d3e686fc33

Change-Id: I067abe881c9ac0f511cf184343c12a6ac74d1e9d
This commit is contained in:
Lucas Dupin
2019-05-30 21:33:17 -07:00
committed by android-build-merger

View File

@@ -17,6 +17,7 @@
package com.android.settings.security; package com.android.settings.security;
import android.content.Context; import android.content.Context;
import android.content.pm.PackageManager;
import android.hardware.face.FaceManager; import android.hardware.face.FaceManager;
import android.provider.Settings; import android.provider.Settings;
@@ -30,7 +31,9 @@ public class LockscreenBypassPreferenceController extends TogglePreferenceContro
public LockscreenBypassPreferenceController(Context context, String preferenceKey) { public LockscreenBypassPreferenceController(Context context, String preferenceKey) {
super(context, preferenceKey); super(context, preferenceKey);
mFaceManager = context.getSystemService(FaceManager.class); if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE)) {
mFaceManager = context.getSystemService(FaceManager.class);
}
} }
@Override @Override