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

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

migrate to account removed callback from account manager

parent 18220400
Loading
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="foundation.e.accountmanager.permission.ACCOUNT_EVENTS"/>

    <queries>
        <package android:name="com.nextcloud.client" />
@@ -183,11 +184,13 @@
            android:enabled="true"
            android:exported="true"/>

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

+2 −2
Original line number Diff line number Diff line
@@ -39,13 +39,13 @@ public class AccountRemoveReceiver extends BroadcastReceiver {

    private static final String TAG = AccountRemoveReceiver.class.getSimpleName();
    private static final String[] SUPPORTED_ACCOUNT_TYPES = {"e.foundation.webdav.eelo"};
    private static final String ACTION_ACCOUNT_REMOVE = "android.accounts.action.ACCOUNT_REMOVED";
    private static final String ACTION_ACCOUNT_REMOVED = "foundation.e.accountmanager.action.ACCOUNT_REMOVED";

    private final ExecutorService executor = Executors.newCachedThreadPool();

    @Override
    public void onReceive(Context context, Intent intent) {
        if (!ACTION_ACCOUNT_REMOVE.equals(intent.getAction())) {
        if (!ACTION_ACCOUNT_REMOVED.equals(intent.getAction())) {
            return;
        }