tps: Treat unmounted partition as locked
commitfee2cbf40bac21d314caac18ed94a9847582c5f8
authorsegfault <segfault@riseup.net>
Fri, 10 Feb 2023 10:44:32 +0000 (10 11:44 +0100)
committersegfault <segfault@riseup.net>
Fri, 10 Feb 2023 10:52:18 +0000 (10 11:52 +0100)
tree5ff3f4f6625418f8b890bd2cb3866aca1f29eeae
parent4f2028dd9b74acb906e9254f86dffcde9cc053ff
tps: Treat unmounted partition as locked

We know of two cases which causes the partition to be unlocked but not
mounted:

* User did some operations manually, e.g. via Disks (unlocked but not
  mounted or unmounted a previously unlocked partition).
* Unlocked successfully in the Welcome Screen but failed to mount with
  ext4 errors.

Previously, the frontend allowed users to try activate/deactivate
features when the partition was unlocked but not mounted. This resulted
in unhelpful error messages.

To avoid that, we now treat a partition in this state as locked. In this
state, the frontend currently tells the user:

    To use or configure your Persistent Storage, unlock it in the
    Welcome Screen when starting Tails.

Note that an Unlock call to the backend when in this state does correctly
mount the Persistent Storage.

Closes #19352
config/chroot_local-includes/usr/lib/python3/dist-packages/tps/device.py
config/chroot_local-includes/usr/lib/python3/dist-packages/tps/service.py