Loading src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java +25 −23 Original line number Diff line number Diff line Loading @@ -23,7 +23,9 @@ import ecorp.easy.installer.exceptions.TooManyDevicesException; import ecorp.easy.installer.models.Phone; import ecorp.easy.installer.tasks.DeviceDetectionTask; import ecorp.easy.installer.utils.UiUtils; import java.io.IOException; import java.net.URL; import java.text.ParseException; import java.util.ResourceBundle; import javafx.concurrent.WorkerStateEvent; import javafx.fxml.FXML; Loading Loading @@ -87,17 +89,10 @@ public class DeviceDetectedController extends AbstractSubController{ }); try{ Thread thread = new Thread(detectorTask); thread.setDaemon(true); thread.start(); } catch(Exception e){ logger.error("startDetection(), error: {}", e.toString()); //@TODO: handle Too many device Found Exception } } /** * Handle result of the DeviceDetectionTask Loading @@ -121,23 +116,30 @@ public class DeviceDetectedController extends AbstractSubController{ if(model == null || model.isEmpty()) displayUnknowDeviceFound(); else{ //check that there is config file for this device URL resourceUrl = getClass().getResource("/yaml/"+phone.getAdbDevice()+"_flash.yml"); if(resourceUrl == null){ //@TODO: this can be replaced or completed with a call to DeviceHelper displayIncompatibleDeviceFound(model); }else{ detectionMsg.setText(String.format(i18n.getString("detect_lbl_compatibleDeviceFound"), model)); if(parentController != null){ // Fill last property of Phone object phone.setInternalCode(DeviceHelper.getDeviceInternalcode(phone.getAdbDevice())); try{ phone.setFlashingProcess(DeviceHelper.loadFlashProcess(phone.getAdbDevice())); }catch(IOException | NullPointerException | NumberFormatException | ParseException e){ logger.debug("Can't load Flashing Process from Yaml : {}", e.getMessage()); displayIncompatibleDeviceFound(model); return; } AppConstants.setDeviceModel(phone.getAdbDevice()); //this line must be before the "parentController.setDevice(phone). If it's not the case, //the AppConstants.getSourceFolder() won't include the device model's name parentController.setDevice(phone); parentController.disableNextButton(false); } } } } //Note: Two below function could be merged and use a parameter to define detectionMsg.setText.. /** * Update UI to indicate that an unknow Device is found */ Loading src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java +2 −3 Original line number Diff line number Diff line Loading @@ -105,5 +105,4 @@ public class DeviceHelper { return flashingProcess; } } No newline at end of file src/main/java/ecorp/easy/installer/utils/ConfigParser.java +1 −4 Original line number Diff line number Diff line Loading @@ -46,9 +46,6 @@ import org.slf4j.LoggerFactory; public class ConfigParser { private final static Logger logger = LoggerFactory.getLogger(ConfigParser.class); /** * Parse steps from yaml (both for preparation and flashing) * @param yaml The data map load from yaml file Loading src/main/java/ecorp/easy/installer/models/Process.java +1 −1 File changed.Contains only whitespace changes. Show changes Loading
src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java +25 −23 Original line number Diff line number Diff line Loading @@ -23,7 +23,9 @@ import ecorp.easy.installer.exceptions.TooManyDevicesException; import ecorp.easy.installer.models.Phone; import ecorp.easy.installer.tasks.DeviceDetectionTask; import ecorp.easy.installer.utils.UiUtils; import java.io.IOException; import java.net.URL; import java.text.ParseException; import java.util.ResourceBundle; import javafx.concurrent.WorkerStateEvent; import javafx.fxml.FXML; Loading Loading @@ -87,17 +89,10 @@ public class DeviceDetectedController extends AbstractSubController{ }); try{ Thread thread = new Thread(detectorTask); thread.setDaemon(true); thread.start(); } catch(Exception e){ logger.error("startDetection(), error: {}", e.toString()); //@TODO: handle Too many device Found Exception } } /** * Handle result of the DeviceDetectionTask Loading @@ -121,23 +116,30 @@ public class DeviceDetectedController extends AbstractSubController{ if(model == null || model.isEmpty()) displayUnknowDeviceFound(); else{ //check that there is config file for this device URL resourceUrl = getClass().getResource("/yaml/"+phone.getAdbDevice()+"_flash.yml"); if(resourceUrl == null){ //@TODO: this can be replaced or completed with a call to DeviceHelper displayIncompatibleDeviceFound(model); }else{ detectionMsg.setText(String.format(i18n.getString("detect_lbl_compatibleDeviceFound"), model)); if(parentController != null){ // Fill last property of Phone object phone.setInternalCode(DeviceHelper.getDeviceInternalcode(phone.getAdbDevice())); try{ phone.setFlashingProcess(DeviceHelper.loadFlashProcess(phone.getAdbDevice())); }catch(IOException | NullPointerException | NumberFormatException | ParseException e){ logger.debug("Can't load Flashing Process from Yaml : {}", e.getMessage()); displayIncompatibleDeviceFound(model); return; } AppConstants.setDeviceModel(phone.getAdbDevice()); //this line must be before the "parentController.setDevice(phone). If it's not the case, //the AppConstants.getSourceFolder() won't include the device model's name parentController.setDevice(phone); parentController.disableNextButton(false); } } } } //Note: Two below function could be merged and use a parameter to define detectionMsg.setText.. /** * Update UI to indicate that an unknow Device is found */ Loading
src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java +2 −3 Original line number Diff line number Diff line Loading @@ -105,5 +105,4 @@ public class DeviceHelper { return flashingProcess; } } No newline at end of file
src/main/java/ecorp/easy/installer/utils/ConfigParser.java +1 −4 Original line number Diff line number Diff line Loading @@ -46,9 +46,6 @@ import org.slf4j.LoggerFactory; public class ConfigParser { private final static Logger logger = LoggerFactory.getLogger(ConfigParser.class); /** * Parse steps from yaml (both for preparation and flashing) * @param yaml The data map load from yaml file Loading
src/main/java/ecorp/easy/installer/models/Process.java +1 −1 File changed.Contains only whitespace changes. Show changes