Module: DroidAdbs::Doze
- Defined in:
- lib/droid_adbs/commons/doze.rb
Class Method Summary collapse
-
.force_idle ⇒ String
Message from adb command.
-
.reset ⇒ String
Message from adb command.
Class Method Details
.force_idle ⇒ String
Returns message from adb command.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/droid_adbs/commons/doze.rb', line 5 def force_idle `#{::DroidAdbs.shell} dumpsys battery unplug`.strip `#{::DroidAdbs.shell} dumpsys deviceidle force-idle`.strip result = false 30.times do deviceidle = `#{::DroidAdbs.shell} dumpsys deviceidle`.strip result = deviceidle.include?("mState=IDLE mLightState=OVERRIDE") break if result sleep 0.5 end result end |