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

Commit ca974f3d authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

Call fullScan broadcast of eDrive on media sync

parent 0e10e6fc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ object Constants {
    // NOTE: Android 7 and up don't allow 2 min sync frequencies unless system frameworks are modified
    const val DEFAULT_CALENDAR_SYNC_INTERVAL = 2 * 60L // 2 minutes
    const val DEFAULT_CONTACTS_SYNC_INTERVAL = 15 * 60L // 15 minutes
    const val DEFAULT_FILE_SYNC_INTERVAL = 30 * 60L // 30 minutes

    /**
     * Context label for [org.apache.commons.lang3.exception.ContextedException].
+10 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.accounts.Account
import android.content.*
import android.os.Bundle
import at.bitfire.davdroid.HttpClient
import at.bitfire.davdroid.MailAccountSyncHelper
import at.bitfire.davdroid.db.AppDatabase

class EeloMediaSyncAdapterService : SyncAdapterService() {
@@ -40,7 +41,15 @@ class EeloMediaSyncAdapterService : SyncAdapterService() {
            provider: ContentProviderClient,
            syncResult: SyncResult
        ) {
            // Unused
            val intent = Intent()
            intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES)
            intent.component = ComponentName(
                "foundation.e.drive",
                "foundation.e.drive.receivers.FullScanReceiver"
            )
            intent.action = "foundation.e.drive.action.FULL_SCAN"

            context.applicationContext.sendBroadcast(intent)
        }
    }
}