Loading services/core/java/com/android/server/biometrics/sensors/BiometricScheduler.java +9 −4 Original line number Diff line number Diff line Loading @@ -635,11 +635,16 @@ public class BiometricScheduler { proto.write(BiometricSchedulerProto.CURRENT_OPERATION, mCurrentOperation != null ? mCurrentOperation.mClientMonitor.getProtoEnum() : BiometricsProto.CM_NONE); proto.write(BiometricSchedulerProto.TOTAL_OPERATIONS, mTotalOperationsHandled); Slog.d(getTag(), "Total operations: " + mTotalOperationsHandled); if (!mRecentOperations.isEmpty()) { for (int i = 0; i < mRecentOperations.size(); i++) { Slog.d(getTag(), "Operation: " + mRecentOperations.get(i)); proto.write(BiometricSchedulerProto.RECENT_OPERATIONS, mRecentOperations.get(i)); } } else { // TODO:(b/178828362) Unsure why protobuf has a problem decoding when an empty list // is returned. So, let's just add a no-op for this case. proto.write(BiometricSchedulerProto.RECENT_OPERATIONS, BiometricsProto.CM_NONE); } proto.flush(); if (clearSchedulerBuffer) { Loading services/tests/servicestests/src/com/android/server/biometrics/sensors/BiometricSchedulerTest.java +13 −4 Original line number Diff line number Diff line Loading @@ -196,7 +196,8 @@ public class BiometricSchedulerTest { BiometricSchedulerProto bsp = getDump(true /* clearSchedulerBuffer */); assertEquals(BiometricsProto.CM_NONE, bsp.currentOperation); assertEquals(0, bsp.totalOperations); assertEquals(0, bsp.recentOperations.length); // TODO:(b/178828362) See bug and/or commit message :/ // assertEquals(0, bsp.recentOperations.length); // Pretend the scheduler is busy enrolling, and check the proto dump again. final TestClientMonitor2 client = new TestClientMonitor2(mContext, mToken, Loading @@ -207,7 +208,11 @@ public class BiometricSchedulerTest { assertEquals(BiometricsProto.CM_ENROLL, bsp.currentOperation); // No operations have completed yet assertEquals(0, bsp.totalOperations); assertEquals(0, bsp.recentOperations.length); // TODO:(b/178828362) See bug and/or commit message :/ assertEquals(1, bsp.recentOperations.length); assertEquals(BiometricsProto.CM_NONE, bsp.recentOperations[0]); // Finish this operation, so the next scheduled one can start client.getCallback().onClientFinished(client, true); } Loading @@ -223,7 +228,8 @@ public class BiometricSchedulerTest { assertEquals(BiometricsProto.CM_ENROLL, bsp.currentOperation); // No operations have completed yet assertEquals(0, bsp.totalOperations); assertEquals(0, bsp.recentOperations.length); // TODO:(b/178828362) See bug and/or commit message :/ // assertEquals(0, bsp.recentOperations.length); // Finish this operation, so the next scheduled one can start client.getCallback().onClientFinished(client, true); Loading Loading @@ -265,7 +271,10 @@ public class BiometricSchedulerTest { // RecentOperations queue is cleared (by the previous dump) bsp = getDump(true /* clearSchedulerBuffer */); assertEquals(0, bsp.recentOperations.length); // TODO:(b/178828362) See bug and/or commit message :/ assertEquals(1, bsp.recentOperations.length); assertEquals(BiometricsProto.CM_NONE, bsp.recentOperations[0]); } @Test Loading Loading
services/core/java/com/android/server/biometrics/sensors/BiometricScheduler.java +9 −4 Original line number Diff line number Diff line Loading @@ -635,11 +635,16 @@ public class BiometricScheduler { proto.write(BiometricSchedulerProto.CURRENT_OPERATION, mCurrentOperation != null ? mCurrentOperation.mClientMonitor.getProtoEnum() : BiometricsProto.CM_NONE); proto.write(BiometricSchedulerProto.TOTAL_OPERATIONS, mTotalOperationsHandled); Slog.d(getTag(), "Total operations: " + mTotalOperationsHandled); if (!mRecentOperations.isEmpty()) { for (int i = 0; i < mRecentOperations.size(); i++) { Slog.d(getTag(), "Operation: " + mRecentOperations.get(i)); proto.write(BiometricSchedulerProto.RECENT_OPERATIONS, mRecentOperations.get(i)); } } else { // TODO:(b/178828362) Unsure why protobuf has a problem decoding when an empty list // is returned. So, let's just add a no-op for this case. proto.write(BiometricSchedulerProto.RECENT_OPERATIONS, BiometricsProto.CM_NONE); } proto.flush(); if (clearSchedulerBuffer) { Loading
services/tests/servicestests/src/com/android/server/biometrics/sensors/BiometricSchedulerTest.java +13 −4 Original line number Diff line number Diff line Loading @@ -196,7 +196,8 @@ public class BiometricSchedulerTest { BiometricSchedulerProto bsp = getDump(true /* clearSchedulerBuffer */); assertEquals(BiometricsProto.CM_NONE, bsp.currentOperation); assertEquals(0, bsp.totalOperations); assertEquals(0, bsp.recentOperations.length); // TODO:(b/178828362) See bug and/or commit message :/ // assertEquals(0, bsp.recentOperations.length); // Pretend the scheduler is busy enrolling, and check the proto dump again. final TestClientMonitor2 client = new TestClientMonitor2(mContext, mToken, Loading @@ -207,7 +208,11 @@ public class BiometricSchedulerTest { assertEquals(BiometricsProto.CM_ENROLL, bsp.currentOperation); // No operations have completed yet assertEquals(0, bsp.totalOperations); assertEquals(0, bsp.recentOperations.length); // TODO:(b/178828362) See bug and/or commit message :/ assertEquals(1, bsp.recentOperations.length); assertEquals(BiometricsProto.CM_NONE, bsp.recentOperations[0]); // Finish this operation, so the next scheduled one can start client.getCallback().onClientFinished(client, true); } Loading @@ -223,7 +228,8 @@ public class BiometricSchedulerTest { assertEquals(BiometricsProto.CM_ENROLL, bsp.currentOperation); // No operations have completed yet assertEquals(0, bsp.totalOperations); assertEquals(0, bsp.recentOperations.length); // TODO:(b/178828362) See bug and/or commit message :/ // assertEquals(0, bsp.recentOperations.length); // Finish this operation, so the next scheduled one can start client.getCallback().onClientFinished(client, true); Loading Loading @@ -265,7 +271,10 @@ public class BiometricSchedulerTest { // RecentOperations queue is cleared (by the previous dump) bsp = getDump(true /* clearSchedulerBuffer */); assertEquals(0, bsp.recentOperations.length); // TODO:(b/178828362) See bug and/or commit message :/ assertEquals(1, bsp.recentOperations.length); assertEquals(BiometricsProto.CM_NONE, bsp.recentOperations[0]); } @Test Loading