friendlyrobotnyc / TinyDancer

An android library for displaying fps from the choreographer and percentage of time with two or more frames dropped

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not compatible with Android TV?

Armaxis opened this issue · comments

I tried using TinyDancer in my Android TV project, but app kept crashing during startup. The reason was: java.lang.RuntimeException: Unable to create application com.android.tools.fd.runtime.BootstrapApplication: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.action.MANAGE_OVERLAY_PERMISSION dat=package:com.mobitv.client.connect.tv flg=0x10000000 } - there's no activity in Android TV that can request for overlay permission. Seems that android.permission.SYSTEM_ALERT_WINDOW is missing in Android TV too, so there's probably no chance to use TinyDancer on TV.

Maybe it's worth mentioning in readme about this limitation?

Thanks @Armaxis ! I was unaware of this, i will update the readme.

@brianPlummer thanks! I hope in future there will be an option to display overlays in Android TV, so the TinyDancer could be used.

Worth mentioning, that people might have same code base for Mobile and TV project, so they might want to have it for mobile and just disable for TV. In that case maybe there should be some extra code to protect app from crashing because of unresolved Activity here: TinyDancerBuilder:overlayPermRequest: Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,

Good idea, i'll think on the best way to go about that and will take care of it in the next few days. thanks again!

commented

it's possible to grant permission using adb (and used to be granted automatically when installed through play store): ex.
adb shell appops set your.app.id SYSTEM_ALERT_WINDOW allow