Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swallow exceptions in ScreenshotObserver #1167

Merged

Conversation

bemusementpark
Copy link

Swallow exceptions in ScreenshotObserver occurring mainly on Huawei and Samsung devices.

It's probably a permissions issue, as we do not explicitly request storage permissions before initialising ScreenshotObserver.

API 29+

Exception java.lang.IllegalStateException: Unknown URL: content://media/ is hidden API
  at android.os.Parcel.createException (Parcel.java:2099)
  at android.os.Parcel.readException (Parcel.java:2059)
  at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:188)
  at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:140)
  at android.content.ContentProviderProxy.query (ContentProviderNative.java:423)
  at android.content.ContentResolver.query (ContentResolver.java:955)
  at android.content.ContentResolver.query (ContentResolver.java:891)
  at android.content.ContentResolver.query (ContentResolver.java:840)
  at org.thoughtcrime.securesms.attachments.ScreenshotObserver.queryRelativeDataColumn (ScreenshotObserver.kt:54)
  at org.thoughtcrime.securesms.attachments.ScreenshotObserver.onChange (ScreenshotObserver.kt:17)
  at android.database.ContentObserver.onChange (ContentObserver.java:147)
  at android.database.ContentObserver$NotificationRunnable.run (ContentObserver.java:218)
  at android.os.Handler.handleCallback (Handler.java:900)
  at android.os.Handler.dispatchMessage (Handler.java:103)
  at android.os.Looper.loop (Looper.java:219)
  at android.app.ActivityThread.main (ActivityThread.java:8668)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:513)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1109)

prior

Exception java.lang.SecurityException:
  at android.os.Parcel.readException (Parcel.java:2029)
  at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:183)
  at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:135)
  at android.content.ContentProviderProxy.query (ContentProviderNative.java:418)
  at android.content.ContentResolver.query (ContentResolver.java:760)
  at android.content.ContentResolver.query (ContentResolver.java:710)
  at android.content.ContentResolver.query (ContentResolver.java:668)
  at org.thoughtcrime.securesms.attachments.ScreenshotObserver.queryDataColumn (ScreenshotObserver.kt:29)
  at org.thoughtcrime.securesms.attachments.ScreenshotObserver.onChange (ScreenshotObserver.kt:19)
  at android.database.ContentObserver.onChange (ContentObserver.java:145)
  at android.database.ContentObserver$NotificationRunnable.run (ContentObserver.java:216)
  at android.os.Handler.handleCallback (Handler.java:790)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:7025)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:441)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1408)

@bemusementpark bemusementpark merged commit 84004d2 into oxen-io:dev May 11, 2023
@bemusementpark bemusementpark deleted the swallow-screenshot-exception branch May 11, 2023 10:15
@mpretty-cyro mpretty-cyro mentioned this pull request Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants