Skip to content
Commit 929af52c authored by Eric Biggers's avatar Eric Biggers
Browse files

Fix downgrades on device with FRP enabled

Unfortunately, non-forwards-compatible changes to the PasswordData
format break setting up an older version of Android on a device that had
Factory Reset Protection (FRP) set up on a newer version.

Commit 23070d87 ("Added changes for storing PIN length in
PasswordData") (http://ag/21983004) made a non-forwards-compatible
change to the PasswordData format by reusing the first two bytes of the
credentialType field as a version number.

Therefore, undo that part of the change, and just use the data length to
determine whether the new pinLength field is present or not.

Bug: 276780938
Test: atest com.android.server.locksettings
Test: Reproduced the bug by flashing udc-dev, adding Google account and
      PIN, then flashing latest public build (TQ2A.230505.002).  Could
      not complete the setup wizard.  Then did the same with udc-dev +
      this CL.  Was able to complete setup wizard on public build.
      Also tested the same thing for udc-dev + this CL => udc-dev.
Test: Manually tested upgrades: udc-dev => udc-dev + this CL, and
      latest public build (TQ2A.230505.002) => udc-dev + this CL.
      Specifically, tested that if a PIN was set before, the device can
      still be unlocked using the PIN afterwards.
Test: Tested changing the PIN on udc-dev + this CL.
Change-Id: Ibf3c91d14a0c6bd9af4403b080532f2739fde119
parent f91a331f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment