GCX-HCI / tray

a SharedPreferences replacement for Android with multiprocess support
Apache License 2.0
2.29k stars 273 forks source link

TrayRuntimeException in TrayContract #128

Open Cilenco opened 6 years ago

Cilenco commented 6 years ago

tray Version

I'm using Tray version 0.12.0

My setup for tray

I initialized Tray in an Activity a NotificationListenerService which runs in its own process and a BroadcastReceiver which is within the main process.

Devices

Google Pixel 2, OnePlus 5T

Android Version

Both devices on Android 8.1

Stacktrace

Stacktrace ``` Caused by: net.grandcentrix.tray.core.TrayRuntimeException: at net.grandcentrix.tray.provider.TrayContract.d (TrayContract.java:98) at net.grandcentrix.tray.provider.TrayContract.generateContentUri (TrayContract.java) at net.grandcentrix.tray.provider.TrayContract.a (TrayContract.java:2) at net.grandcentrix.tray.provider.TrayUri. (TrayUri.java:5) at net.grandcentrix.tray.provider.ContentProviderStorage. (ContentProviderStorage.java:23) at net.grandcentrix.tray.TrayPreferences. (TrayPreferences.java:2) at net.grandcentrix.tray.TrayPreferences. (TrayPreferences.java:2) at net.grandcentrix.tray.AppPreferences. (AppPreferences.java:5) at com.cilenco.services.BootCompleteListener.onReceive (BootCompleteListener.java:90) at android.app.ActivityThread.handleReceiver (ActivityThread.java:3187) at android.app.ActivityThread.-wrap17 (Unknown Source) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1672) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loop (Looper.java:164) at android.app.ActivityThread.main (ActivityThread.java:6494) at java.lang.reflect.Method.invoke (Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:807) ```

Description

Might be an error within my code. The receiver gets called with ACTION_LOCKED_BOOT_COMPLETED (in 8.1) Do I have to use createDeviceProtectedStorageContext here to get an AppPreference object? If so the issue can be marked as closed but otherwise I have no clue where the error should be.