Closed chengxuncc closed 5 years ago
What is "the app", the one implementing the RemotePreferenceProvider
or the one using RemotePreferences
? And by kill do you mean removing the app from the app switcher, or force stopping the app, or something else?
I can't tell if this is one exception or two, can you post the full logs and the demo you are testing, if possible? Thanks!
The app is the one implementing the RemotePreferenceProvider
, and I am writing a Xposed module. When I kill the Xposed module application from either app switcher or force stopping, other hooked apps that using RemotePreferences
to get preferences will not work.
What phone/ROM are you using? I ask because some phones will disable providers if you quit the app (to "save battery").
oneplus 3 H2OS
OnePlus has a particularly bad track record (I would know, I used to use a 3T). Disable battery optimization for the app and see if that fixes it.
Although I had disabled battery optimization, it still not working when got killed. Maybe I should find an another way.
I test a demo, it work great while app is running, which was configured contentProvider. But when I kill the app, RemotePreferences cannot ruturn correct preferences. If on strict mode, it will throw Exception:
I'm using Android 8.0 Oreo, and I had try device encrypted preferences described on README.