OnScreenClock permission fix

Context

You can skip this section if you just want the solution

From Android Marshmallow on, apps need to ask permission to the user for performing certain tasks, e.g. accessing contacts, or in our case: showing something on top of all other apps. Showing things on top, aka the overlay permission or more technically SYSTEM_ALERT_WINDOW permission, is considered a dangerous permission and requires special care. However, a lot of users got confused when their phone started saying “Screen overlay detected”, and big companies like Facebook started getting tons of support requests. So to mitigate the problem Google started (from Android 6.0.1) to grant this permission automatically if the app got installed through the Google Play store.

However, starting January 2019, they gradually started excluding apps from receiving this permission automatically. My little unpopular OnScreenClock app was one of the first apps to go down. In normal Android environment (non-TV), this does not pose a real problem as the user can still grant the permission themself. Unfortunately, on Android TV, there usually is no such user interface for granting the overlay permission (which requires a special user interface in contrast to “regular” permissions).

It becomes gradually more difficult to display something on top of other things, up to the point at which it will probably become impossible. However, until then, a workaround is still possible. 🙂

Workaround

The “easy” way

Unfortunately, there is no easy way yet.. 🙂 I was going to make a companion phone app to assist in granting the permission but it does not seem so trivial.. Maybe I will create a video explaining how to execute the “techy” way. If somebody feels up to it, be my guest and I will post it here!

The “unconventional” way

If you have a rooted device, you can simply press the button within the app!

This is by far the easiest way, unfortunately, most people don’t have a rooted device.

The “hard” or techy way

For the tech savvy people, this is the recommended way. Simple type the following command:

adb shell pm grant mattiesworld.gotdns.org.onscreenclock android.permission.SYSTEM_ALERT_WINDOW

An obvious prerequisite is that you have adb command line tool installed.

Some devices, like Nvidia Shield, provide a network debug option out of the box, so you don’t even need to connect your TV with a USB cable. Just run the following command before issuing the “adb shell pm etc..” command:

adb connect <ip of your tv>

23 thoughts on “OnScreenClock permission fix”

    1. hi Henrri, you have to make an ADB connection to your TV and run the adb command: “adb shell pm grant mattiesworld.gotdns.org.onscreenclock android.permission.SYSTEM_ALERT_WINDOW”

      1. y como se hace esto?
        la tenia instalada en una smart tv sony pero al actualizar a android 7 no me deja instarla onscreenoclock y me dice que activar ADB .he activado depuracion usb en opción del desarrollador y no se mas .
        ayuda y gracias

  1. Love the app!
    Is there a ADB command that would load clock at startup? Currently I have to open app every time I turn on tv

    1. Hi, thanks for the feedback. Normally (when the clock is turned on), the app should start automatically on each boot . Possibly, your TV does not broadcast the BOOT_COMPLETED event. What is the model of your TV and which Android version does it run?

  2. It’s a very useful app because many new smart TVs no longer have this feature.
    I managed to activate OpenScreenClock on a 2015 SONY TV (by the adb … method) and on a brand new 2023 SONY TV (which allowed me to assign SYSTEM_ALERT_WINDOW permission easily).

    1. thanks for the feedback. Are you saying the 2023 Sony TV has an option in the user interface to allow the overlay permission? Did the app open this function on itself on first startup or did you have to find it manually in the settings? If possible, maybe you could share a screenshot or photo to help other people? Anyway, it’s good to know! cheers

  3. Thanks for the app
    It works under Sony bravia.
    What else can be inserted would be super insert date
    DAY MONTH YEAR

    Thanks in advance

Leave a Reply to Gokuldas Gokul Cancel reply

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