Skip to content

Commit

Permalink
Allow factory reset without PERSISTENT_DATA_BLOCK_SERVICE
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dimorinny authored and benys committed Apr 22, 2024
1 parent 22870ce commit efd1280
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/com/android/settings/MainClearConfirm.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,14 @@ public void onClick(View v) {
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)) {

Expand Down

0 comments on commit efd1280

Please sign in to comment.