コード例 #1
0
ファイル: forcertl.py プロジェクト: qbalsdon/talos
def modify_forcertl(new_value, device):
    # adb shell settings put global debug.force_rtl 1.0
    adbSetValue("global", "debug.force_rtl", new_value, device)
    prop_value = "false"
    if new_value != "0":
        prop_value = "true"

    adbCommand(["shell", "setprop", "debug.force_rtl", prop_value], device,
               False)
    # print("SET\nProp value:   [{}]\nGlobal value: [{}]".format(prop_value, new_value))
    force_refresh(device)
コード例 #2
0
ファイル: show_touch.py プロジェクト: qbalsdon/talos
def modify_touch(new_value, device):
    adbSetValue("system", "show_touches", new_value, device)
    # technically do not need unless you are already on the settings screen
    sysprops_transaction(device)
コード例 #3
0
def turn_on_scanner(device):
    turn_on_defaults(device)
    adbSetValue(
        "secure", "enabled_accessibility_services",
        "com.google.android.apps.accessibility.auditor/com.google.android.apps.accessibility.auditor.ScannerService:com.android.talkback/com.google.android.marvin.talkback.TalkBackService",
        device)
コード例 #4
0
ファイル: brightness.py プロジェクト: qbalsdon/talos
def set_brightness(device, brightness):
    adbSetValue("system",
                "screen_brightness",
                str(brightness),
                device=device,
                output=False)
コード例 #5
0
def turn_on_defaults(device):
    adbSetValue("secure", "accessibility_enabled", "0", device)
コード例 #6
0
def turn_on_screen_reader(device):
    turn_on_defaults(device)
    adbSetValue(
        "secure", "enabled_accessibility_services",
        "com.google.android.marvin.talkback/com.google.android.marvin.talkback.TalkBackService:com.balsdon.accessibilityDeveloperService/.AccessibilityDeveloperService",
        device)
コード例 #7
0
def turn_off(device):
    adbSetValue(
        "secure", "enabled_accessibility_services",
        "com.android.talkback/com.google.android.marvin.talkback.TalkBackService",
        device)
    adbSetValue("secure", "accessibility_enabled", "0", device)
コード例 #8
0
ファイル: flip.py プロジェクト: qbalsdon/talos
def modifier(new_value):
    adbSetValue("system", "user_rotation", new_value, device)
コード例 #9
0
ファイル: flip.py プロジェクト: qbalsdon/talos
            return None
        if "-l" in arguments or "--landscape" in arguments:
            return 1
        if "-p" in arguments or "--portrait" in arguments:
            return 0
        raise ValueError("Illegal argument: " + arguments[0] + ". Usage: " + flip_usage)
    return None

def modifier(new_value):
    adbSetValue("system", "user_rotation", new_value, device)

def get_orientation(device):
    return int(adbGetValue("system", "user_rotation", device))

def flip_dictionary(device):
    return {
         0: lambda: modifier("0"), #change from LANDSCAPE to PORTRAIT
         1: lambda: modifier("1")  #change from PORTRAIT to LANDSCAPE
    }

if __name__ == "__main__":
    options = setUp(ui_required = False)
    device = options.get("device")
    args = sys.argv
    del args[0]
    direction = validateArgs(args)
    #always required
    adbSetValue("system", "accelerometer_rotation", "0", device)

    alternator(lambda: get_orientation(device), flip_dictionary(device), direction)
コード例 #10
0
def modify_font_scale(new_value, device):
    adbSetValue("system", "font_scale", new_value, device)
コード例 #11
0
ファイル: animation.py プロジェクト: qbalsdon/talos
def modify_animations(new_value, device):
    adbSetValue("global", "window_animation_scale", new_value, device)
    adbSetValue("global", "transition_animation_scale", new_value, device)
    adbSetValue("global", "animator_duration_scale", new_value, device)
    sysprops_transaction(device)  # TODO: CHECK!!