Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea5f5db5 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

allow to load preparation config file from DeviceHelper.java by adding a...

allow to load preparation config file from DeviceHelper.java by adding a parameter to the method 'loadStepTree(...)'
parent 6ac5f826
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -92,9 +92,10 @@ public class DeviceHelper {
     * @throws java.io.IOException  
     * @throws java.text.ParseException  
     */
    public static StepTree loadStepTree(String adbDevice) throws IOException, ParseException, NumberFormatException, NullPointerException{
    public static StepTree loadStepTree(String adbDevice, boolean isPreparation) throws IOException, ParseException, NumberFormatException, NullPointerException{

        final Map yamlContent = loadYaml(adbDevice+"_flash.yml");
        String fileName = adbDevice+ (isPreparation ? "_preparation.yml":"_flash.yml");
        final Map yamlContent = loadYaml(fileName);
        final int stepsCount = (Integer) yamlContent.get("stepsCount");
        final HashMap<String, IStep> steps = parseSteps( (HashMap) yamlContent.get("steps") );
        //@TODO: check if steps is null, etc.