Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e4d60d4 authored by Dmitrii Merkurev's avatar Dmitrii Merkurev Committed by Francesco "Dil3mm4" Manzo
Browse files

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: default avatarDmitrii Merkurev <dimorinny@google.com>
parent b2221f76
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -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)) {