Skip to content

Update AccountActivity to properly handle external Intent #2850

Description

@cketti

Currently the internal and external Intent extra mechanism both use the key account. This leads to AccountIdIntentSerializer always returning a LegacyAccount in the case where a third-party app uses the documented way to open a specific account (see https://manual.davx5.com/integration.html#open-davx5-for-a-specific-account). However, if the given Android account is linked to a database account we need to use a DbAccountId instance internally.

To fix this we should…

  • use a different extra key for internal navigation, e.g. accountId (instead of account),
  • use AndroidAccountManager to retrieve the proper AccountId associated with the given Android account when handling third-party intents (account extra).

Note: Since this lookup in AndroidAccountManager involves a database access and we don't want to do this in the main thread, we either need to defer showing AccountScreen until the AccountId is available or change AccountScreen to support a loading state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions