Rename AoD to Aod
Bug: 205915651 Test: atest FrameworksServicesTests:com.android.server.biometrics Test: atest CtsBiometricsTestCases Change-Id: Id399cd701d697d6862205a2375b6d8dc53db551c
This commit is contained in:
@@ -44,7 +44,7 @@ public interface BiometricContext {
|
||||
@Nullable Integer getBiometricPromptSessionId();
|
||||
|
||||
/** If the display is in AOD. */
|
||||
boolean isAoD();
|
||||
boolean isAod();
|
||||
|
||||
/**
|
||||
* Subscribe to context changes.
|
||||
|
||||
@@ -120,7 +120,7 @@ class BiometricContextProvider implements BiometricContext {
|
||||
@Override
|
||||
public OperationContext updateContext(@NonNull OperationContext operationContext,
|
||||
boolean isCryptoOperation) {
|
||||
operationContext.isAoD = isAoD();
|
||||
operationContext.isAod = isAod();
|
||||
operationContext.isCrypto = isCryptoOperation;
|
||||
setFirstSessionId(operationContext);
|
||||
return operationContext;
|
||||
@@ -160,7 +160,7 @@ class BiometricContextProvider implements BiometricContext {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAoD() {
|
||||
public boolean isAod() {
|
||||
return mIsDozing && mAmbientDisplayConfiguration.alwaysOnEnabled(UserHandle.USER_CURRENT);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ class BiometricContextProvider implements BiometricContext {
|
||||
|
||||
private void notifySubscribers() {
|
||||
mSubscribers.forEach((context, consumer) -> {
|
||||
context.isAoD = isAoD();
|
||||
context.isAod = isAod();
|
||||
consumer.accept(context);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class BiometricFrameworkStatsLogger {
|
||||
-1 /* sensorId */,
|
||||
operationContext.id,
|
||||
sessionType(operationContext.reason),
|
||||
operationContext.isAoD);
|
||||
operationContext.isAod);
|
||||
}
|
||||
|
||||
/** {@see FrameworkStatsLog.BIOMETRIC_AUTHENTICATED}. */
|
||||
@@ -77,7 +77,7 @@ public class BiometricFrameworkStatsLogger {
|
||||
ambientLightLux,
|
||||
operationContext.id,
|
||||
sessionType(operationContext.reason),
|
||||
operationContext.isAoD);
|
||||
operationContext.isAod);
|
||||
}
|
||||
|
||||
/** {@see FrameworkStatsLog.BIOMETRIC_ENROLLED}. */
|
||||
@@ -109,7 +109,7 @@ public class BiometricFrameworkStatsLogger {
|
||||
-1 /* sensorId */,
|
||||
operationContext.id,
|
||||
sessionType(operationContext.reason),
|
||||
operationContext.isAoD);
|
||||
operationContext.isAod);
|
||||
}
|
||||
|
||||
/** {@see FrameworkStatsLog.BIOMETRIC_SYSTEM_HEALTH_ISSUE_DETECTED}. */
|
||||
|
||||
@@ -229,7 +229,7 @@ class FingerprintAuthenticationClient extends AuthenticationClient<AidlSession>
|
||||
context.y = y;
|
||||
context.minor = minor;
|
||||
context.major = major;
|
||||
context.isAoD = getBiometricContext().isAoD();
|
||||
context.isAod = getBiometricContext().isAod();
|
||||
session.getSession().onPointerDownWithContext(context);
|
||||
} else {
|
||||
session.getSession().onPointerDown(0 /* pointerId */, x, y, minor, major);
|
||||
|
||||
@@ -213,7 +213,7 @@ class FingerprintEnrollClient extends EnrollClient<AidlSession> implements Udfps
|
||||
context.y = y;
|
||||
context.minor = minor;
|
||||
context.major = major;
|
||||
context.isAoD = getBiometricContext().isAoD();
|
||||
context.isAod = getBiometricContext().isAod();
|
||||
session.getSession().onPointerDownWithContext(context);
|
||||
} else {
|
||||
session.getSession().onPointerDown(0 /* pointerId */, x, y, minor, major);
|
||||
|
||||
@@ -88,27 +88,27 @@ public class BiometricContextProviderTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsAoD() throws RemoteException {
|
||||
public void testIsAod() throws RemoteException {
|
||||
mListener.onDozeChanged(true);
|
||||
assertThat(mProvider.isAoD()).isTrue();
|
||||
assertThat(mProvider.isAod()).isTrue();
|
||||
mListener.onDozeChanged(false);
|
||||
assertThat(mProvider.isAoD()).isFalse();
|
||||
assertThat(mProvider.isAod()).isFalse();
|
||||
|
||||
when(mAmbientDisplayConfiguration.alwaysOnEnabled(anyInt())).thenReturn(false);
|
||||
mListener.onDozeChanged(true);
|
||||
assertThat(mProvider.isAoD()).isFalse();
|
||||
assertThat(mProvider.isAod()).isFalse();
|
||||
mListener.onDozeChanged(false);
|
||||
assertThat(mProvider.isAoD()).isFalse();
|
||||
assertThat(mProvider.isAod()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSubscribesToAoD() throws RemoteException {
|
||||
public void testSubscribesToAod() throws RemoteException {
|
||||
final List<Boolean> expected = ImmutableList.of(true, false, true, true, false);
|
||||
final List<Boolean> actual = new ArrayList<>();
|
||||
|
||||
mProvider.subscribe(mOpContext, ctx -> {
|
||||
assertThat(ctx).isSameInstanceAs(mOpContext);
|
||||
actual.add(ctx.isAoD);
|
||||
actual.add(ctx.isAod);
|
||||
});
|
||||
|
||||
for (boolean v : expected) {
|
||||
@@ -178,7 +178,7 @@ public class BiometricContextProviderTest {
|
||||
assertThat(context).isSameInstanceAs(mOpContext);
|
||||
assertThat(mOpContext.id).isEqualTo(0);
|
||||
assertThat(mOpContext.reason).isEqualTo(OperationReason.UNKNOWN);
|
||||
assertThat(mOpContext.isAoD).isEqualTo(false);
|
||||
assertThat(mOpContext.isAod).isEqualTo(false);
|
||||
assertThat(mOpContext.isCrypto).isEqualTo(false);
|
||||
|
||||
for (int type : List.of(StatusBarManager.SESSION_BIOMETRIC_PROMPT,
|
||||
@@ -192,7 +192,7 @@ public class BiometricContextProviderTest {
|
||||
assertThat(context).isSameInstanceAs(mOpContext);
|
||||
assertThat(mOpContext.id).isEqualTo(id);
|
||||
assertThat(mOpContext.reason).isEqualTo(reason(type));
|
||||
assertThat(mOpContext.isAoD).isEqualTo(aod);
|
||||
assertThat(mOpContext.isAod).isEqualTo(aod);
|
||||
assertThat(mOpContext.isCrypto).isEqualTo(false);
|
||||
|
||||
mSessionListener.onSessionEnded(type, InstanceId.fakeInstanceId(id));
|
||||
@@ -202,7 +202,7 @@ public class BiometricContextProviderTest {
|
||||
assertThat(context).isSameInstanceAs(mOpContext);
|
||||
assertThat(mOpContext.id).isEqualTo(0);
|
||||
assertThat(mOpContext.reason).isEqualTo(OperationReason.UNKNOWN);
|
||||
assertThat(mOpContext.isAoD).isEqualTo(false);
|
||||
assertThat(mOpContext.isAod).isEqualTo(false);
|
||||
assertThat(mOpContext.isCrypto).isEqualTo(false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user