A security vulnerability was discovered by Android security. b/292548775 Within a short period of time after the device reboot, the user could enter the settings page and factory reset the device. Android Enterprise suggests to add DISALLOW_FACTORY_RESET user restriction to the device.
However, DISALLOW_FACTORY_RESET will be enabled on all Android users, including both the admin user and the demo user. The existing behavior in Android settings is that once the user restriction is set, factory reset button will be greyed out, which makes the factory reset functionality in demo user go away.
In demo user, the factory reset command will be forwarded to the current active device owner. So in this change, we separate the button for admin user and the button for demo user.
In demo user, the button is still visible when the restriction is set.
And in admin user, the button will be greyed out as expected.
Once this change is in, then Pixel Retail Demo could set the user restriction properly and rely on its internal logic to do factory reset. If other applications are trying to do the factory reset, it will be denied by OS.
BUG: 292548775
Change-Id: I9d2d47bb29bc2c1e05058b246908768cd2f95990
This page usd SetupWizard them, so we should not set paddingStart
Bug: 223514471
Test: visual verify
Change-Id: I3a02be7534c6571c8d6735c5592ad4230a7c9e9e
It is never the case that '!isExternalStorageEmulated() &&
!isExternalStorageRemovable() && isExtStorageEncrypted()', so stop
checking for this.
It's easy to see that even just the last part, isExtStorageEncrypted(),
is never true, since it checks whether the property "vold.decrypt" is
non-empty. That system property was only set on devices that used FDE
(Full Disk Encryption), and FDE support was removed in Android T.
Moreover, the full condition of '!emulated && !removable && FDE'
actually checked for devices that used multi-volume FDE, which
apparently was never actually used, and was removed 8 years ago by vold
commit 87999173dd79 (http://ag/423222). This is consistent with the
fact that this code was added 11 years ago by commit 2a32192329
(http://ag/134210), when probably this feature was still planned.
Bug: 208476087
Change-Id: I4c2b5c9aed8812367a70d0dd1bbcc94008fec529
After applying a collapsing toolbar in the Settings app, the factory
reset screen is not displayed correctly. This is because
1) the factory reset page should not essentially have a toolbar since it
has different UI layout form other pages.
2) this page was launched previously as a SubSettings so it applied a
wrong theme.
This change is mainly updating the inheritence structure and specifying
the right theme for the factory reset page in order to have a correct
layout.
Bug: 179457252
Test: robotests and visual verified
Change-Id: I91aec65a120d5a288507d89ace7c9298acdca42b
Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference
Bug: 161896447
Test: robotest & manual
Change-Id: I94969f6903d047b9bc41b1e8c14096c92c460b38