OSDN Git Service

Fix VerifyCredentialResponse parcelling code
authorRubin Xu <rubinxu@google.com>
Wed, 7 Feb 2018 08:10:08 +0000 (08:10 +0000)
committerandroid-build-team Robot <android-build-team-robot@google.com>
Thu, 8 Feb 2018 04:11:44 +0000 (04:11 +0000)
There was an asymmetry between parcelling and unparcelling of
VerifyCredentialResponse that could lead to type confusion if
packed with other objects in a Parcel.

Test: none
Bug: 71714464
Change-Id: Icff68879e249422ccca49f2bb7db85c35b4cb353
(cherry picked from commit 54813e988884f0d604d5358569f10feda8622f46)

core/java/com/android/internal/widget/VerifyCredentialResponse.java

index ad6020c..7d1c706 100644 (file)
@@ -98,6 +98,8 @@ public final class VerifyCredentialResponse implements Parcelable {
             if (mPayload != null) {
                 dest.writeInt(mPayload.length);
                 dest.writeByteArray(mPayload);
+            } else {
+                dest.writeInt(0);
             }
         }
     }