Commit Graph

14 Commits

Author SHA1 Message Date
Omer Ozer
3a8f193bb5 FactoryResetPreferenceController return null when permission isn't
grandted.

Flag: EXEMPT bugfix
Bug: 396580123
Test: manual
Change-Id: Id68dcebc600de21fddf8801757dfb56b92a1a773
2025-02-24 21:17:57 +00:00
James Willcox
0569121109 Add @RequiresPermission to ACTION_PREPARE_FACTORY_RESET
Also make it public. This should allow it to be detected appropriately
by the GMSCore permission registry machinery.

Bug; 346611867
Test: builds

Change-Id: I15aa99541f33124ab6aea284889351d86753fa56
2024-06-11 20:58:29 +00:00
Omer Ozer
4506b6287a Add get permissions flag to package info query in factory
reset preference controller.

Bug: 341802418
Test: manual
Change-Id: I1603662b706ec94e109afe957b585577876c8e75
2024-05-21 01:30:27 +00:00
Omer Ozer
acb58ebf42 Add factory reset wizard test coverage to
factory reset preference controller

Bug: 305244192
Test: RunSettingsRoboTests
Change-Id: I0c0a67b41cc73589863a71e24617451f5b49de5e
2024-01-16 23:25:52 +00:00
Omer Ozer
1d9c2a6f11 Change the existing permission to a system level perm
for factory reset prep.

Bug: 302016478
Test: local
Change-Id: If8ede49445ce1e26a77af04216654c8f9db9c421
2023-11-08 16:31:51 +00:00
Omer Ozer
e148ee7877 Add factory reset intent to the settings app.
Bug: 302016478
Test: local
Change-Id: I784395931b32746cb45a447b330ea8d57c17b2fe
2023-10-24 23:59:33 +00:00
Wentao Wang
a44e75d6ed Separate the demo user factory reset option with admin user factory reset option.
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
2023-09-13 11:47:11 +00:00
Mill Chen
1e607904c3 Update UI for factory reset flow
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
2021-02-25 16:32:50 +08:00
Fan Zhang
8722509eb9 Misc tweaks in settings
- Tweak layout for default sms picker icon. Now icons are aligned
  and forced to be in the same size
- Update string to use correct double-quote symbol
- Multiline title for some user & account setting

Change-Id: I27c1ed6459c5cd919778d535ab846b148a3f91b6
Fixes: 64285520
Fixes: 62891178
Fixes: 62265094
Fixes: 64363209
Test: robotests
Test: visual
2017-08-04 10:42:27 -07:00
Christine Franks
c6890ab6c5 Move logic for FR in demo mode out of Settings
Bug: 62712426
Test: make \
ROBOTEST_FILTER="(MasterClearTest|FactoryResetPreferenceControllerTest
|UtilsTest)" \
RunSettingsRoboTests -j100
Change-Id: I5e287c3d4a6a7050bda78187c52aec19e90b50bc
2017-07-21 19:19:19 +00:00
Tony Mantler
1d583e125f Make PreferenceController a mixin
Bug: 62912136
Test: Existing tests in BaseSearchIndexProviderTest
Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
2017-06-26 10:58:36 -07:00
Christine Franks
2d0293951a Allow FR in carrier demo mode
Bug: 62133292
Test: make RunSettingsRoboTests -j100, and manually verified FR is
available in carrier demo mode.

Change-Id: Ia793bf234b229da0490accfea6d44b72395a04bc
2017-05-31 12:04:01 -07:00
Fan Zhang
51059c5c91 Move reset options to one place
Change-Id: I419c16cbfc69861e01f28c14abdde137bd78f0bb
Fix: 36458355
Test: make RunSettingsRoboTests
2017-03-24 17:26:33 -07:00
Anton Philippov
66084a5368 Hide "Factory reset" item for secondary users
Bug: 35415714
Test: make RunSettingsRoboTests
Change-Id: I48d6d094476c5fc83dbc17906d84cc848e499624
2017-03-07 16:37:36 +00:00