Merge "Clean up biometric AIDL binderDied handling" into sc-dev
This commit is contained in:
@@ -643,8 +643,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
|||||||
final Sensor sensor = mSensors.valueAt(i);
|
final Sensor sensor = mSensors.valueAt(i);
|
||||||
final int sensorId = mSensors.keyAt(i);
|
final int sensorId = mSensors.keyAt(i);
|
||||||
PerformanceTracker.getInstanceForSensorId(sensorId).incrementHALDeathCount();
|
PerformanceTracker.getInstanceForSensorId(sensorId).incrementHALDeathCount();
|
||||||
sensor.getScheduler().recordCrashState();
|
sensor.onBinderDied();
|
||||||
sensor.getScheduler().reset();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ import android.hardware.face.FaceManager;
|
|||||||
import android.hardware.face.FaceSensorPropertiesInternal;
|
import android.hardware.face.FaceSensorPropertiesInternal;
|
||||||
import android.hardware.keymaster.HardwareAuthToken;
|
import android.hardware.keymaster.HardwareAuthToken;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.IBinder;
|
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
@@ -63,7 +62,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* Maintains the state of a single sensor within an instance of the {@link IFace} HAL.
|
* Maintains the state of a single sensor within an instance of the {@link IFace} HAL.
|
||||||
*/
|
*/
|
||||||
public class Sensor implements IBinder.DeathRecipient {
|
public class Sensor {
|
||||||
|
|
||||||
private boolean mTestHalEnabled;
|
private boolean mTestHalEnabled;
|
||||||
|
|
||||||
@@ -481,7 +480,6 @@ public class Sensor implements IBinder.DeathRecipient {
|
|||||||
mTag, mScheduler, sensorId, userId, callback);
|
mTag, mScheduler, sensorId, userId, callback);
|
||||||
|
|
||||||
final ISession newSession = daemon.createSession(sensorId, userId, resultController);
|
final ISession newSession = daemon.createSession(sensorId, userId, resultController);
|
||||||
newSession.asBinder().linkToDeath(this, 0 /* flags */);
|
|
||||||
mCurrentSession = new Session(mTag, newSession, userId, resultController);
|
mCurrentSession = new Session(mTag, newSession, userId, resultController);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -523,24 +521,21 @@ public class Sensor implements IBinder.DeathRecipient {
|
|||||||
proto.end(sensorToken);
|
proto.end(sensorToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onBinderDied() {
|
||||||
public void binderDied() {
|
final BaseClientMonitor client = mScheduler.getCurrentClient();
|
||||||
Slog.e(mTag, "Binder died");
|
if (client instanceof Interruptable) {
|
||||||
mHandler.post(() -> {
|
Slog.e(mTag, "Sending ERROR_HW_UNAVAILABLE for client: " + client);
|
||||||
final BaseClientMonitor client = mScheduler.getCurrentClient();
|
final Interruptable interruptable = (Interruptable) client;
|
||||||
if (client instanceof Interruptable) {
|
interruptable.onError(FaceManager.FACE_ERROR_HW_UNAVAILABLE,
|
||||||
Slog.e(mTag, "Sending ERROR_HW_UNAVAILABLE for client: " + client);
|
0 /* vendorCode */);
|
||||||
final Interruptable interruptable = (Interruptable) client;
|
|
||||||
interruptable.onError(FaceManager.FACE_ERROR_HW_UNAVAILABLE,
|
|
||||||
0 /* vendorCode */);
|
|
||||||
|
|
||||||
mScheduler.recordCrashState();
|
FrameworkStatsLog.write(FrameworkStatsLog.BIOMETRIC_SYSTEM_HEALTH_ISSUE_DETECTED,
|
||||||
|
BiometricsProtoEnums.MODALITY_FACE,
|
||||||
|
BiometricsProtoEnums.ISSUE_HAL_DEATH);
|
||||||
|
}
|
||||||
|
|
||||||
FrameworkStatsLog.write(FrameworkStatsLog.BIOMETRIC_SYSTEM_HEALTH_ISSUE_DETECTED,
|
mScheduler.recordCrashState();
|
||||||
BiometricsProtoEnums.MODALITY_FACE,
|
mScheduler.reset();
|
||||||
BiometricsProtoEnums.ISSUE_HAL_DEATH);
|
mCurrentSession = null;
|
||||||
mCurrentSession = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -697,8 +697,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
|
|||||||
final Sensor sensor = mSensors.valueAt(i);
|
final Sensor sensor = mSensors.valueAt(i);
|
||||||
final int sensorId = mSensors.keyAt(i);
|
final int sensorId = mSensors.keyAt(i);
|
||||||
PerformanceTracker.getInstanceForSensorId(sensorId).incrementHALDeathCount();
|
PerformanceTracker.getInstanceForSensorId(sensorId).incrementHALDeathCount();
|
||||||
sensor.getScheduler().recordCrashState();
|
sensor.onBinderDied();
|
||||||
sensor.getScheduler().reset();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import android.hardware.fingerprint.FingerprintManager;
|
|||||||
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
|
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
|
||||||
import android.hardware.keymaster.HardwareAuthToken;
|
import android.hardware.keymaster.HardwareAuthToken;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.IBinder;
|
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
@@ -65,7 +64,7 @@ import java.util.Map;
|
|||||||
* {@link android.hardware.biometrics.fingerprint.IFingerprint} HAL.
|
* {@link android.hardware.biometrics.fingerprint.IFingerprint} HAL.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
class Sensor implements IBinder.DeathRecipient {
|
class Sensor {
|
||||||
|
|
||||||
private boolean mTestHalEnabled;
|
private boolean mTestHalEnabled;
|
||||||
|
|
||||||
@@ -461,7 +460,6 @@ class Sensor implements IBinder.DeathRecipient {
|
|||||||
mTag, mScheduler, sensorId, userId, callback);
|
mTag, mScheduler, sensorId, userId, callback);
|
||||||
|
|
||||||
final ISession newSession = daemon.createSession(sensorId, userId, resultController);
|
final ISession newSession = daemon.createSession(sensorId, userId, resultController);
|
||||||
newSession.asBinder().linkToDeath(this, 0 /* flags */);
|
|
||||||
mCurrentSession = new Session(mTag, newSession, userId, resultController);
|
mCurrentSession = new Session(mTag, newSession, userId, resultController);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -503,24 +501,21 @@ class Sensor implements IBinder.DeathRecipient {
|
|||||||
proto.end(sensorToken);
|
proto.end(sensorToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void onBinderDied() {
|
||||||
public void binderDied() {
|
final BaseClientMonitor client = mScheduler.getCurrentClient();
|
||||||
Slog.e(mTag, "Binder died");
|
if (client instanceof Interruptable) {
|
||||||
mHandler.post(() -> {
|
Slog.e(mTag, "Sending ERROR_HW_UNAVAILABLE for client: " + client);
|
||||||
final BaseClientMonitor client = mScheduler.getCurrentClient();
|
final Interruptable interruptable = (Interruptable) client;
|
||||||
if (client instanceof Interruptable) {
|
interruptable.onError(FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE,
|
||||||
Slog.e(mTag, "Sending ERROR_HW_UNAVAILABLE for client: " + client);
|
0 /* vendorCode */);
|
||||||
final Interruptable interruptable = (Interruptable) client;
|
|
||||||
interruptable.onError(FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE,
|
|
||||||
0 /* vendorCode */);
|
|
||||||
|
|
||||||
mScheduler.recordCrashState();
|
FrameworkStatsLog.write(FrameworkStatsLog.BIOMETRIC_SYSTEM_HEALTH_ISSUE_DETECTED,
|
||||||
|
BiometricsProtoEnums.MODALITY_FINGERPRINT,
|
||||||
|
BiometricsProtoEnums.ISSUE_HAL_DEATH);
|
||||||
|
}
|
||||||
|
|
||||||
FrameworkStatsLog.write(FrameworkStatsLog.BIOMETRIC_SYSTEM_HEALTH_ISSUE_DETECTED,
|
mScheduler.recordCrashState();
|
||||||
BiometricsProtoEnums.MODALITY_FINGERPRINT,
|
mScheduler.reset();
|
||||||
BiometricsProtoEnums.ISSUE_HAL_DEATH);
|
mCurrentSession = null;
|
||||||
mCurrentSession = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user