AF: Fix bug where Session#setViewStatesLocked doesn't clear response.

clearResponse=true doesn't clear the response if the `response` arg is non null.
The new behavior matches the corresponding logic for authenticated
responses above (lines 3197-3200).

This affects only 1 invoking method, replaceResponseLocked, which sets
the responses again soon after, so this change shouldn't affect any
behavior.

This change also fixes the javadoc for the method.

Bug: 152620157
Test: atest android.autofillservice.cts
Test: manual
Change-Id: I78262baa1c6c11ef7e4b3c12c2ecd3d9dd28bfd7
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index 55a9296..4b2e3b2 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -3226,7 +3226,7 @@
     }
 
     /**
-     * Sets the state of all views in the given dataset and response.
+     * Sets the state and response of all views in the given dataset.
      */
     @GuardedBy("mLock")
     private void setViewStatesLocked(@Nullable FillResponse response, @NonNull Dataset dataset,
@@ -3241,10 +3241,10 @@
             if (datasetId != null) {
                 viewState.setDatasetId(datasetId);
             }
-            if (response != null) {
-                viewState.setResponse(response);
-            } else if (clearResponse) {
+            if (clearResponse) {
                 viewState.setResponse(null);
+            } else if (response != null) {
+                viewState.setResponse(response);
             }
         }
     }