AndroidTV: Turn display off/on via adb without loosing wifi? - android

I have an Android TV for which I want to turn the display on and off based on a motion sensor. I have connected the tv to a raspberry pi via Wifi and I'm trying now via adb commands to turn off the display of the Android TV.
As far as I've seen, I need to execute the following command:
./adb shell input keyevent 26
Unfortunately, this also turns down the device and most importantly Wifi. After this the TV is offline and not reachable anymore via the IP address. So I have to use the remote to turn it on again.
So I need a way to keep the Wifi active. I've already tried the following commands without luck:
adb shell svc power stayon true
adb shell settings put global stay_on_while_plugged_in 3
I've also sideloaded a Wakelock app, but that also didn't work. After keyevent 26, the device is always offline.
The TV is a TCL 43P615.
Any ideas how I could achieve this?
Thanks

There would not be a standard way of turning off the screen (https://support.google.com/androidtv/thread/58069060/is-it-possible-to-turn-screen-off?hl=en-GB) but perhaps your TV provides one in settings or eco-mode.
Perhaps you best bet is to disable the screensaver and create a completely black fullscreen Activity that you can start and stop from adb.

Related

Adnroid-TV tcp ADB & USB-ports unusable

I want to use ADB on my Adnroid-TV over Wifi. It works like a charm, but there is main downside: although just using ADB over TCP/Wifi, the USB-Ports seem to get unusable. This especially means, that time-shift on the TV is not usable, as no USB-storage is detected anymore.
Is there a way to use ADB over Wifi and have the USB ports still functional? Can I configure the ADB server? Is there another way/app to control the TV via Wifi without loosing USB-functionality?
Regards
SEB

ADB command to launch screensaver activity

I'm turning crazy finding the way to launch the screensaver activity that can be launched from Settings > Display > Screensaver. I want to simulate from ADB clicking on the option "start now" inside the screensaver options because I need to configure some TV's to quickly launch the screensaver on demand.
I have all of them connected through Intel sticks using Android x86 Nougat stable, I can do adb through wifi without issues and I even installed Simple SSH to access through SSH in case of needed.
The keyevents are working, but there is no keyevent to launch the screensaver, only to simulate the power off button, which causes the wireless connection to go down no matter what is configured in the sleep / battery saving settings.
Is there any chance to fix this?
Thanks!
I have found the following adb command works on devices that I develop on:
adb shell am start -n "com.android.systemui/.Somnambulator"
Credit to https://stackoverflow.com/a/21485967/11385462 for pointing in the right direction. YMMV.

How to toggle turn on/off mobile data with adb command

I looking for toggle my android phone mobile data with adb command. that is usually i do it with touch my mobile data icon in settings.
i found many reference to do it, for example this question , but nothing work for me, i try use:
$ adb shell svc data enable
$ adb shell svc data disable
when i look to my android phone nothing happen.
my android is KitKat 4 and i sure have rooted
Thanks.

ADB - svc wifi disable - make it permanent?

I am trying to permanently disable Bluetooth and WiFi on some Galaxy Tab S2's. They will have material loaded onto them which can not be disseminated on the internet. Ideally I would like to physically rip the cards out but I have to many to do that - I was thinking about using ADB to somehow disable the services.
Is there a way to do this using ADB? svc wifi disable works but then a user could just re-enable it in the user interface. Any thoughts? I'm not even sure what to search for or where to start.

ADB: Libraries to simulate bluetooth device

I want to simulate a Bluetooth headset being connected to a phone, to see how my code reacts to the intents and the connection as a whole. I'm testing on a real device connected via USB, in Eclipse.
I have been able to simulate the pressing of a "media button" by running the following:
adb shell input keyevent <keycode>
I was hoping for something similar, where I can set the device name, device class etc and trigger it?
Running the following produces instructions on various calls that can be made to adb:
adb shell am start
The way to trigger an intent "ACL_CONNECTED" is by typing this:
adb shell am broadcast -a android.bluetooth.adapter.action.ACL_CONNECTED
further options can be added in the command, as per the instructions from above.
The problem is, I want to simulate all the functionality of a Bluetooth device, not just the few intents it triggers. In other words, I want a dummy Bluetooth device which is indistinguishable from a real device from the phone's point of view.

Categories

Resources