-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from AfzalivE/master
Added a self-script that toggles "test mode"
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#-*- coding:UTF-8 -*- | ||
import sys | ||
import os | ||
import subprocess | ||
|
||
adb_path = os.getenv('adb_path') | ||
serial = os.getenv('serial') | ||
|
||
get_window_animation_scale_cmd = "{0} -s {1} shell settings get global window_animation_scale".format(adb_path, serial) | ||
get_transition_animation_scale_cmd = "{0} -s {1} shell settings get global transition_animation_scale".format(adb_path, serial) | ||
get_animator_duration_scale_cmd = "{0} -s {1} shell settings get global animator_duration_scale".format(adb_path, serial) | ||
|
||
get_cmds = [get_window_animation_scale_cmd, get_transition_animation_scale_cmd, get_animator_duration_scale_cmd] | ||
|
||
for cmd in get_cmds: | ||
result = subprocess.check_output(cmd, | ||
stderr=subprocess.STDOUT, | ||
shell=True).strip() | ||
mode = "0.0" | ||
if result == "0.0": | ||
mode = "1.0" | ||
|
||
put_window_animation_scale_cmd = "{0} -s {1} shell settings put global window_animation_scale {2}".format(adb_path, serial, mode) | ||
put_transition_animation_scale_cmd = "{0} -s {1} shell settings put global transition_animation_scale {2}".format(adb_path, serial, mode) | ||
put_animator_duration_scale_cmd = "{0} -s {1} shell settings put global animator_duration_scale {2}".format(adb_path, serial, mode) | ||
|
||
put_cmds = [put_window_animation_scale_cmd, put_transition_animation_scale_cmd, put_animator_duration_scale_cmd] | ||
|
||
for cmd in put_cmds: | ||
sys.stderr.write(cmd) | ||
result = subprocess.check_output(cmd, | ||
stderr=subprocess.STDOUT, | ||
shell=True).strip() | ||
|
||
print(result) |