Open EugeneSytnyk opened 2 months ago
Hi @EugeneSytnyk thanks for using the Braintree SDK for Android. Are you able to reproduce this 100%? Also what version of Android are you using?
Hi @EugeneSytnyk thanks for using the Braintree SDK for Android. Are you able to reproduce this 100%? Also what version of Android are you using?
Yes, this is reproduced 100% of the time. Of course, with StrictMode enabled. I tried Android versions 26, 30, 33. But I’m sure that it can be reproduced on any Android
Braintree SDK Version
4.49.1
Environment
Sandbox
Android Version & Device
Target SDK: 34 Compile SDK: 34 Device: Any
Braintree dependencies
com.braintreepayments.api:card:4.49.1 com.braintreepayments.api:paypal:4.49.1 com.braintreepayments.api:google-pay:4.49.1 com.braintreepayments.api:three-d-secure:4.49.1
Describe the bug
There is a disk access in the main thread. This provokes android.os.strictmode.DiskReadViolation error
Stack trace: java.lang.Error: android.os.strictmode.DiskReadViolation at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1173) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) Caused by: android.os.strictmode.DiskReadViolation at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1596) at libcore.io.BlockGuardOs.access(BlockGuardOs.java:71) at libcore.io.ForwardingOs.access(ForwardingOs.java:72) at android.app.ActivityThread$AndroidOs.access(ActivityThread.java:7533) at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:281) at java.io.File.exists(File.java:815) at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:681) at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:672) at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:628) at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:853) at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:475) at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:188) at com.braintreepayments.api.PersistentStore.get(PersistentStore.java:24) at com.braintreepayments.api.BrowserSwitchPersistentStore.getActiveRequest(BrowserSwitchPersistentStore.java:33) at com.braintreepayments.api.BrowserSwitchClient.getResult(BrowserSwitchClient.java:162) at com.braintreepayments.api.BraintreeClient.getBrowserSwitchResult(BraintreeClient.kt:371) at com.braintreepayments.api.PayPalClient.getBrowserSwitchResult(PayPalClient.java:388) at com.braintreepayments.api.PayPalLifecycleObserver$1.run(PayPalLifeCycleObserver.java:62) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99)
To reproduce
Expected behavior
There is no DiskReadViolation error
Screenshots
No response