Camera: Fix OutputConfiguration equality check

For the non deferred configuration, equals() and hashCode() show
different behavior when the number of surfaces changes.
Thus, the camera device could try to create a stream using an already
configured surface.

This patch fixed the issue by checking the size of surface list in
equals() for the non deferred configuration.

Bug: 306364653
Test: CameraCTS, Manual test with OEM scenario
Change-Id: Ifea113606dd3489a29bf94ec76f6f8a8a4547d16
diff --git a/core/java/android/hardware/camera2/params/OutputConfiguration.java b/core/java/android/hardware/camera2/params/OutputConfiguration.java
index 21540bf..d6c58ac 100644
--- a/core/java/android/hardware/camera2/params/OutputConfiguration.java
+++ b/core/java/android/hardware/camera2/params/OutputConfiguration.java
@@ -1403,6 +1403,7 @@
                 if (mSurfaces.get(i) != other.mSurfaces.get(i))
                     return false;
             }
+            if (!mIsDeferredConfig && mSurfaces.size() != other.mSurfaces.size()) return false;
             if (mDynamicRangeProfile != other.mDynamicRangeProfile) {
                 return false;
             }