def set_up(self): EmUsecaseBase.set_up(self) if self.__load != "NO_LOAD": # Activate Loadmodule instance self.__load_module = LoadModule() # Add list of LOAD to the loadmodule self.__load_module.add_load(self.__load) # Set the brightness mode to manual self.phonesystem_api.set_brightness_mode("manual") time.sleep(2) # set brightness to 100% self.phonesystem_api.set_display_brightness(100) time.sleep(2) # Set screen timeout to 30 minutes self.phonesystem_api.set_screen_timeout(self.__screen_timeout) time.sleep(1) # wake up the board if necessary if not self.phonesystem_api.get_screen_status(): self._io_card.press_power_button(0.3) time.sleep(1) # run a load upon parameter configuration if self.__load != "NO_LOAD": # start HIGH LOAD self.__load_module.start_load() time.sleep(10) return Global.SUCCESS, "No errors"
def set_up(self): """ Execute the set up """ # Call the UseCaseBase Setup function EmUsecaseBase.set_up(self) # Check action first if self.__action_to_perform not in self.__POSSIBLE_ACTION: txt = "wrong action to perform, can only be %s and not %s" % ( self.__POSSIBLE_ACTION, self.__action_to_perform) self._logger.error(txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, txt) # Check specific option if they are chosen if self.__charger_type not in self._io_card.SUPPORTED_DEVICE_TYPE and self.__action_to_perform == "PLUG_CHARGER": txt = "io card does not support cable type %s " % self.__charger_type self._logger.error(txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, txt) # Check specific option if they are chosen if self.__boot_mode not in [ "COS", "MOS" ] and self.__action_to_perform == "BOOT_BOARD": txt = "boot mode cant be %s but only [COS, MOS] " % self.__boot_mode self._logger.error(txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, txt) # Check specific option if they are chosen if self.__action_to_perform == "BATTERY_INSERTION" and self.em_core_module.TYPE != "POWER_SUPPLY_BENCH": txt = "to perform BATTERY_INSERTION action you need to use a power supply bench and declare it on your EM testcase.xml" self._logger.error(txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, txt) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ # Call the UseCaseBase Setup function EmUsecaseBase.set_up(self) local_transition = [] self.__transition_combo = self.__transition_combo_raw .split(",") for mode in self.__transition_combo: mode = mode.upper().strip() if mode not in ["POS", "MOS", "COS", "ROS", ""]: txt = "not supported boot mode %s" % mode self._logger.error(txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, txt) elif mode != "": local_transition.append(mode) if len(local_transition) == 0: txt = "no boot mode detected, aborting test" self._logger.error(txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, txt) else: self.__transition_combo = local_transition return Global.SUCCESS, "No errors"
def set_up(self): EmUsecaseBase.set_up(self) self._logger.info("Wait 40s for the phone to be switched off") time.sleep(40) return Global.SUCCESS, "No errors"
def set_up(self): EmUsecaseBase.set_up(self) # get the tested capacity batt_info = self.update_battery_info() # initial state is dut charge at max_range if self.em_core_module.is_batt_capacity_below_target( batt_info, self.__tested_capacity): self._logger.info("Device capacity is %s : going to %s" % (self.batt_capacity, self.__tested_capacity)) self.em_core_module.monitor_charging(self.__tested_capacity, self.__time_to_charge, self.__report_file_handler) else: self._logger.info("Device capacity is %s : going to %s" % (self.batt_capacity, self.__tested_capacity)) self.em_core_module.monitor_discharging( self.__tested_capacity, self.__time_to_discharge, self.__report_file_handler, load_module=self.__load_module) return Global.SUCCESS, "No errors"
def set_up(self): """ Execute the set up """ # Call the UseCaseBase Setup function EmUsecaseBase.set_up(self) # Check if charger type is supported by your io card if self.__charger_type not in self._io_card.SUPPORTED_DEVICE_TYPE: txt = "io card does not support cable type %s " \ % self.__charger_type self._logger.error(txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, txt) if self.__action_order not in ["PLUG;UNPLUG", "UNPLUG;PLUG"]: txt = "wrong action order %s " % self.__action_order self._logger.error(txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, txt) else: self.__action = filter(None, self.__action_order.split(";")) # get em targets self._em_targets = self._target_file.parse_energy_management_targets( self._uc_name, self._tc_parameters.get_params_as_dict(), self._device.get_phone_model()) # load targets in order to measure iteration self._em_meas_verdict.load_target(self._em_targets, self.tcd_to_test) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test: """ EmUsecaseBase.set_up(self) # Set the brightness mode to manual self.phonesystem_api.set_brightness_mode("manual") time.sleep(5) # set brightness to 100% self.phonesystem_api.set_display_brightness(100) time.sleep(5) # Set screen timeout to 30 minutes self.phonesystem_api.set_screen_timeout(60 * 60) time.sleep(20) # wake up the board if necessary if not self.phonesystem_api.get_screen_status(): self._io_card.press_power_button(0.3) # unplug the SDP self.em_core_module.unplug_charger("SDP") return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test: """ EmUsecaseBase.set_up(self) # Call ConfigsParser to parse Energy_Management self._em_targets = self._target_file.parse_energy_management_targets( "LAB_EM_PS_TURN_OFF_DURING_BOOT", self._tc_parameters.get_params_as_dict(), self._device.get_phone_model()) # load targets in order to measure iteration self._em_meas_verdict.load_target(self._em_targets) # check parameter turn off way if self._turn_off_way not in ["HARDWARE_SHUTDOWN", "EMERGENCY_SHUTDOWN", "BATTERY_REMOVAL"]: raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, "The parameter TURN_OFF_WAY '%s' is not a valid way to turn off the board" % self._turn_off_way) # check parameter first turn off timing if self._first_turn_off_timing > 45: raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, "The parameter FIRST_TURN_OFF_TIMING '%s'" % self._first_turn_off_timing + " shall be under 45s or the test will be done after booting") return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ # Call the LabEmBasePS Setup function EmUsecaseBase.set_up(self) self._logger.info("Boot the board with vbatt = %s." % self.__start_vbatt) # Insert battery self._io_card.battery_connector(True) # set power supply resistor to 0 in order to get a better accuracy on the voltage self.em_core_module.pwrs_vbatt.set_resistance(0) # boot the board self.em_core_module.boot_board() # wake up the screen self.phonesystem_api.wake_screen() # unplug the SDP self._device.disconnect_board() self.em_core_module.unplug_charger("SDP") return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ # Call the UseCaseBase Setup function EmUsecaseBase.set_up(self) # Check if cable type is supported by your io card if self.__cable_type not in self._io_card.SUPPORTED_DEVICE_TYPE and self.__cable_type != "NONE": txt = "io card does not support cable type %s " % self.__cable_type self._logger.error(txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, txt) # do this job one time in case of B2B if self.__charger_is_data_cable is None: self.__charger_is_data_cable = self.em_core_module.is_host_connection_available_when_charger_plug( self.__cable_type) self._logger.info("test sequences will adjust to this") # init capacity em_info = self.update_battery_info() # discharge battery if self.em_core_module.is_batt_capacity_above_target( em_info, self.em_core_module.batt_max_capacity): self.em_core_module.monitor_discharging( self.em_core_module.batt_max_capacity, self.em_core_module.discharge_time, self.__em_meas_tab, self.__load_module) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ # Call the UseCaseBase Setup function EmUsecaseBase.set_up(self) # Check expected result first if self.__what_to_check not in self.__ACTION: txt = "wrong value for TC parameter WHAT_TO_CHECK %s, can only be %s" % ( self.__what_to_check, str(self.__ACTION)) self._logger.error(txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, txt) # Update Battery Information em_info = self.update_battery_info() if self.em_core_module.is_batt_capacity_above_target( em_info, self.em_core_module.batt_start_capacity): # Discharge part self.em_core_module.monitor_discharging( self.em_core_module.batt_start_capacity, self.em_core_module.discharge_time, self.__em_meas_tab, self.__load_module) elif self.em_core_module.is_batt_capacity_below_target( em_info, self.em_core_module.batt_start_capacity): # Charge part self.em_core_module.monitor_charging( self.em_core_module.batt_start_capacity, self.em_core_module.charge_time, self.__em_meas_tab) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test: change the thermal managament config file by a fake file. change the screen config """ EmUsecaseBase.set_up(self) # Call ConfigsParser to parse Energy_Management self._em_targets = self._target_file.parse_energy_management_targets( "LAB_EM_THERMAL_SEQUENCE_TEST", self._tc_parameters.get_params_as_dict(), self._device.get_phone_model()) # load targets in order to measure iteration self._em_meas_verdict.load_target(self._em_targets) # build a fake thermal conf self.em_api.build_fake_thermal_conf() # Set the brightness mode to manual self.phonesystem_api.set_brightness_mode("manual") time.sleep(5) # set brightness to 100% self.phonesystem_api.set_display_brightness(100) time.sleep(5) # Set screen timeout very high self.phonesystem_api.set_screen_timeout(60 * 60) time.sleep(20) # get thermal info self._thermal_dict = self.em_api.get_thermal_sensor_info() # Reboots the phone self._device.reboot(self._os) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test: """ EmUsecaseBase.set_up(self) # Set screen timeout to 30 minutes self.phonesystem_api.set_screen_timeout(60 * 60) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test: """ EmUsecaseBase.set_up(self) # Load module to have a high current drawn self.__load_module.start_load() return (Global.SUCCESS, "No errors")
def set_up(self): """ Initialize the test """ # Call the UseCaseBase Setup function EmUsecaseBase.set_up(self) # Check specific option if they are chosen if self.__charger_type not in self._io_card.SUPPORTED_DEVICE_TYPE: txt = "io card does not support charger type %s " % self.__charger_type self._logger.error(txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, txt) if self.tc_module is not None: self.tc_module.set_up_eq() self.tc_module.get_eq().set_regulation(True) start_temp = self.__temperature low_temp = self.phone_info["BATTERY"]["THERMAL_CHARGING_LOW_LIMIT"] high_temp = self.phone_info["BATTERY"]["THERMAL_CHARGING_HIGH_LIMIT"] # avoid setting temperature at not charging temp but near it if start_temp <= low_temp: self._logger.info("test temperature at %s is <= the min temperature for charging:%s, adjusting it" % (self.__temperature, low_temp)) start_temp = low_temp + 10 elif start_temp >= high_temp : self._logger.info("test temperature at %s is >= the max temperature for charging:%s, adjusting it" % (self.__temperature, high_temp)) start_temp = high_temp - 10 self.tc_module.get_eq().set_temperature(start_temp) # set the temperature self.em_api.set_thermal_management(False) # a reboot is required to apply this change self._device.reboot() # do this job one time in case of B2B if self.__charger_is_data_cable is None: self.__charger_is_data_cable = self.em_core_module.is_host_connection_available_when_charger_plug(self.__charger_type) self._logger.info("test sequences will adjust to this") # Update Battery Information em_info = self.update_battery_info() # we want to start at given capacity if self.em_core_module.is_batt_capacity_above_target(em_info, self.em_core_module.batt_start_capacity): # Discharge part self.em_core_module.monitor_discharging(self.em_core_module.batt_start_capacity, self.em_core_module.discharge_time, self.__em_meas_tab, self.__load_module) elif self.em_core_module.is_batt_capacity_below_target(em_info, self.em_core_module.batt_start_capacity): # charge part self.em_core_module.monitor_charging(self.em_core_module.batt_start_capacity, self.em_core_module.charge_time, self.__em_meas_tab) # wait that the board see the test temperature self.__wait_for_temp(self.__temperature) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ EmUsecaseBase.set_up(self) # plug the charger type self._io_card.simulate_insertion(self.__charger_type) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ EmUsecaseBase.set_up(self) # now we have to set brightness to a low value to limit drawn current self.phonesystem_api.set_display_brightness(5) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ EmUsecaseBase.set_up(self) UECmdTestTool.set_up(self, self.tc_order) # load targets in order to measure iteration self._em_meas_verdict.load_target(self._em_targets, self.tcd_to_test) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test: """ EmUsecaseBase.set_up(self) # reboot if battery type is not analog if self._battery_type == "BATTERY_EMULATOR": self.em_core_module.reboot_board() return Global.SUCCESS, "No errors"
def set_up(self): """ Charge the board to match the start capacity. """ # Call the UseCaseBase Setup function EmUsecaseBase.set_up(self) # check battery state is in expected value if self.__expected_batt_state not in [ "CHARGING", "DISCHARGING", "NOT CHARGING", "FULL" ]: tmp_txt = "unknown EXPECTED_BATT_STATE value : %s" % \ str(self.__expected_batt_state) self._logger.error(tmp_txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, tmp_txt) if self.__multimedia_type in ["AUDIO", "VIDEO"]: self.__multimedia_type = self.__multimedia_type.capitalize() self.__multimedia_api = self._device.get_uecmd( self.__multimedia_type) elif self.__multimedia_type != "NONE": tmp_txt = "unknown multimedia type: %s" % \ str(self.__multimedia_api) self._logger.error(tmp_txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, tmp_txt) # init capacity self.update_battery_info() self._em_targets = self._target_file.parse_energy_management_targets( "LAB_EM_BATT_MAINTENANCE_CHARGING", self._tc_parameters.get_params_as_dict(), self._device.get_phone_model()) # load targets in order to measure iteration self._em_meas_verdict.load_target(self._em_targets) # update battery temperature expected depending of TCT if self.tc_module is not None: if self._em_targets[ "THERMAL_MSIC_REGISTER_MAINTENANCE.BATTERY.TEMP"] is not None: EMUtil.update_conf( self._em_targets[ "THERMAL_MSIC_REGISTER_MAINTENANCE.BATTERY.TEMP"], ["lo_lim", "hi_lim"], self._tct, "*") # Charge battery self.em_core_module.monitor_charging( self.em_core_module.batt_max_capacity, self.em_core_module.charge_time, self.__em_meas_tab) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ # Call the LabEmBasePS Setup function EmUsecaseBase.set_up(self) # if the battery type is emulator, we need to reboot the board # in order to take in account new battery emulator mode self._device.reboot() return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ # Call the UseCaseBase Setup function EmUsecaseBase.set_up(self) # Check specific option if they are chosen if self.__charger_type not in self._io_card.SUPPORTED_DEVICE_TYPE: txt = "io card does not support charger type %s " % self.__charger_type self._logger.error(txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, txt) # Update Battery Information em_info = self.update_battery_info() if self.em_core_module.is_batt_capacity_above_target( em_info, self.em_core_module.batt_max_capacity): # Discharge if we are too high self.em_core_module.monitor_discharging( self.em_core_module.batt_max_capacity, self.em_core_module.discharge_time, self.__em_meas_tab, self.__load_module) if self.tc_module is not None: self.tc_module.set_up_eq() self.tc_module.get_eq().set_regulation(True) self.tc_module.get_eq().set_temperature(self.__start_temperature) # set the temperature self.em_api.set_thermal_management(False) # a reboot is required to apply this change self._device.reboot() self.phonesystem_api.set_screen_timeout(3600) # do this job one time in case of B2B if self.__charger_is_data_cable is None: self.__charger_is_data_cable = self.em_core_module.is_host_connection_available_when_charger_plug( self.__charger_type, True) self._logger.info("test sequences will adjust to this") # wait that the board see the test temperature remaining_time = time.time() self.em_core_module.adjust_batt_temp( self.__start_min_temperature, self.__start_max_temperature, self.__timeout_dut_adapt_start_temp, self.tc_module, self.__em_meas_tab) remaining_time = max( self.__timeout_dut_adapt_start_temp - (time.time() - remaining_time), 120) self.__track_battery_health_change(remaining_time) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ # Call the UseCaseBase Setup function EmUsecaseBase.set_up(self) # Disable lock screen self.phonesystem_api.disable_lockscreen() # Config the brightness if self.__boot_mode == "MOS": # set the screen on and brightness to 100% self.phonesystem_api.set_screen_timeout(3600 * 4) # deactivate set auto brightness self.phonesystem_api.set_brightness_mode("manual") # set display brightness to max value self.phonesystem_api.set_display_brightness(100) # Wake up the screen self.phonesystem_api.wake_screen() # Check the battery capacity msic_result = self.em_api.get_msic_registers() self.batt_capacity = msic_result["BATTERY"]["CAPACITY"][0] # If the test is on COS, discharge the board and launch the test if self.__boot_mode == "COS" and self.batt_capacity > self.__cos_capacity_start: self._device.reboot("MOS") self._system_api.adjust_specified_stream_volume("Media", 100) self._video_api.play(self._multimedia_path + self.__video_path, loop=True) # Discharge battery self.em_core_module.monitor_discharging(self.__cos_capacity_start, self.em_core_module.discharge_time, self.__em_meas_tab) self.em_api.set_usb_charging("on") # Check the type of Boot Mode boot_mode = self._device.get_boot_mode() # Verify if the boot mode is the right else => reboot with the correct boot mode if boot_mode != self.__boot_mode: self._logger.info("Board isn't in %s : Reboot Board" % self.__boot_mode) result = self._device.reboot(self.__boot_mode) if not result: txt = "Boot Mode isn't correct : %s ! " % self.__boot_mode self._logger.error(txt) raise DeviceException(DeviceException.INVALID_DEVICE_STATE, txt) # disconnect-connect SDP in order to clear the counter self._io_card.usb_connector(False) self._io_card.simulate_insertion("SDP") return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ # Call the UseCaseBase Setup function EmUsecaseBase.set_up(self) # check the battery capacity msic_result = self.em_api.get_msic_registers() capacity_level = msic_result["BATTERY"]["CAPACITY"][0] capacity_level = int(capacity_level) return Global.SUCCESS, "No errors"
def set_up(self): EmUsecaseBase.set_up(self) if not self.__test_type in [ "STAY_IN_FULL", "EXIT_MAINTENANCE_TRESHOLD" ]: msg = "Parameter TEST_TYPE should be STAY_IN_FULL or EXIT_MAINTENANCE_TRESHOLD" self._logger.error(msg) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, msg) # this test can be done only if we have data if not self.em_core_module.is_host_connection_available_when_charger_plug( self.__charger_to_use): msg = "Data is necessary to perform the test, not data is seen when we plug %s" % self.__charger_to_use self._logger.error(msg) raise AcsConfigException(AcsConfigException.OPERATION_FAILED, msg) # make sure that the status is FULL result = self.update_battery_info() batt_status = result["BATTERY"]["STATUS"][0].upper() if batt_status != self.__full_status: self.em_core_module.monitor_charging(self.__full_status, self.__time_to_charge_full, self.__report_file_handler) # at this time we plug the charger and monitor the full state self._logger.info( "try to see if we can see battery FULL state when %s is plugged" % self.__charger_to_use) self._device.disconnect_board() self._io_card.simulate_insertion(self.__charger_to_use) time.sleep(self.usb_sleep) self._device.connect_board() timeout = 300 full_seen = False start_time = time.time() while time.time() - start_time < timeout: if self.__get_battery_status( "SETUP:SEEKING FOR FULL") == self.__full_status: full_seen = True break if not full_seen: msg = "FULL status was not seen after %ss with %s plugged, stopping the test" % ( timeout, self.__charger_to_use) self._logger.error(msg) raise DeviceException(DeviceException.OPERATION_FAILED, msg) return Global.SUCCESS, "No errors"
def set_up(self): """ Set up the test configuration """ # Call UseCase base Setup function EmUsecaseBase.set_up(self) if self._charger not in [self._io_card.DCP, self._io_card.AC_CHGR]: tmp_txt = "Not allowed charger type for this type :%s" % \ self._charger self._logger.error(tmp_txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, tmp_txt) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ # Call the LabEmBasePS Setup function EmUsecaseBase.set_up(self) if ((self.__end_battery_voltage > self.__start_battery_voltage) or ((self.__start_battery_voltage - self.__end_battery_voltage) < self.__battery_step)): txt = "End battery voltage is higher than start battery voltage or we cant done any measure => Quit the test" raise AcsConfigException(AcsConfigException.OPERATION_FAILED, txt) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ # Call the LabEmBasePS Setup function EmUsecaseBase.set_up(self) self._logger.info("Set the board to the state %s." % self._initial_os_state) if self._initial_os_state == "OFF": self.em_core_module.unplug_charger(self._io_card.SDP) self._device.disconnect_board() self._logger.info("Switch off the board by a hard shutdown...") self._io_card.press_power_button(10) elif self._initial_os_state == "OFF_NO_BATT": # unplug the battery self._io_card.battery_connector(False) elif self._initial_os_state == "COS": # switch off the board self._device.soft_shutdown(False) # wait to switch off time.sleep(15) # reboot in cos self.em_core_module.plug_charger(self._io_card.SDP, True) # wait for reboot in COS time.sleep(30) elif self._initial_os_state == "MAIN": pass else: self._device.reboot(self._initial_os_state, wait_for_transition=True, skip_failure=True) # wait some seconds time.sleep(5) # init vbatt to the wanted one self.em_core_module.pwrs_vbatt.set_current_voltage( self._modified_vbatt, self.em_core_module.ps_properties["BATT"]["PortNumber"]) if self._charger_type != "NONE": # plug the charger for the test self.em_core_module.plug_charger(self._charger_type) # wait some seconds time.sleep(5) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test """ # Call the UseCaseBase Setup function EmUsecaseBase.set_up(self) if self.__raw_behavior not in self.__raw_behavior: tmp_txt = "Unknown value for CYCLE_BEHAVIOR, expected value must be in % and we got %s" % ( self.__CYCLE_BEHAVIOR_VAL, self.__raw_behavior) self._logger.error(tmp_txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, tmp_txt) return Global.SUCCESS, "No errors"
def set_up(self): """ Initialize the test: """ EmUsecaseBase.set_up(self) # Check if charger type is supported by your io card if self.__charger not in self._io_card.SUPPORTED_DEVICE_TYPE: txt = "io card does not support cable type %s " % self.__charger self._logger.error(txt) raise AcsConfigException(AcsConfigException.INVALID_PARAMETER, txt) # board should sleep asap self.phonesystem_api.set_screen_timeout(self.usb_sleep + self.__waitingoffset) self.phonesystem_api.set_phone_lock(0) return Global.SUCCESS, "No errors"