Personally, I think it'd be better for the service to return null rather
than throwing an error if it doesn't exisit but according to b/ throwing
is WAI.
Test: try running any test that might use ExandableNotificationRow on a
device without face service and see that an exception isn't thrown
Bug:
135475155
Change-Id: I6cf7f3d39f411dc88d5fd75da0adb2c612acf880
package com.android.systemui.statusbar.phone
import android.content.Context
+import android.content.pm.PackageManager
import android.hardware.biometrics.BiometricSourceType
import android.hardware.face.FaceManager
import android.provider.Settings
}
}
})
+ if (!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE)) {
+ return
+ }
val faceManager = context.getSystemService(FaceManager::class.java)
if (faceManager?.isHardwareDetected != true) {
return