Skip to content

Commit efd1280

Browse files
dimorinnybenys
authored andcommitted
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>
1 parent 22870ce commit efd1280

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/com/android/settings/MainClearConfirm.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,14 @@ public void onClick(View v) {
8686
return;
8787
}
8888

89+
final PersistentDataBlockManager pdbManager;
8990
// pre-flight check hardware support PersistentDataBlockManager
90-
if (SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP).equals("")) {
91-
return;
92-
}
93-
94-
final PersistentDataBlockManager pdbManager = (PersistentDataBlockManager)
91+
if (!SystemProperties.get(PERSISTENT_DATA_BLOCK_PROP).equals("")) {
92+
pdbManager = (PersistentDataBlockManager)
9593
getActivity().getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE);
94+
} else {
95+
pdbManager = null;
96+
}
9697

9798
if (shouldWipePersistentDataBlock(pdbManager)) {
9899

0 commit comments

Comments
 (0)