Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.
This repository was archived by the owner on Oct 26, 2023. It is now read-only.

SecurityException on window manager addView #149

@fennifith

Description

@fennifith

This is a stack trace from v3.8-beta3. It is a pain. Crash occurs on this line.

java.lang.RuntimeException: 
  at android.app.ActivityThread.handleCreateService (ActivityThread.java:3081)
  at android.app.ActivityThread.-wrap4 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1575)
  at android.os.Handler.dispatchMessage (Handler.java:111)
  at android.os.Looper.loop (Looper.java:207)
  at android.app.ActivityThread.main (ActivityThread.java:5737)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:789)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:679)
Caused by: java.lang.SecurityException: 
  at android.os.Parcel.readException (Parcel.java:1599)
  at android.os.Parcel.readException (Parcel.java:1552)
  at android.view.IWindowSession$Stub$Proxy.addToDisplay (IWindowSession.java:747)
  at android.view.ViewRootImpl.setView (ViewRootImpl.java:645)
  at android.view.WindowManagerGlobal.addView (WindowManagerGlobal.java:319)
  at android.view.WindowManagerImpl.addView (WindowManagerImpl.java:85)
  at com.james.status.services.StatusServiceImpl.setUp (StatusServiceImpl.java:257)
  at com.james.status.services.StatusServiceImpl.onCreate (StatusServiceImpl.java:91)
  at com.james.status.services.StatusServiceCompat.onCreate (StatusServiceCompat.java:25)
  at android.app.ActivityThread.handleCreateService (ActivityThread.java:3071)

I could just wrap it in a try/catch block, but without knowing what's actually going on that would be messy. Only one user in the beta test (~150 people) appears to have reported it, so it could easily be device-specific, but it appears that the service is somehow starting without the required permissions to draw overlay views. This should not be possible; regardless of what the user throws at it, Status should never reach this line if the overlay permission hasn't been granted. Agh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions