Allow factory reset without PERSISTENT_DATA_BLOCK_SERVICE

Currently factory reset action is ignored if
PERSISTENT_DATA_BLOCK_SERVICE isn't presented on device.
Make sure that we can execute regular factory reset without
it by utilizing the logic from shouldWipePersistentDataBlock.

Test: manual verify on aosp build
Bug: 129137473
Bug: 196634851
Change-Id: I2abcb93cbc0872dd920c1dd62152596ddd723691
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
This commit is contained in:
Dmitrii Merkurev
2023-06-19 21:06:25 +01:00
parent 675179075c
commit d7d4ec224f

View File

@@ -86,13 +86,14 @@ public class MainClearConfirm extends InstrumentedFragment {
return;
}
final PersistentDataBlockManager pdbManager;
// pre-flight check hardware support PersistentDataBlockManager
if (SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP).equals("")) {
return;
}
final PersistentDataBlockManager pdbManager = (PersistentDataBlockManager)
if (!SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP).equals("")) {
pdbManager = (PersistentDataBlockManager)
getActivity().getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE);
} else {
pdbManager = null;
}
if (shouldWipePersistentDataBlock(pdbManager)) {