package com.peachpasswords.sync import android.content.BroadcastReceiver import android.content.Context import android.content.Intent /** * Restarts the sync service after a reboot. The service's own locked-handling * ([PeachSyncService.startReconnectListener] early-returns on a null master * key) is the gate — it comes up properly once the user unlocks for the first * time post-boot. Without this, a rebooted phone is unreachable until the app * is manually opened. */ class BootReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent?) { if (intent?.action != Intent.ACTION_BOOT_COMPLETED) return if (!BackgroundSyncPreference.isEnabled(context)) return PeachSyncService.start(context) } }