Skip to content

DiskReadViolation in Sift.open #104

@Turnsole

Description

@Turnsole

We're following the example given in the README of this repo, and see that the Sift SDK is doing disk reads on the UI thread. This is evident if you turn on strict mode.

11-16 09:47:26.429 1573 1573 D StrictMode: StrictMode policy violation; ~duration=319 ms: android.os.strictmode.DiskReadViolation 11-16 09:47:26.429 1573 1573 D StrictMode:	at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1659) 11-16 09:47:26.429 1573 1573 D StrictMode:	at [libcore.io](http://libcore.io/).BlockGuardOs.access(BlockGuardOs.java:74) 11-16 09:47:26.429 1573 1573 D StrictMode:	at [libcore.io](http://libcore.io/).ForwardingOs.access(ForwardingOs.java:128) 11-16 09:47:26.429 1573 1573 D StrictMode:	at android.app.ActivityThread$AndroidOs.access(ActivityThread.java:7747) 11-16 09:47:26.429 1573 1573 D StrictMode:	at [java.io](http://java.io/).UnixFileSystem.checkAccess(UnixFileSystem.java:281) 11-16 09:47:26.429 1573 1573 D StrictMode:	at [java.io](http://java.io/).File.exists(File.java:813) 11-16 09:47:26.429 1573 1573 D StrictMode:	at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:751) 11-16 09:47:26.429 1573 1573 D StrictMode:	at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:742) 11-16 09:47:26.429 1573 1573 D StrictMode:	at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:698) 11-16 09:47:26.429 1573 1573 D StrictMode:	at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:923) 11-16 09:47:26.429 1573 1573 D StrictMode:	at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:545) 11-16 09:47:26.429 1573 1573 D StrictMode:	at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:196) 11-16 09:47:26.429 1573 1573 D StrictMode:	at siftscience.android.SiftImpl.<init>(SiftImpl.java:125) 11-16 09:47:26.429 1573 1573 D StrictMode:	at siftscience.android.SiftImpl.<init>(SiftImpl.java:97) 11-16 09:47:26.429 1573 1573 D StrictMode:	at siftscience.android.Sift.open(Sift.java:68) 11-16 09:47:26.429 1573 1573 D StrictMode:	at siftscience.android.Sift.open(Sift.java:89) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions