2

I want to do screen save app like PC. If user is not interactive with device 10 minute,I can play many pics.

But I have a question:how to check if user interactive with my device?

I have read Detect if user interacts with phone?, it said I can keep track of touch events but my screen save app need check other apps if user interactive with device, so I cannot use the methods.

But system setting can set screen on or off when some times user not interactive with device. How system do this ? Can I modify the system source, can you give some clue to tell me which code I can modify, or tell me how system to check if user interactive with device?

edit: i search source code i use :

try { Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT, 8000);

    } catch (NumberFormatException e) {
        Log.e("aa", "could not persist screen timeout setting", e);
    }

but it is not effect

Community
  • 1
  • 1
pengwang
  • 19,536
  • 34
  • 119
  • 168

1 Answers1

1

i modify the time as the same as system time time all is Ok

try { Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT, 1000*15);

} catch (NumberFormatException e) {
    Log.e("aa", "could not persist screen timeout setting", e);
}
pengwang
  • 19,536
  • 34
  • 119
  • 168