OnScreenClock: permission problem

Several users have brought to my attention that the clock app no longer works after a device factory reset due to a permission problem. The dreaded message appears:

Unfortunately, your device’s rom does not support a user interface for granting the overlay permission :/

These are my findings so far:

Not brand or model specific problem
When I received the first report, I uninstalled the app on my Nexus Player (Oreo) and reinstalled it and guess what: same problem. In the meantime I received reports on Sony TV and Nvidia Shield TV.

Android TV Marshmallow and higher
Yes, all trouble started with Marshmallow. 😉 I received reports on Nougat and Oreo and tested the app also on a Nexus 7 tablet (KitKat) and Pie phone. Unsurprisingly on KitKat no problem since no permissions exist yet, on Pie my phone showed a permission dialog to grant the permission (which is good, but still abnormal).

Unfortunately, I have not encountered an Android TV rom yet which provides a user interface for granting the overlay permission (it’s not in stock android TV and none of the vendors seem to care).

Fresh installs
All reports were due to device resets, but as I already pointed out: simply uninstalling and reinstalling the clock app will exhibit the problem. Updating the app is no problem since it will preserve the previously granted permission. By taking advantage of this, I can test out a fix without impacting existing users.

 

I did a quick search on the interwebs but no luck so far, it’s kind of a niche topic after all. 😉 I suspect a google Play Services or Play store update is the culprit but didn’t find any news yet. If it’s part of a security fix, information will be sparse anyhow.

I see several options:

  • google did a small fuckup in the play services or store (as they did with the remote not responding, deep sleeping) and might fix it (can take several months)
  • google intentionally changed the way the overlay permission is granted (and no longer wants to grant it automagically)
  • the permission not being granted anymore might be a side effect of some other policy change

Overlay permissions have always been tricky on android (tv), so let’s hope there is a solution possible.. (or a hack at least)

13 thoughts on “OnScreenClock: permission problem

    • hi Stefan,

      thank you for trying to help me figure this out, much appreciated. However, I was already aware of this bug report (last comment is by me 😉 ). I have already created serveral test versions with higher target sdk and other possible fixes but in vain.. :/

      cheers

  1. Hi, I love your ATV on screen clock, but been bugged with the issue you describe. It is only happening on my ATV 7.1.1 device after runnings updates from the play store, if I install your app from PlayStore first, without updating anything else it works.

    But to the point: I read about issues with apps targeting sdk level 23 (Android 6).
    As solution, target sdk level 24+ (Android 7+) and ask explicitely for the permission.

    Source: issuetracker.google.com/issues/37119304

    I’m not a programner, sorry if not helpfull

  2. Instructions to add permission manually:

    -install “Remote ADB Shell” on your phone (if you need access to ADB shell over network)
    -enable network ADB on shield: please Google it.
    -once Remote ADB is connected, issue these command one by one:

    settings put global enable_freeform_support 1

    appops set mattiesworld.gotdns.org.onscreenclock SYSTEM_ALERT_WINDOW allow

    -Now u can use the app 🙂

    • Hi Sanjid,
      thank you for helping out, I didn’t know about the remote adb shell app!

      In the meantime, I also found a way to set the permission manually using the following adb command:
      adb shell pm grant mattiesworld.gotdns.org.onscreenclock android.permission.SYSTEM_ALERT_WINDOW

      Now, I only need to find a way to explain that to the casual computer/TV user 😉

  3. Hi, I installed the app on my Mecool km3 Android TV box (Android 9). It runs fine but as soon as the app starts, the box shows that there is no network connection. However the Ethernet connection works properly.
    It is not a blocking issue but quite strange…

    • Hi Didier,
      on first startup, the app opens the associated blog post if available. So that would explain why it connects to the internet. My web hosting sometimes went down, so that may explain why you got that error? Meanwhile I migrated the website to another web hoster but now it seems the site is sometimes blocked because webfilters deem the ip range suspect because of other servers at my web host that are hacked and sending spam etc..

  4. Reset Sony Bravia and OnScreenClock would no longer load. Followed Sanjid instructions using Remote ADB Shell on phone and fixed issue via Network connection. Great instructions

  5. works on tcl tv with android 9. you just need to enable special permission in the settings/apps/special perms/display over other apps.

    • Hi, it also works on my TCL android 9 (43EP662). Unfortunatelly I found a significant issue : after switch off/on time is displayed but no longer updated (time when switched off is displayed continuously).
      It happens in case I have set “instant power on”, means OS goes to standby after switch off. In case of “normal power on” (system boot up same like when power is connected) it works fine, but in this case TV is switching on toooooo long.
      Any idea ? Thank you

      • Hi Radko, that is excellent info. Can you confirm that when you first install the app, the clock updates correctly every minute until you switch off the tv (in instant power on mode)? From then on it no longer works until you reboot the device. Correct?

        • Hi Mattie,
          Tanks a lot for response.
          It seems it is a little bit more complex.
          I supposed that when I installed it first time that it was working = displayed time was updated as expected. But now, when I remove app and install again it does not work until I power TV off and on. I also found that in case the displayed time is not updated also some settings has no effect. For example display clock enabe/disable has no effect But swap between digital and analog face works – each time I switch between analog and digital displayed time is updated, but then frozen again…

          • Hi Radko/ddd, please email to address specified in playstore and send me your email address which you use to install apps so you can install an internal testing build.
            (Google tells me the email address you have specified on the blog here does not exist..)

Leave a Reply

Your email address will not be published. Required fields are marked *