Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
horanvo
take-your-pill
Commits
fbaaf157
Commit
fbaaf157
authored
4 years ago
by
Vojtěch Hořánek
Browse files
Options
Download
Email Patches
Plain Diff
maybe fixed boot? seems to work
parent
fa19f5a1
master
develop
v1.5
v1.5.rc3
v1.5.rc2
v1.5.rc1
1 merge request
!23
First release candidat
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/main/AndroidManifest.xml
+2
-0
app/src/main/AndroidManifest.xml
app/src/main/java/eu/vojtechh/takeyourpill/receiver/BootReceiver.kt
+5
-5
...in/java/eu/vojtechh/takeyourpill/receiver/BootReceiver.kt
with
7 additions
and
5 deletions
+7
-5
app/src/main/AndroidManifest.xml
+
2
-
0
View file @
fbaaf157
...
...
@@ -43,9 +43,11 @@
<receiver
android:name=
".receiver.ConfirmReceiver"
/>
<receiver
android:name=
".receiver.BootReceiver"
android:exported=
"true"
android:enabled=
"true"
>
<intent-filter>
<action
android:name=
"android.intent.action.BOOT_COMPLETED"
/>
<action
android:name=
"android.intent.action.QUICKBOOT_POWERON"
/>
</intent-filter>
</receiver>
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/eu/vojtechh/takeyourpill/receiver/BootReceiver.kt
+
5
-
5
View file @
fbaaf157
package
eu.vojtechh.takeyourpill.receiver
import
android.annotation.SuppressLint
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Intent
...
...
@@ -17,12 +18,11 @@ class BootReceiver : BroadcastReceiver() {
@Inject
lateinit
var
pillRepository
:
PillRepository
@SuppressLint
(
"UnsafeProtectedBroadcastReceiver"
)
override
fun
onReceive
(
context
:
Context
,
intent
:
Intent
)
{
if
(
intent
.
action
==
"android.intent.action.BOOT_COMPLETED"
)
{
goAsync
(
GlobalScope
,
Dispatchers
.
IO
)
{
pillRepository
.
getAllPills
().
forEach
{
ReminderManager
.
planNextPillReminder
(
context
,
it
)
}
goAsync
(
GlobalScope
,
Dispatchers
.
IO
)
{
pillRepository
.
getAllPills
().
forEach
{
ReminderManager
.
planNextPillReminder
(
context
,
it
)
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets