Lines Matching refs:ad
463 def sync_device_time(ad):
469 ad: The android device to sync time on.
471 droid = ad.droid
550 def force_airplane_mode(ad, new_state, timeout_value=60):
554 ad
567 def wait_for_device_with_timeout(ad):
568 ad.adb.wait_for_device()
571 wait_for_device_with_timeout(ad)
572 ad.adb.shell("settings put global airplane_mode_on {}".format(
580 def enable_doze(ad):
584 ad: android device object.
590 ad.adb.shell("dumpsys battery unplug")
591 ad.adb.shell("dumpsys deviceidle enable")
592 if (ad.adb.shell("dumpsys deviceidle force-idle") !=
595 ad.droid.goToSleepNow()
597 adb_shell_result = ad.adb.shell("dumpsys deviceidle step")
603 ad.adb.shell("dumpsys battery").decode('utf-8'),
604 ad.adb.shell("dumpsys deviceidle").decode('utf-8')))
610 def disable_doze(ad):
614 ad: android device object.
620 ad.adb.shell("dumpsys deviceidle disable")
621 ad.adb.shell("dumpsys battery reset")
622 adb_shell_result = ad.adb.shell("dumpsys deviceidle step")
627 ad.adb.shell("dumpsys battery").decode('utf-8'),
628 ad.adb.shell("dumpsys deviceidle").decode('utf-8')))
634 def set_ambient_display(ad, new_state):
638 ad: android device object.
641 ad.adb.shell("settings put secure doze_enabled {}".format(1 if new_state
645 def set_adaptive_brightness(ad, new_state):
649 ad: android device object.
652 ad.adb.shell("settings put system screen_brightness_mode {}".format(
656 def set_auto_rotate(ad, new_state):
660 ad: android device object.
663 ad.adb.shell("settings put system accelerometer_rotation {}".format(
667 def set_location_service(ad, new_state):
671 ad: android device object.
677 ad.adb.shell("settings put secure location_providers_allowed +gps")
678 ad.adb.shell("settings put secure location_providers_allowed +network")
680 ad.adb.shell("settings put secure location_providers_allowed -gps")
681 ad.adb.shell("settings put secure location_providers_allowed -network")
684 def set_mobile_data_always_on(ad, new_state):
688 ad: android device object.
693 ad.adb.shell("settings put global mobile_data_always_on {}".format(