Send "early canceled" to privileged clients

The navigation bar dismissal animation caused by "activity finish"
should be invoked in some cases immediately when the user
cancels authentication. Add a "early user cancel" message
for ConfirmDeviceCredentialActivity to subscribe to. This
message is sent immediately when the user invokes a back gesture or
cancels authentication.

Bug: 148273355

Test: Set up work profile with separate password and biometric
      Unlock work profile
      Lock screen
      Open work profile app
      Cancel authentication at various states in various ways
      Notice no navigation bar jank

Test: atest com.android.systemui.biometrics

Change-Id: I89c5b5e2782339cae15f936268e6e7b8ad4e5359
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
index c30477c..0c6794c 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
@@ -165,6 +165,19 @@
     }
 
     @Override
+    public void onSystemEvent(int event) {
+        if (mReceiver == null) {
+            Log.e(TAG, "onSystemEvent(" + event + "): Receiver is null");
+            return;
+        }
+        try {
+            mReceiver.onSystemEvent(event);
+        } catch (RemoteException e) {
+            Log.e(TAG, "RemoteException when sending system event", e);
+        }
+    }
+
+    @Override
     public void onDismissed(@DismissedReason int reason, @Nullable byte[] credentialAttestation) {
         switch (reason) {
             case AuthDialogCallback.DISMISSED_USER_CANCELED: