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;
|
return "FaceProvider/" + mHalInstanceName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean hasHalInstance() {
|
||||||
|
if (mTestHalEnabled) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return ServiceManager.checkService(IFace.DESCRIPTOR + "/" + mHalInstanceName) != null;
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
synchronized IFace getHalInstance() {
|
synchronized IFace getHalInstance() {
|
||||||
@@ -291,7 +298,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isHardwareDetected(int sensorId) {
|
public boolean isHardwareDetected(int sensorId) {
|
||||||
return getHalInstance() != null;
|
return hasHalInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -172,6 +172,14 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
|
|||||||
return "FingerprintProvider/" + mHalInstanceName;
|
return "FingerprintProvider/" + mHalInstanceName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean hasHalInstance() {
|
||||||
|
if (mTestHalEnabled) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return (ServiceManager.checkService(IFingerprint.DESCRIPTOR + "/" + mHalInstanceName)
|
||||||
|
!= null);
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
synchronized IFingerprint getHalInstance() {
|
synchronized IFingerprint getHalInstance() {
|
||||||
@@ -454,7 +462,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isHardwareDetected(int sensorId) {
|
public boolean isHardwareDetected(int sensorId) {
|
||||||
return getHalInstance() != null;
|
return hasHalInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user