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

Commit ba4afdeb authored by dev-12's avatar dev-12 Committed by pratyush
Browse files

refactor: use standardize actions string across events

parent fd4171d8
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -330,8 +330,8 @@
            android:enabled="true"
            android:permission="foundation.e.accountmanager.permission.ACCOUNT_EVENTS">
            <intent-filter>
                <action android:name="foundation.e.accountmanager.account.create"/>
                <action android:name="foundation.e.accountmanager.account.removed"/>
                <action android:name="foundation.e.accountmanager.action.ACCOUNT_ADDED"/>
                <action android:name="foundation.e.accountmanager.action.ACCOUNT_REMOVED"/>
            </intent-filter>
        </receiver>

+5 −6
Original line number Diff line number Diff line
@@ -34,10 +34,9 @@ import org.koin.core.component.inject
class AccountSyncReceiver : BroadcastReceiver(), KoinComponent {

    companion object {
        private const val ACTION_PREFIX = "foundation.e.accountmanager.account"

        private const val ACCOUNT_CREATION_ACTION = "$ACTION_PREFIX.create"
        private const val ACCOUNT_REMOVAL_ACTION = "$ACTION_PREFIX.removed"
        private const val ACTION_PREFIX = "foundation.e.accountmanager.action"
        private const val ACTION_ACCOUNT_ADDED = "$ACTION_PREFIX.ACCOUNT_ADDED"
        private const val ACTION_ACCOUNT_REMOVED = "$ACTION_PREFIX.ACCOUNT_REMOVED"

    }

@@ -52,8 +51,8 @@ class AccountSyncReceiver : BroadcastReceiver(), KoinComponent {
        }

        when (intent.action) {
            ACCOUNT_CREATION_ACTION -> createNewAccount(context)
            ACCOUNT_REMOVAL_ACTION -> removeAccount(intent)
            ACTION_ACCOUNT_ADDED -> createNewAccount(context)
            ACTION_ACCOUNT_REMOVED -> removeAccount(intent)
        }
    }