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

Commit e340fc53 authored by dev-12's avatar dev-12
Browse files

bugfix! ensure mail account is properly removed

The system broadcast for account removal wasn't being received when the app was in a stopped state, leading to stale account information. Use the custom broadcast from the account manager app, ensuring the mail account is properly removed regardless of the app's state.
parent 0cafa3ec
Loading
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
    <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>

    <uses-permission android:name="foundation.e.accountmanager.permission.ACCOUNT_EVENTS"/>

    <application
        android:name="com.fsck.k9.App"
        android:allowTaskReparenting="false"
@@ -322,12 +324,14 @@
            </intent-filter>
        </receiver>

        <receiver android:name=".account.AccountSyncReceiver"
        <receiver
            android:name=".account.AccountSyncReceiver"
            android:exported="true"
            android:enabled="true"
            android:exported="true">
            android:permission="foundation.e.accountmanager.permission.ACCOUNT_EVENTS">
            <intent-filter>
                <action android:name="foundation.e.accountmanager.account.create"/>
                <action android:name="android.accounts.action.ACCOUNT_REMOVED"/>
                <action android:name="foundation.e.accountmanager.account.removed"/>
            </intent-filter>
        </receiver>

+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ class AccountSyncReceiver : BroadcastReceiver(), KoinComponent {
        private const val ACTION_PREFIX = "foundation.e.accountmanager.account"

        private const val ACCOUNT_CREATION_ACTION = "$ACTION_PREFIX.create"
        private const val ACCOUNT_REMOVAL_ACTION = "android.accounts.action.ACCOUNT_REMOVED"
        private const val ACCOUNT_REMOVAL_ACTION = "$ACTION_PREFIX.removed"

    }