Fix ServiceNotFoundException error log when pressing power button on a

device that doesn't have fingerprint sensor.

Test: verified that the error is gone on a watch
Change-Id: I9e15180b7f395d2e0fc3317f70daec44cf39ce81
This commit is contained in:
Josh Yang
2022-11-09 09:47:00 -08:00
parent 8e0eb90b06
commit 7d5f3fecad

View File

@@ -127,7 +127,7 @@ public class SideFpsEventHandler implements View.OnClickListener {
*/
public void notifyPowerPressed() {
Log.i(TAG, "notifyPowerPressed");
if (mFingerprintManager == null) {
if (mFingerprintManager == null && mSideFpsEventHandlerReady.get()) {
mFingerprintManager = mContext.getSystemService(FingerprintManager.class);
}
if (mFingerprintManager == null) {