1/n: Use scheduleForSensor instead of directly accessing scheduler
Minor cleanup that allows us to restrict access/usage of the scheduler itself for cleaner and more robust future work. For example, if we want to abstract the scheduler away from the AIDL provider. Bug: 181984005 Test: atest CtsBiometricsTestCases Change-Id: I5850cae1f30f9479a29565b7b7c0d43108d0f7bd
This commit is contained in:
@@ -254,7 +254,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
||||
mContext.getOpPackageName(), sensorId,
|
||||
mSensors.get(sensorId).getAuthenticatorIds());
|
||||
|
||||
mSensors.get(sensorId).getScheduler().scheduleClientMonitor(client);
|
||||
scheduleForSensor(sensorId, client);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(getTag(), "Remote exception when scheduling loadAuthenticatorId"
|
||||
+ ", sensorId: " + sensorId
|
||||
@@ -268,7 +268,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
||||
final InvalidationRequesterClient<Face> client =
|
||||
new InvalidationRequesterClient<>(mContext, userId, sensorId,
|
||||
FaceUtils.getInstance(sensorId));
|
||||
mSensors.get(sensorId).getScheduler().scheduleClientMonitor(client);
|
||||
scheduleForSensor(sensorId, client);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
||||
final FaceInvalidationClient client = new FaceInvalidationClient(mContext,
|
||||
mSensors.get(sensorId).getLazySession(), userId, sensorId,
|
||||
mSensors.get(sensorId).getAuthenticatorIds(), callback);
|
||||
mSensors.get(sensorId).getScheduler().scheduleClientMonitor(client);
|
||||
scheduleForSensor(sensorId, client);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(getTag(), "Remote exception", e);
|
||||
}
|
||||
@@ -468,7 +468,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
||||
false /* requireConfirmation */, sensorId, isStrongBiometric, statsClient,
|
||||
mUsageStats, mSensors.get(sensorId).getLockoutCache(),
|
||||
allowBackgroundAuthentication);
|
||||
mSensors.get(sensorId).getScheduler().scheduleClientMonitor(client);
|
||||
scheduleForSensor(sensorId, client);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(getTag(), "Remote exception when scheduling authenticate", e);
|
||||
}
|
||||
@@ -523,7 +523,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
||||
opPackageName, FaceUtils.getInstance(sensorId), sensorId,
|
||||
mSensors.get(sensorId).getAuthenticatorIds());
|
||||
|
||||
mSensors.get(sensorId).getScheduler().scheduleClientMonitor(client);
|
||||
scheduleForSensor(sensorId, client);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(getTag(), "Remote exception when scheduling remove", e);
|
||||
}
|
||||
@@ -599,7 +599,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
||||
FaceUtils.getInstance(sensorId),
|
||||
mSensors.get(sensorId).getAuthenticatorIds());
|
||||
|
||||
mSensors.get(sensorId).getScheduler().scheduleClientMonitor(client, callback);
|
||||
scheduleForSensor(sensorId, client);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(getTag(), "Remote exception when scheduling internal cleanup", e);
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
|
||||
mSensors.get(sensorId).getLazySession(), userId,
|
||||
mContext.getOpPackageName(), sensorId,
|
||||
mSensors.get(sensorId).getAuthenticatorIds());
|
||||
mSensors.get(sensorId).getScheduler().scheduleClientMonitor(client);
|
||||
scheduleForSensor(sensorId, client);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(getTag(), "Remote exception when scheduling loadAuthenticatorId"
|
||||
+ ", sensorId: " + sensorId
|
||||
@@ -305,7 +305,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
|
||||
final InvalidationRequesterClient<Fingerprint> client =
|
||||
new InvalidationRequesterClient<>(mContext, userId, sensorId,
|
||||
FingerprintUtils.getInstance(sensorId));
|
||||
mSensors.get(sensorId).getScheduler().scheduleClientMonitor(client);
|
||||
scheduleForSensor(sensorId, client);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
|
||||
mSensors.get(sensorId).getLazySession(), token, callback, userId,
|
||||
opPackageName, sensorId, mUdfpsOverlayController, isStrongBiometric,
|
||||
statsClient);
|
||||
mSensors.get(sensorId).getScheduler().scheduleClientMonitor(client);
|
||||
scheduleForSensor(sensorId, client);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(getTag(), "Remote exception when scheduling finger detect", e);
|
||||
}
|
||||
@@ -492,7 +492,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
|
||||
false /* requireConfirmation */, sensorId, isStrongBiometric, statsClient,
|
||||
mTaskStackListener, mSensors.get(sensorId).getLockoutCache(),
|
||||
mUdfpsOverlayController, allowBackgroundAuthentication);
|
||||
mSensors.get(sensorId).getScheduler().scheduleClientMonitor(client);
|
||||
scheduleForSensor(sensorId, client);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(getTag(), "Remote exception when scheduling authenticate", e);
|
||||
}
|
||||
@@ -554,7 +554,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
|
||||
new ClientMonitorCallbackConverter(receiver), fingerprintIds, userId,
|
||||
opPackageName, FingerprintUtils.getInstance(sensorId), sensorId,
|
||||
mSensors.get(sensorId).getAuthenticatorIds());
|
||||
mSensors.get(sensorId).getScheduler().scheduleClientMonitor(client);
|
||||
scheduleForSensor(sensorId, client);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(getTag(), "Remote exception when scheduling remove", e);
|
||||
}
|
||||
@@ -583,7 +583,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
|
||||
mContext.getOpPackageName(), sensorId, enrolledList,
|
||||
FingerprintUtils.getInstance(sensorId),
|
||||
mSensors.get(sensorId).getAuthenticatorIds());
|
||||
mSensors.get(sensorId).getScheduler().scheduleClientMonitor(client, callback);
|
||||
scheduleForSensor(sensorId, client);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(getTag(), "Remote exception when scheduling internal cleanup", e);
|
||||
}
|
||||
@@ -627,7 +627,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
|
||||
new FingerprintInvalidationClient(mContext,
|
||||
mSensors.get(sensorId).getLazySession(), userId, sensorId,
|
||||
mSensors.get(sensorId).getAuthenticatorIds(), callback);
|
||||
mSensors.get(sensorId).getScheduler().scheduleClientMonitor(client);
|
||||
scheduleForSensor(sensorId, client);
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(getTag(), "Remote exception", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user