Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dce1bf36 authored by Mady Mellor's avatar Mady Mellor
Browse files

Add check for the device having "feature face" before requesting the service

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/135475155
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
Merged-In: I6cf7f3d39f411dc88d5fd75da0adb2c612acf880
Change-Id: I6cf7f3d39f411dc88d5fd75da0adb2c612acf880
parent 0b8cb86f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
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
@@ -73,6 +74,9 @@ class KeyguardBypassController {
                }
            }
        })
        if (!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE)) {
            return
        }
        val faceManager = context.getSystemService(FaceManager::class.java)
        if (faceManager?.isHardwareDetected != true) {
            return