Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Oreo] Not started on boot #222

Closed
owensgithub opened this issue Nov 5, 2017 · 15 comments
Closed

[Oreo] Not started on boot #222

owensgithub opened this issue Nov 5, 2017 · 15 comments

Comments

@owensgithub
Copy link

On Android 8.0.0 the app is stopping everytime I restart the phone. I have to manually restart even though I have 'Resume on system start-up' swtiched on. Anyone else having this issue?

@TechHummel
Copy link

Yes, I'm experiencing exactly the same issue (Pixel, 8.0.0).

@taiyangc
Copy link

Same on 8.0.0.

@julian-klode
Copy link
Owner

Well, I mean, no other app seems to be starting on boot either, so it's a new Oreo feature? I don't know.

@julian-klode
Copy link
Owner

Unfortunately, someone seems to have messed up USB debugging on the OnePlus 3's Oreo beta - I can only get adb to connect after switching to MTP mode, so I can't start adb during boot, and it's too late afterwards.

@julian-klode
Copy link
Owner

From my reading, it seems no longer possible to use startService() in the background. But it did not work with startForegroundService() either. In fact, the broadcast receiver does not appear to be started at all.

julian-klode added a commit that referenced this issue Nov 12, 2017
This seems to be necessary for being able to start the service
at boot nowadays, though it does not seem to make it work yet
- something else is broken.

See issue #222 for more details.
@julian-klode julian-klode changed the title App is stopping on start-up App is not started on boot Nov 12, 2017
@julian-klode julian-klode changed the title App is not started on boot [Oreo] Notstarted on boot Nov 12, 2017
@julian-klode julian-klode changed the title [Oreo] Notstarted on boot [Oreo] Not started on boot Nov 12, 2017
@julian-klode
Copy link
Owner

Commit 0b13579 fixes the starting of the service (and it really requires enabled notifications), but since the broadcast receiver calling this code is never started by Android, it does not really help.

I'm not sure what's going on - I have a feeling receiving BOOT_COMPLETED has been restricted to system apps.

@julian-klode
Copy link
Owner

So I just found out that it crashes for one user on boot, so I'm not sure why it's not starting for all of us here, but is for that user. Weird stuff.

@kermitoo
Copy link

@julian-klode It starts at boot just fine for me, I just had to de-optimize the app in Settings > Battery otherwise it was crashing at boot. I'm using a OnePlus 3 on Oreo, hope it helps.

@julian-klode
Copy link
Owner

@kermitoo It really should be crashing according to the docs, you are probably lucky and OnePlus screwed up :) - I don't see any crashes in Open Beta 27, but it does not start either.

@alleluia20
Copy link

For me, with Android 7, DNS66 often fails to autostart. I then noticed that it was installed in the SD card and, although the card is formatted as internal storage, apps in the card may still have problems autostarting.
Yesterday I moved DNS66 to the (real) internal storage, and it has auto started today. I will continue watching it.

Regarding Oreo, do you really mean that non-system apps, such as DNS66, but also WhatsApp or an email app, will not auto start?

@julian-klode
Copy link
Owner

Background services cannot start automatically when compiled against the latest target version. Foreground services (with notification) can. WhatsApp does not have to, it uses push. E-Mail was always a bit borked.

@julian-klode
Copy link
Owner

This works for me since some time now, seems OnePlus fixed the 3 in the latest Open Beta. I suggest everyone else with problems remaining with autostart of apps talk to their phone vendors.

@alleluia20
Copy link

I then guess that the notification in DNS66 should be mandatory, shouldn't it?

@julian-klode
Copy link
Owner

Well, only if you want to autostart it.

@LLParse
Copy link

LLParse commented Sep 8, 2019

Regardless of notification state, auto start at boot doesn't function on my phone.

Moto g6 play
Android 9/Pie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants