For my example I create simple TV app add button "power off" and tried to shut down my emulator where I run it.
First of all i tried to find something in documentation here https://developer.android.com/training/tv/start/hardware#hardware-permissions, but there is no hardware power controls.
After that I tried some android mobile options like here: programmatically set screen to off in android
Such as: WRITE_SETTINGS
Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT, 1000);
I think problem here with getting runtime permission that android tv can't resolve.
Also I tried options from here Android: How to turn screen on and off programmatically?
mWakeLock = mPowerManager.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, "tag");
mWakeLock.acquire();
no effect.
Manipulation with screen brightness also no effect:
params.flags |= LayoutParams.FLAG_KEEP_SCREEN_ON;
params.screenBrightness = 0;
getWindow().setAttributes(params);
Any idea what can I try? Thanks for any help