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

easer doesn't start on boot #44

Open
craftyguy opened this issue Nov 25, 2017 · 6 comments
Open

easer doesn't start on boot #44

craftyguy opened this issue Nov 25, 2017 · 6 comments
Labels
bug General label for all bugs (i.e. things not working as intended) compatibility Bugs related to compatibility (of device or OS) more-info-needed Needs more input to pin down or solve the issue unknown cause

Comments

@craftyguy
Copy link

craftyguy commented Nov 25, 2017

I'm not able to re-open #25, but this is still an issue for me on Android 8. I see the 'start on boot' permission is listed for Easer in Android, but after a boot the app does not start. I have to manually launch it and select 'start' before it is active and responding to events.

@renyuneyun
Copy link
Owner

Thanks for reporting. (Not sure why you can't re-open that...I remember the default is everyone can do that.)
I can confirm the auto-start is broken... Silly me... I set the wrong component to be enabled...
This will be fixed in v0.4.6.1

@renyuneyun
Copy link
Owner

renyuneyun commented Nov 27, 2017

1e5c2cc (v0.4.6.1) fixes the problem I observed.

Not sure if this is the only cause, so I'll leave this issue open until the fix is confirmed.

@craftyguy
Copy link
Author

Thanks for the quick response! I will need to wait for this version to make it into F-droid before I can confirm your fix resolves the problem for me :)

@renyuneyun renyuneyun added the going-to-be-closed? Issues which should have been resolved but OP no response for a long time; Discussion finished label Dec 11, 2017
@craftyguy
Copy link
Author

@renyuneyun

I'm running 0.4.7 now (and Android 8.1), and Easer still doesn't autostart on boot even though the option to do so is checked. Is there anything else I can provide you to help debug this?

@renyuneyun
Copy link
Owner

renyuneyun commented Dec 12, 2017

You are right. I tested it on an Android 8.0 phone and Easer also doesn't start on boot, though it it working correctly on my phone (Android 6.0) and the emulators (I only installed 5.1 and 6.0 emulators).

It may be something related to Android system change in 8.0 (or 7.0 maybe?) that wasn't documented well or didn't emphasised enough. I searched a lot but got nothing, though there must be a "fix" somewhere. (See the note below for all I got if you are interested.)

If I find out what's going on (or better a fix directly), it will be included in Easer. However, currently there doesn't seem to be a way to get around...


Interestingly, during my test, the BroadcastReceiver which listens to BOOT_COMPLETED broadcast DOES start (only) once on the Android 8.0 phone (which is a OnePlus 3 with developer edition Oxygen OS). However, Easer (EHService) wasn't successfully started by it maybe because (AFAIC) there is a change in the broadcast receiver so I need to use Context.startForegroundService() instead of Context.startService() (which has been used by all Android developers for years) -- though the targetSdkVersion I set is 23, for which I suspect Easer shouldn't be affected by this change (until I change the targetSdkVersion to Oreo, 26). Anyway, I changed the method call and re-installed the update to the phone. However, the next time I reboot the device, none of the components of Easer started.

On the Android 6.0 emulator, I need to grant Easer all permissions it needs (I didn't really test whether this is necessary or not, but I tested the Notification Listeners, and the Event one must be enabled for Easer to auto-start -- though in theory they shouldn't have any relationships). Enabling and disabling the "auto start on boot" setting isn't enough in my test -- I need to

  1. enable it,
  2. start the service of Easer (by clicking the "start" menu item in the outline page),
  3. disable and enable the setting again.

Only through this way I got Easer auto-start on boot on the emulator... Quite ridiculous in my perspective because this isn't what the Android document suggests (it only suggests the user need to run Easer at least once after installing it, which is already satisfied if you try to set it auto-start-on-boot)...


(A note both for people who are interested and myself)

this post on SO says the start-on-boot shouldn't be malfunctioning even on Android 8.0 (Oreo) because the BOOT_COMPLETED intent is exempted from the limitations introduced to the intent filters defined in Manifest.

this reply on SO also encounterd this issue (won't auto-start), but there is no response yet (2017-12-12).

this article says there are several changes in Android 8.0 so developers should use different ways to start background services, and the article presented three examples.
The article doesn't mention whether this change will affect all apps running on Android 8+ or all apps targeting Oreo (SDK 26)+.

@renyuneyun renyuneyun added bug General label for all bugs (i.e. things not working as intended) compatibility Bugs related to compatibility (of device or OS) help wanted Issues which are quite clear and require text work only. unknown cause and removed going-to-be-closed? Issues which should have been resolved but OP no response for a long time; Discussion finished labels Dec 14, 2017
@renyuneyun renyuneyun added this to Android 8.0 in Compatibility May 26, 2018
@renyuneyun renyuneyun added more-info-needed Needs more input to pin down or solve the issue and removed help wanted Issues which are quite clear and require text work only. labels Sep 24, 2018
renyuneyun added a commit that referenced this issue Oct 9, 2018
Suits Android 8.0 also
Related to issue #44
@renyuneyun renyuneyun added this to Misc bugs (unknown cause) in Misc Bugs Mar 5, 2019
@proItheus
Copy link

I have some infomation which may be of use.I'm using redmi 8a running android 10,and encountered the boot issue too.Here is what the logcat -s ryey.easer shows:
--------- beginning of system --------- beginning of main --------- beginning of crash 11-02 23:17:22.036 7278 7278 E ryey.easer: Not starting debugger since process cannot load the jdwp agent. 11-02 23:17:22.242 7278 7278 W ryey.easer: Unsupported class loader 11-02 23:17:22.292 7278 7278 I ryey.easer: The ClassLoaderContext is a special shared library. 11-02 23:17:22.356 7278 7278 W ryey.easer: Unsupported class loader 11-02 23:17:22.364 7278 7278 W ryey.easer: Unsupported class loader 11-02 23:17:22.383 7278 7278 W ryey.easer: Unsupported class loader 11-02 23:17:24.138 7278 7329 I ryey.easer: Background young concurrent copying GC freed 72040(6468KB) AllocSpace objects, 37(1336KB) LOS objects, 89% free, 2926KB/26MB, paused 109us total 125.320ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug General label for all bugs (i.e. things not working as intended) compatibility Bugs related to compatibility (of device or OS) more-info-needed Needs more input to pin down or solve the issue unknown cause
Projects
Compatibility
Android 8.0
Misc Bugs
  
Misc bugs (unknown cause)
Development

No branches or pull requests

3 participants