adyen-3ds2-android
adyen-3ds2-android copied to clipboard
DiskReadViolation at AppUpgradeBroadcastReceiver
Describe the bug Enabling disk violations with Strict Mode makes the Adyen SDK to report an issue at AppUpgradeBroadcastReceiver
StrictMode policy violation; ~duration=2ms: android.os.strictmode.DiskReadViolation
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1658)
at libcore.io.BlockGuardOs.access(BlockGuardOs.java:74)
at libcore.io.ForwardingOs.access(ForwardingOs.java:128)
at android.app.ActivityThread$AndroidOs.access(ActivityThread.java:7749)
at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:281)
at java.io.File.exists(File.java:813)
at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:759)
at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:750)
at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:706)
at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:931)
at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:553)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:217)
at atd.m0.b.a(Unknown Source:3)
at com.adyen.threeds2.internal.e.b(Unknown Source:2)
at com.adyen.threeds2.internal.e.<init>(Unknown Source:5)
at com.adyen.threeds2.internal.e.a(Unknown Source:1)
at com.adyen.threeds2.internal.AppUpgradeBroadcastReceiver.onReceive(Unknown Source:3)
To Reproduce Steps to reproduce the behavior:
- Enable disk violations with Strict Mode:
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectDiskReads()
.detectDiskWrites()
.detectNetwork() // or .detectAll() for all detectable problems
.penaltyLog()
.build());
- Run an app integrated with Adyen SDK
- See error at logcat
Expected behavior To avoid ANRs and OOM errors, ideally this shouldn't happen
Screenshots N/A
Desktop (please complete the following information): OS: Android Browser: N/A Version: Adyen Android SDK 4.12.1
Smartphone (please complete the following information): Device: emulator OS: 13 Browser: N/A Version Adyen Android SDK 4.12.1
Additional context N/A
@fcduarte Thank you for reporting this. Our team will look into it and get back to you as soon as we know more.
@fcduarte I haven't managed to bump into this warning. Could you give me more details on how to replicate it? Does it happen with every transaction, regardless of what challenge is triggered?
Hey @fdcb, yeah this is tough. I noticed one time in the logs but I can't reproduce every time. Considering the name of the broadcast receiver, maybe it was when you install a new version APK on top of a previous one?
@fcduarte Yes that would indeed be the only use case were we would run into this warning. It is also not very impactful. We will update this issue once we release a version that addresses this issue.
@fcduarte The newest version (2.2.20) no longer has this DiskReadViolation.
Once again, thank you for reporting 😊