Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public <T> T execute(JadbDeviceCommand<T> command, Device device) {
- try (AdbWrapper adbWrapper = adbWrapperFactory.startAdb(device)) {
- final JadbDevice jadbDevice = connectAdbToDeviceIfRequired(adbWrapper, device);
- return command.execute(jadbDevice);
- } catch (Exception e) {
- return repeatWithDelayOrThrow(executionCounter, command, device);
- }
- }
- private <T> T repeatWithDelayOrThrow(int executionCounter, JadbDeviceCommand<T> command, Device device) {
- if (executionCounter >= repeater.getRetryCount()) {
- throw new RuntimeException("Too many fails (" + executionCounter + ") when executing cmd " + command.getClass().getName());
- }
- return execute(command, device);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement