Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

stops working properly sometimes #3

Open
fuloating opened this issue Dec 11, 2017 · 4 comments
Open

stops working properly sometimes #3

fuloating opened this issue Dec 11, 2017 · 4 comments

Comments

@fuloating
Copy link

fuloating commented Dec 11, 2017

For some reason this app is not working as intended sometimes, like for example now for the past 4 days or so.

The symptoms 1: I start the service as usual and all seems right, but when I move my finger over the sensor area, the screen stays on as if the service is not running.

The installed app section shows 0kb for cache and data, so I can't clear those. I tried uninstaling and reinstalling app, and rebooting my Xiaomi Redmi Note 3+ running android 5.1.1 and MIUI version 8.0.6.0. but is not helping.

The symptoms 2: Before symptoms 1 problem started to occur 4 days ago, the sensor worked normally until the following happened when I started the service: I moved my finger on top of the sensor, the screen went dark, but when I removed my finger from it, it would stay dark. Pressing the "lock screen" button on side of the phone multiple times finally awakes the screen eventually. This thing repeated multiple times until I had to stop the service. Next time I started the service the "symptoms 1" behaviour started to happen.

This cycle has happened earlier too, maybe twice, and I don't know what had made it work again. Maybe after I have installed updates from play store, or some system upgrade has happened it has started to work again. However now it is once again not working, and without knowing how to fix it, I might have to be without this app once again for weeks or even a month, until it suddenly start to work again...

@ssaqua
Copy link
Owner

ssaqua commented Dec 12, 2017

This is difficult for me to diagnose since I can't reproduce the issue and don't have access to multiple kinds of devices for testing. Do you experience the same issues when interacting with the proximity sensor during phone calls?

@JakubJagoda
Copy link

JakubJagoda commented Jan 9, 2018

I started seeing what OP here described as "symptom 1" after the most recent update (2.0.1). After running Proximity Service and using it for a couple of minutes (and starting new apps in the meantime), Proximity Service stops working - the notification says it's running, but putting a finger over the sensor does nothing and the only solution was to run it again (not by restarting from the notification, but explicitely from the main screen). It happens on exact same phone and OS as OP described.

But I think I found a solution for this, at least I haven't seen this behavior since I applied the fix. I assumed this is caused by the MIUI's optimalization strategy against background apps activity, which is turned on by default for all apps. Here's what I did:

  • run Proximity Service
  • expand the top notifications menu
  • put two fingers on the Proximity Service's notification and slide fingers down, to unfold the notification
  • press now visible "settings" button
  • Proximity Service settings open. Now open "recent apps" menu (by pressing the left button on touch panel)
  • Find the Proximity Service among the recent apps. It should be right on the left (no pun intended)
  • slide it down and press "lock"

And voila, this will "lock" your app and automatically set it to unlimited activity in the background. Since I did this, I haven't seen the "symptom 1". Try it, it might help.

Best regards

@ssaqua
Copy link
Owner

ssaqua commented Jan 11, 2018

Thanks for the workaround info!

The service runs as a foreground service to reduce the possibility of the system killing the service. I may need to revisit this idea and instead make it more compatible with being restarted by the system.

@ssaqua
Copy link
Owner

ssaqua commented May 24, 2019

Info for manufacturer specific workarounds against aggressive battery optimization: https://dontkillmyapp.com/

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

No branches or pull requests

3 participants