chore: add project scaffolding and resources
This initial commit scaffolds the project with essential docs, assets, and build configs. It adds Android icons, design assets, and release metadata to support mobile targets. A fastlane config and F-Droid manifest are included to streamline builds. - Adds F-Droid configuration for automated builds - Includes license and privacy policy documents - Provides app icons and assets for Android and design system
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package de.wechselbild.wallpaper
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
class WallpaperAlarmReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (!WallpaperStore.enabled(context)) {
|
||||
WallpaperScheduler.cancel(context)
|
||||
return
|
||||
}
|
||||
val applicationContext = context.applicationContext
|
||||
val result = goAsync()
|
||||
executor.execute {
|
||||
try {
|
||||
if (WallpaperScheduler.claimIfDue(applicationContext)) try {
|
||||
WallpaperStore.applyNext(applicationContext)
|
||||
} finally {
|
||||
WallpaperScheduler.scheduleNext(applicationContext)
|
||||
}
|
||||
} finally {
|
||||
WallpaperScheduler.ensureScheduled(applicationContext)
|
||||
WallpaperRotationService.rescheduleRunningService()
|
||||
result.finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val executor = Executors.newSingleThreadExecutor()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user