Skip to content

Commit

Permalink
fix driver fixing present on no win platf
Browse files Browse the repository at this point in the history
  • Loading branch information
francescotescari committed Nov 10, 2019
1 parent fca41dc commit 67ea297
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/com/xiaomitool/v2/engine/actions/ActionsDynamic.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.xiaomitool.v2.procedure.install.InstallException;
import com.xiaomitool.v2.procedure.uistuff.ChooseProcedure;
import com.xiaomitool.v2.procedure.uistuff.ConfirmationProcedure;
import com.xiaomitool.v2.resources.ResourcesConst;
import com.xiaomitool.v2.resources.ResourcesManager;
import com.xiaomitool.v2.utility.*;

Expand Down Expand Up @@ -93,13 +94,15 @@ public static RunnableMessage SEARCH_SELECT_DEVICES(@Nullable Device.Status... w
Log.info("Total connected device found: "+connectedDevices);
RunnableMessage nextStep;
if (connectedDevices == 0) {
new Thread(() -> {
try {
DriverUtils.fixAndroidDevices(ResourcesManager.getAndroidDriverPath());
} catch (IOException e) {
Log.error("Cannot try to fix drivers: "+e.getMessage());
}
}).start();
if (ResourcesConst.isWindows()) {
new Thread(() -> {
try {
DriverUtils.fixAndroidDevices(ResourcesManager.getAndroidDriverPath());
} catch (IOException e) {
Log.error("Cannot try to fix drivers: " + e.getMessage());
}
}).start();
}
nextStep = NO_DEVICE_CONNECTED((wantedStatus == null || wantedStatus.length == 0) ? null : wantedStatus[0]);
} else {
nextStep = SELECT_DEVICE(wantedStatus);
Expand Down

0 comments on commit 67ea297

Please sign in to comment.