private void Unlock(CancellationToken token) { Debug.WriteLine("Unlock(CancellationToken)"); Trace.WriteLine("---------- スリープモードから復帰開始 ----------"); AdbOperation.PushPowerButton(); Sleep("UnlockPowerInterval", _androidDevice.UnlockPowerInterval, token); switch (_androidDevice.UnlockType) { case AndroidDevice.UnlockTypeEnum.None: Trace.WriteLine("端末アンロック: スワイプ"); AdbOperation.Swipe(_androidDevice.UnlockXStart, _androidDevice.UnlockYStart, _androidDevice.UnlockXEnd, _androidDevice.UnlockYEnd, _androidDevice.UnlockDuration); break; case AndroidDevice.UnlockTypeEnum.Pin: Trace.WriteLine("端末アンロック: スワイプ"); AdbOperation.Swipe(_androidDevice.UnlockXStart, _androidDevice.UnlockYStart, _androidDevice.UnlockXEnd, _androidDevice.UnlockYEnd, _androidDevice.UnlockDuration); Sleep("UnlockSwipeInterval", _androidDevice.UnlockSwipeInterval, token); Trace.WriteLine("端末アンロック: PIN入力"); AdbOperation.InputText(_androidDevice.UnlockPassword); Sleep("UnlockInputInterval", _androidDevice.UnlockInputInterval, token); Trace.WriteLine("端末アンロック: Enter押下"); AdbOperation.InputKeyEvent("KEYCODE_ENTER"); break; case AndroidDevice.UnlockTypeEnum.PinWithoutEnter: Trace.WriteLine("端末アンロック: スワイプ"); AdbOperation.Swipe(_androidDevice.UnlockXStart, _androidDevice.UnlockYStart, _androidDevice.UnlockXEnd, _androidDevice.UnlockYEnd, _androidDevice.UnlockDuration); Sleep("UnlockSwipeInterval", _androidDevice.UnlockSwipeInterval, token); Trace.WriteLine("端末アンロック: PIN入力"); AdbOperation.InputText(_androidDevice.UnlockPassword); Sleep("UnlockInputInterval", _androidDevice.UnlockInputInterval, token); break; case AndroidDevice.UnlockTypeEnum.Passowrd: Trace.WriteLine("端末アンロック: スワイプ"); AdbOperation.Swipe(_androidDevice.UnlockXStart, _androidDevice.UnlockYStart, _androidDevice.UnlockXEnd, _androidDevice.UnlockYEnd, _androidDevice.UnlockDuration); Sleep("UnlockSwipeInterval", _androidDevice.UnlockSwipeInterval, token); Trace.WriteLine("端末アンロック: Password入力"); AdbOperation.InputText(_androidDevice.UnlockPassword); Sleep("UnlockInputInterval", _androidDevice.UnlockInputInterval, token); Trace.WriteLine("端末アンロック: Enter押下"); AdbOperation.InputKeyEvent("KEYCODE_ENTER"); break; } Trace.WriteLine("---------- スリープモードから復帰完了 ----------"); }
private void GoToSleepMode() { Debug.WriteLine("GoToSleepMode()"); Trace.WriteLine("スリープモードへ移行"); AdbOperation.PushPowerButton(); }