From 2915cf984b32614f0fa7ac8fbc28e75d5f4cedf1 Mon Sep 17 00:00:00 2001 From: Christopher Beckmann Date: Sat, 6 Aug 2022 17:33:53 +0200 Subject: [PATCH] v1.2.3 (9) --- app/build.gradle | 4 ++-- .../privacyfriendlynotes/receiver/BootReceiver.kt | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b11757d5..7582d4da 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "org.secuso.privacyfriendlynotes" minSdkVersion 21 targetSdkVersion 32 - versionCode 8 - versionName "1.2.2" + versionCode 9 + versionName "1.2.3" javaCompileOptions { annotationProcessorOptions { diff --git a/app/src/main/java/org/secuso/privacyfriendlynotes/receiver/BootReceiver.kt b/app/src/main/java/org/secuso/privacyfriendlynotes/receiver/BootReceiver.kt index 186c401c..434babec 100644 --- a/app/src/main/java/org/secuso/privacyfriendlynotes/receiver/BootReceiver.kt +++ b/app/src/main/java/org/secuso/privacyfriendlynotes/receiver/BootReceiver.kt @@ -17,6 +17,7 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.util.Log +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import org.secuso.privacyfriendlynotes.room.NoteDatabase @@ -27,19 +28,12 @@ class BootReceiver : BroadcastReceiver() { var allNotifications: List? = null override fun onReceive(context: Context, intent: Intent) { if (Intent.ACTION_BOOT_COMPLETED != intent.action && Intent.ACTION_AIRPLANE_MODE_CHANGED != intent.action) return + Log.d(javaClass.simpleName, "Running onReceive...") - GlobalScope.launch { + GlobalScope.launch(Dispatchers.Main) { - //CreateEditNoteViewModel createEditNoteViewModel = new ViewModelProvider(context.getApplicationContext()).get(CreateEditNoteViewModel.class); - //ArrayAdapter adapter = new ArrayAdapter(context, R.layout.simple_spinner_item); allNotifications = NoteDatabase.getInstance(context).notificationDao().getAllNotifications() -// createEditNoteViewModel.getAllNotifications().observe((LifecycleOwner) context, new Observer>() { -// @Override -// public void onChanged(List notifications) { -// allNotifications = notifications; -// } -// }); Log.d(javaClass.simpleName, allNotifications!!.size.toString() + " Notifications found.") for ((notification_id, time) in allNotifications!!) {