googlearchive / android-instant-apps

Migrated:
https://github.com/android/app-bundle
Apache License 2.0
846 stars 277 forks source link

Permission not allowed on Samsung device #43

Closed nancymi closed 6 years ago

nancymi commented 6 years ago

I met a crash issue when instant app running on Samsung device, here is the crash log:

  Fatal Exception: java.lang.SecurityException: Setting aod_show_state is not accessible from ephemeral package xx.xx.xx
     at android.os.Parcel.readException(Parcel.java:1958)
     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
     at android.content.ContentProviderProxy.call(ContentProviderNative.java:651)
     at android.provider.Settings$NameValueCache.getStringForUser(Settings.java:1923)
     at android.provider.Settings$System.getStringForUser(Settings.java:2229)
     at android.provider.Settings$System.getIntForUser(Settings.java:2299)
     at android.provider.Settings$System.getInt(Settings.java:2294)
     at android.view.ViewRootImpl$1.toViewScreenState(ViewRootImpl.java:1363)
     at android.view.ViewRootImpl$1.onDisplayChanged(ViewRootImpl.java:1319)
     at android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate.handleMessage(DisplayManagerGlobal.java:966)
     at android.os.Handler.dispatchMessage(Handler.java:105)
     at android.os.Looper.loop(Looper.java:164)
     at android.app.ActivityThread.main(ActivityThread.java:6938)
     at java.lang.reflect.Method.invoke(Method.java)
     at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Seems like it's trying to access the aod_show_state Settings(which is the specific feature called "Always on Display" on Samsung device), and it requires permission WRITE_SETTINGS/WRITE_SECURE_SETTINGS, and the instant app does not support these two permissions, then app crashed...

Is there any way to solve this problem?

ThePromoter commented 6 years ago

We're also seeing a lot of crashes with this message and stack trace

keyboardsurfer commented 6 years ago

This is out of scope for our samples. Please ask on stackoverflow.

keyboardsurfer commented 6 years ago

Or file a bug over at https://issuetracker.google.com if you think that this should be implemented. Thanks.