android.os.StrictMode$StrictModeDiskReadViolation: on com.android.server.policy.sec.TspStateManager.updateTspState
Asked Answered
E

0

8

When I turn on StrictMode at my Application onCreate(), everything was good, and the issue found fixed.

However, I realize there's a bug of StrictMode as per this issue. So I made the workaround (using Handler), and indeed more issue surfaced. I could identify them to either suppress or fix them.

But the below error is something that I have no clue, as the stack trace doesn't seems related to any piece of code that I could related to.

D/StrictMode: StrictMode policy violation; ~duration=38 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=4522015 violation=2
     at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)
     at libcore.io.BlockGuardOs.access(BlockGuardOs.java:67)
     at java.io.File.doAccess(File.java:281)
     at java.io.File.exists(File.java:362)
     at com.android.server.policy.sec.TspStateManager.updateTspState(TspStateManager.java:139)
     at com.android.server.policy.sec.TspStateManager.updateWindowPolicy(TspStateManager.java:103)
     at com.android.server.policy.PhoneWindowManager.focusChangedLw(PhoneWindowManager.java:8640)
     at com.android.server.wm.WindowManagerService.updateFocusedWindowLocked(WindowManagerService.java:18320)
     at com.android.server.wm.WindowManagerService.relayoutWindow(WindowManagerService.java:5768)
     at com.android.server.wm.Session.relayout(Session.java:208)
     at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:288)
     at com.android.server.wm.Session.onTransact(Session.java:139)
     at android.os.Binder.execTransact(Binder.java:453)
 # via Binder call with stack:
 android.os.StrictMode$LogStackTrace
     at android.os.StrictMode.readAndHandleBinderCallViolations(StrictMode.java:1911)
     at android.os.Parcel.readExceptionCode(Parcel.java:1601)
     at android.os.Parcel.readException(Parcel.java:1570)
     at android.view.IWindowSession$Stub$Proxy.relayout(IWindowSession.java:956)
     at android.view.ViewRootImpl.relayoutWindow(ViewRootImpl.java:6690)
     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1994)
     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437)
     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7403)
     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
     at android.view.Choreographer.doCallbacks(Choreographer.java:695)
     at android.view.Choreographer.doFrame(Choreographer.java:631)
     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
     at android.os.Handler.handleCallback(Handler.java:739)
     at android.os.Handler.dispatchMessage(Handler.java:95)
     at android.os.Looper.loop(Looper.java:158)
     at android.app.ActivityThread.main(ActivityThread.java:7224)
     at java.lang.reflect.Method.invoke(Native Method)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

This error happens on the Samsung S7 phone but not Nexus 6P. I want to suppress this error, but I first need to know which part of code that trigger this, so I could either spawn a different thread on that code or turn off the detectDiskReads on that part.

Any help of hint of how to check this on? Where to begin with?

Euphonious answered 20/7, 2016 at 5:49 Comment(3)
The strange part of this error is, if I 'Debug' App (even without a breakpoint), the error doesn't surface. If I 'Run' App (even in debug build), the error surface. Seems timing/delay related.Euphonious
I have stripped my code to just blank activity, this error still surface. It seems like a system related error that got triggered. It's a false I alarm or something I can't fix I believe. But how could I suppress it from killing my app?Euphonious
Thanks @Jquery Ninja. If you checked those stackoverflow, I'm the one answering it :P . For this case, the issue happens even before the App start up onCreate.Euphonious

© 2022 - 2024 — McMap. All rights reserved.