Merge "Return immediately from isHardwareDetected" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
adf6f104ca
@@ -160,6 +160,13 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
||||
return "FaceProvider/" + mHalInstanceName;
|
||||
}
|
||||
|
||||
boolean hasHalInstance() {
|
||||
if (mTestHalEnabled) {
|
||||
return true;
|
||||
}
|
||||
return ServiceManager.checkService(IFace.DESCRIPTOR + "/" + mHalInstanceName) != null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@VisibleForTesting
|
||||
synchronized IFace getHalInstance() {
|
||||
@@ -291,7 +298,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
||||
|
||||
@Override
|
||||
public boolean isHardwareDetected(int sensorId) {
|
||||
return getHalInstance() != null;
|
||||
return hasHalInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -172,6 +172,14 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
|
||||
return "FingerprintProvider/" + mHalInstanceName;
|
||||
}
|
||||
|
||||
boolean hasHalInstance() {
|
||||
if (mTestHalEnabled) {
|
||||
return true;
|
||||
}
|
||||
return (ServiceManager.checkService(IFingerprint.DESCRIPTOR + "/" + mHalInstanceName)
|
||||
!= null);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@VisibleForTesting
|
||||
synchronized IFingerprint getHalInstance() {
|
||||
@@ -454,7 +462,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
|
||||
|
||||
@Override
|
||||
public boolean isHardwareDetected(int sensorId) {
|
||||
return getHalInstance() != null;
|
||||
return hasHalInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user