OSDN Git Service

Fix erasing of eSIMs for some devices
authorAntony Sargent <asargent@google.com>
Thu, 11 Jul 2019 18:04:09 +0000 (11:04 -0700)
committerandroid-build-team Robot <android-build-team-robot@google.com>
Fri, 12 Jul 2019 04:10:26 +0000 (04:10 +0000)
commit8d2baf64c7d3bc6fc1167a574f989c6476467db5
treeb6db4966eb3b810e8512b98e9e82bd0835dcc2e1
parent58949a7d723046ed0664178bfa4e3a3bfc113ec2
Fix erasing of eSIMs for some devices

Doing a factory data reset used to always erase eSIMs. Then a few months
ago we added a default-on checkbox to let users opt out of erasing the
eSIM during this process, but only had it show for some devices (ones
which support the "fastboot oem esim_erase" command) by adding a system
property named masterclear.allow_retain_esim_profiles_after_fdr.

When recently updating the strings shown in the factory data reset
screen and the confirmation dialog, we changed the code so that if that
the checkbox is hidden we'll pass false for the ERASE_ESIMS_EXTRA
parameter sent to the factory data reset confirmation dialog. This had
the unintended side effect of making devices that don't specify true for
masterclear.allow_retain_esim_profiles_after_fdr skip erasing the eSIM.

This CL fixes that by removing the "is the checkbox hidden" check, going
back to the previous behavior of just using the checkbox value, which is
on by default even if hidden.

Fixes: 135284765
Test: make RunSettingsRoboTests
Change-Id: Ia9f335920e4e3c4a90f0a6a49d1722a0c19ea83d
(cherry picked from commit 5f612a4b442494d08259a976eccb7192ffa0c534)
src/com/android/settings/MasterClear.java
tests/robotests/src/com/android/settings/MasterClearTest.java