Author Topic: screen of devices turn on at random  (Read 131 times)

Offline ris

  • Member
  • **
  • Posts: 3631
screen of devices turn on at random
« on: September 28, 2017, 09:20:15 PM »
anybody experienced this?  im thinking the culprit is my new android tv box.  since its just recently that it has been happening.  not sure though if this has been happening since before and i just noticed it now.  what happens is that my android tv box turns on by itself at times.  and even my android phone turns it screen on too.  but since my phone has a sleep function, it turns off after a few seconds.  my android tv box does not.  anybody here know a fix for this?  or is there any way i could enable a sleep function for the tv box?  like turn off when there is no user initiated commands for a certain period?  like if i keep it on for 5 hours straight and not use the mouse or remote to control it, could it just shut down by itself?  im guessing there should be an app or even a setting for that.  the tv box is recognized as a tablet from what the power menu says
To steal ideas from one person is plagiarism
To steal from many is research

Offline lahar

  • Member
  • **
  • Posts: 7145
Re: screen of devices turn on at random
« Reply #1 on: September 28, 2017, 09:29:17 PM »
Thats probably due to you being logged on in an app (like Gmail or FB) and it keeps notifying you. There's got to be a something in the settings, check on the power saving or scheduler just like in your fone. Though I just simply unplug mine when not in use. 

Offline barurutor

  • Moderators
  • Member
  • *
  • Posts: 3445
  • The Truth Shall Make Ye Fret.
Re: screen of devices turn on at random
« Reply #2 on: September 29, 2017, 10:00:59 AM »
Disable notifications on your android tv box, though why you would install messaging or social media apps on a tv box eludes me.
<insert witty saying or hobby specs here>

Offline ris

  • Member
  • **
  • Posts: 3631
Re: screen of devices turn on at random
« Reply #3 on: September 29, 2017, 06:26:33 PM »
i did not install any social media apps.  it probably had some pre installed social apps doing those.  ill check if its the notifications that does that too
To steal ideas from one person is plagiarism
To steal from many is research

Offline ris

  • Member
  • **
  • Posts: 3631
Re: screen of devices turn on at random
« Reply #4 on: October 04, 2017, 08:48:30 AM »
not confirmed but i checked if there are notifications when i see the tv box turn on.  and it seems there really is a notification. 

i checked display and there is a sleep function there.  but it only maxes out at 30mins.  i want to set it higher.  any mod i could do to this?  the tv box is rooted so i guess its possible to change that setting right?
To steal ideas from one person is plagiarism
To steal from many is research

Offline splerdu

  • Veterans
  • Member
  • ***
  • Posts: 7012
Re: screen of devices turn on at random
« Reply #5 on: October 04, 2017, 09:01:12 AM »

android.provider.Settings.System.putInt(getContentResolver(),
            Settings.System.SCREEN_OFF_TIMEOUT, time);


* time = screen timeout in number of milliseconds

Edit: milliseconds, not seconds.
fhtagn

Offline ris

  • Member
  • **
  • Posts: 3631
Re: screen of devices turn on at random
« Reply #6 on: October 05, 2017, 05:09:38 AM »

android.provider.Settings.System.putInt(getContentResolver(),
            Settings.System.SCREEN_OFF_TIMEOUT, time);


* time = screen timeout in number of seconds

how do i input that?  should i use root explorer and access a certain file?  thanks for the input
To steal ideas from one person is plagiarism
To steal from many is research

Offline splerdu

  • Veterans
  • Member
  • ***
  • Posts: 7012
Re: screen of devices turn on at random
« Reply #7 on: October 05, 2017, 05:26:42 AM »
It's Java.

Get the Android SDK, make your own little app with the code in it (maybe a little input box so you can enter whatever timeout value you want), push to your device, run!


The settings themselves are stored using sqllite, so it should be possible to change them from console or adb shell.

$ adb shell
#sqlite3 /data/data/com.android.providers.settings/databases/settings.db
#update system set value='3600000' where name='screen_off_timeout'

Will set the timeout to 1 hour.

ADB shell is part of the SDK, you can access your phone through a USB cable. You can also get Terminal Emulator from the Play Store get right at the linux insides of your device and run the sqllite3 cli from there.
fhtagn

Offline ris

  • Member
  • **
  • Posts: 3631
Re: screen of devices turn on at random
« Reply #8 on: October 05, 2017, 07:01:38 AM »
It's Java.

Get the Android SDK, make your own little app with the code in it (maybe a little input box so you can enter whatever timeout value you want), push to your device, run!


The settings themselves are stored using sqllite, so it should be possible to change them from console or adb shell.

$ adb shell
#sqlite3 /data/data/com.android.providers.settings/databases/settings.db
#update system set value='3600000' where name='screen_off_timeout'

Will set the timeout to 1 hour.

ADB shell is part of the SDK, you can access your phone through a USB cable. You can also get Terminal Emulator from the Play Store get right at the linux insides of your device and run the sqllite3 cli from there.

looks quite hard.  lolz!  im not familiar with creating my own app.  ill try to see if i could do a simple text edit on the settings.db file.  thanks for the explanation
To steal ideas from one person is plagiarism
To steal from many is research

Offline splerdu

  • Veterans
  • Member
  • ***
  • Posts: 7012
Re: screen of devices turn on at random
« Reply #9 on: October 05, 2017, 07:18:08 AM »
^ Not gonna work. The file is not text and even if you find the value you want, saving it with a text editor will corrupt something else.

Just get Terminal Emulator and do it from the CLI.
fhtagn

Offline ris

  • Member
  • **
  • Posts: 3631
Re: screen of devices turn on at random
« Reply #10 on: October 05, 2017, 05:34:20 PM »
i get an error opening database file.  lolz!  i got to open sqlite3 though but im not sure if i accessed settings.db correctly.  got terminal emulator to work and access sqlite3 using this command 'sqlite3 /data/data/com.android.providers.settings/databases/settings.db'. but other than that i cannot do anything else.  even with the '.open' command it gives me an error. 
To steal ideas from one person is plagiarism
To steal from many is research