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

Commit 469e5a0d authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

remove unused method, unused import from many classes. Also replace...

remove unused method, unused import from many classes. Also replace ThreadFactory.getProcessMould() by Phone.getProcess()
parent 53fbd580
Loading
Loading
Loading
Loading
+13 −22
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import ecorp.easy.installer.controllers.stepControllers.Stoppable;
import ecorp.easy.installer.models.Phone;
import ecorp.easy.installer.models.steps.IStep;
import ecorp.easy.installer.tasks.CommandExecutionTask;
import ecorp.easy.installer.threads.ThreadFactory;
import ecorp.easy.installer.utils.UiUtils;

import java.io.IOException;
@@ -62,10 +61,9 @@ public class MainWindowController implements Initializable {
    @FXML Button nextButton;
    @FXML Label titleLabel;
    
    ResourceBundle i18n ;//internationalization
    String currentSubRootId =null;
    ThreadFactory factory = new ThreadFactory("/yaml/");
    Phone device; //Object encapsulating data about the device to flash
    private ResourceBundle i18n ;//internationalization
    private String currentSubRootId =null;
    Phone phone; //Object encapsulating data about the device to flash
    private String currentStepKey = "f0";
    
    private Object subController;
@@ -195,7 +193,7 @@ public class MainWindowController implements Initializable {
                    String fxmlName = "";
                    String title ="installationTitle";
                    if(currentStepKey.equals(IStep.LAST_STEP_KEY)){
                        if(device.isFlashed()){
                        if(phone.isFlashed()){
                            fxmlName="7-flashResult.fxml";
                            title="installationTitle";
                        }else{
@@ -203,7 +201,7 @@ public class MainWindowController implements Initializable {
                            title="feedback_mTitle";
                        }
                    }else{
                        final IStep step = factory.getFlashMould().getSteps().get(currentStepKey);
                        final IStep step = phone.getFlashingProcess().getSteps().get(currentStepKey);

                        switch(step.getType()){
                            case "askAccount":
@@ -241,7 +239,7 @@ public class MainWindowController implements Initializable {
                case "flashResultRoot":
                    final String fxmlFileName;
                    final String nextViewTitle;
                    if( device.isFlashed() ){
                    if( phone.isFlashed() ){
                        fxmlFileName = "8-congrats.fxml";
                        nextViewTitle ="congrats_mTitle";
                    }
@@ -274,13 +272,12 @@ public class MainWindowController implements Initializable {
    
    /**
     * Put device object inside the factory
     * @param device the device object
     * @param phone the device object
     */
    public void setDevice(Phone device){
        this.factory.changeMould(device);
        this.device = device;
        CommandExecutionTask.updateCommonParam("DEVICE_ID", device.getSerialNo());
        CommandExecutionTask.updateCommonParam("DEVICE_DEVICE", device.getAdbDevice());
    public void setPhone(Phone phone){
        this.phone = phone;
        CommandExecutionTask.updateCommonParam("DEVICE_ID", phone.getSerialNo());
        CommandExecutionTask.updateCommonParam("DEVICE_DEVICE", phone.getAdbDevice());
    }
    
    /**
@@ -294,7 +291,6 @@ public class MainWindowController implements Initializable {
    
    /**
     * Close previous view after a fadeOut, and open new view
     * @param previousNodeId
     * @param fxmlName
     * @param viewTitle 
     * @param controller optionnal controller for the new UI. Should be null if already defined in FXML
@@ -403,11 +399,6 @@ public class MainWindowController implements Initializable {
            });
    }
    
    
// Private method relative to Flash & preparation Thread
    public ThreadFactory getThreadFactory(){
        return factory;
    }
// Other methods
    /**
     * Method call when app is closing
@@ -451,8 +442,8 @@ public class MainWindowController implements Initializable {
     * Allow subController to access to the device's information
     * @return 
     */
    public Phone getDevice() {
        return device;
    public Phone getPhone() {
        return phone;
    }
    
    
+2 −2
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ public class CustomExecutableController extends StepController<CustomExecutableS
        new Locale.Builder()
       .setRegion("en")
       .setLanguage("EN")
       .setVariant(parentController.getDevice().getInternalCode())
       .setVariant(parentController.getPhone().getInternalCode())
       .build());
    
    private int currentEmphasizedInstruction = 0;
@@ -89,7 +89,7 @@ public class CustomExecutableController extends StepController<CustomExecutableS
        displayInstructionImage(instructions.get(currentEmphasizedInstruction));
        instructionsCount = instructions.size();
        
        globalProgressMgr = new FlashGlobalProgressManager(parentController.getThreadFactory().getStepsCount());
        globalProgressMgr = new FlashGlobalProgressManager(parentController.getPhone().getFlashingProcess().getStepsCount());
        for(int i = 0;i < step.getStepNumber(); i++){
            globalProgressMgr.updateProgression();
        }
+2 −2
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ public class CustomStepController extends StepController<ICustomStep>{
        new Locale.Builder()
       .setRegion("en")
       .setLanguage("EN")
       .setVariant(parentController.getDevice().getInternalCode())
       .setVariant(parentController.getPhone().getInternalCode())
       .build());
    
    private int currentEmphasizedInstruction = 0; 
@@ -77,7 +77,7 @@ public class CustomStepController extends StepController<ICustomStep>{
        instructionsCount = instructions.size();

        
        globalProgressMgr = new FlashGlobalProgressManager(parentController.getThreadFactory().getStepsCount());
        globalProgressMgr = new FlashGlobalProgressManager(parentController.getPhone().getFlashingProcess().getStepsCount());
        for(int i = 0;i < step.getStepNumber(); i++){
            globalProgressMgr.updateProgression();
        }
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ public class LoadStepController extends StepController<LoadStep> implements Stop
        }
        
        
        globalProgressMgr = new FlashGlobalProgressManager(parentController.getThreadFactory().getStepsCount());
        globalProgressMgr = new FlashGlobalProgressManager(parentController.getPhone().getFlashingProcess().getStepsCount());
        for(int i = 0;i < step.getStepNumber(); i++){
            globalProgressMgr.updateProgression();
        }
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public class StepController<S extends IStep> implements Initializable{
        final String stepKey = parentController.getCurrentStepKey();
        System.out.println("stepKey = "+stepKey);
        
        step = (S) parentController.getThreadFactory().getFlashMould().getSteps().get(stepKey);
        step = (S) parentController.getPhone().getFlashingProcess().getSteps().get(stepKey);
        
        parentController.setNextButtonOnClickListener( ( MouseEvent event) -> {
            if(event.getEventType().equals(MouseEvent.MOUSE_CLICKED)){
@@ -82,7 +82,7 @@ public class StepController<S extends IStep> implements Initializable{
        System.out.println("onStepEnd() load: "+step.getNextStepKey());
        parentController.setCurrentStepKey(step.getNextStepKey());
        if(step.getNextStepKey().equals(IStep.LAST_STEP_KEY)){
            parentController.getDevice().setFlashed();
            parentController.getPhone().setFlashed();
        }
        parentController.loadSubScene();
        
Loading