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

Skip to content

feat: prevent eDrive from syncing files with Murena cloud while Murena SSO migration is running

Description

This MR prevents eDrive from syncing files with Murena cloud while the migration to Murena SSO via Account Manager is running on user's device.

Screenshots

Technical details

When user clicks on the Account Manager notification to migrate to Murena SSO, eDrive receives a broadcast in SsoMigrationReceiver. For this, a signature-level permission is introduced to ensure interoperability between eDrive and Account Manager.

The job of the SsoMigrationReceiver is to update MurenaSsoMigrationPreference which tracks the status of the migration — InProgress and Completed. This preference is updated with values coming from Account Manager in the BroadcastReceiver's intent, using extras.getBoolean(AccountManager.KEY_USERDATA).

As part of the SSO migration, a user's account is removed and added again. However, to prevent eDrive from syncing files during the migration, an early return is implemented on AccountAddedReceiver and AccountRemoveCallBackReceiver classes, based on the preference's value so that eDrive doesn't reset its setting.

To keep consistent checking for account names, a string utility method is added to remove the domain name from an account name, i.e. test.email@example.com will be reduced to test.email.

Tests

  1. Log in using username and password in Account Manager bundled with the OS.
  2. Let os-bundled eDrive finish syncing files.
  3. Install debug eDrive from MR.
  4. Install debug Account Manager from MR.
  5. Reboot device.
  6. After rebooting, observe a notification from Account Manager prompting you to switch to an improved login system.
  7. Click on the notification and observe Account Manager opens with your previous credentials removed and prompting you to provide a user ID.
  8. Observe that you cannot dismiss the notification.
  9. Complete login from browser and return to Account Manager
  10. Observe that the notification now disappears.
  11. Observe that eDrive doesn't start syncing files.
  12. Observe eDrive's sync works while adding, modifying, or deleting files.
  13. Now, reboot again.
  14. Observe that the notification is not there.
  15. Go to Account Manager and log out.
  16. Add account and observe OpenID Connect based login is there.
  17. Complete login (similar to step 9).
  18. Observe that eDrive starts syncing all the files from your device.

For Murena accounts using custom Nextcloud instance:

  1. Complete up to step 5.
  2. After rebooting, observe that the notification doesn't appear.

Issues

https://gitlab.e.foundation/e/os/backlog/-/issues/2097

10 commandments of code reviews

👪 ❤️ https://gitlab.e.foundation/internal/wiki/-/wikis/mobile-team/guidelines/Code-review

Edited by Fahim M. Choudhury

Merge request reports

Loading