Easer icon indicating copy to clipboard operation
Easer copied to clipboard

easer doesn't start on boot

Open craftyguy opened this issue 6 years ago • 6 comments

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.

craftyguy avatar Nov 25 '17 17:11 craftyguy

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 avatar Nov 27 '17 10:11 renyuneyun

1e5c2ccf6873523869369dc382c1f877ac2cf8db (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.

renyuneyun avatar Nov 27 '17 11:11 renyuneyun

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 :)

craftyguy avatar Nov 27 '17 16:11 craftyguy

@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?

craftyguy avatar Dec 11 '17 22:12 craftyguy

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 avatar Dec 12 '17 12:12 renyuneyun

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

proItheus avatar Nov 02 '20 15:11 proItheus