WO2023000777A1 - Method for performing restarting during upgrade process of recovery mode, and terminal - Google Patents
Method for performing restarting during upgrade process of recovery mode, and terminal Download PDFInfo
- Publication number
- WO2023000777A1 WO2023000777A1 PCT/CN2022/092001 CN2022092001W WO2023000777A1 WO 2023000777 A1 WO2023000777 A1 WO 2023000777A1 CN 2022092001 W CN2022092001 W CN 2022092001W WO 2023000777 A1 WO2023000777 A1 WO 2023000777A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- terminal
- restart
- recovery mode
- button
- volume
- Prior art date
Links
- 238000011084 recovery Methods 0.000 title claims abstract description 137
- 238000000034 method Methods 0.000 title claims abstract description 106
- 230000008569 process Effects 0.000 title claims abstract description 58
- 238000005192 partition Methods 0.000 claims description 28
- 238000004590 computer program Methods 0.000 claims description 14
- 238000004891 communication Methods 0.000 description 28
- 230000006870 function Effects 0.000 description 28
- 238000007726 management method Methods 0.000 description 28
- 238000012545 processing Methods 0.000 description 22
- 238000010586 diagram Methods 0.000 description 16
- 238000010295 mobile communication Methods 0.000 description 9
- 230000002159 abnormal effect Effects 0.000 description 8
- 230000008859 change Effects 0.000 description 6
- 230000005236 sound signal Effects 0.000 description 6
- 229920001621 AMOLED Polymers 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000005856 abnormality Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 2
- 230000006378 damage Effects 0.000 description 2
- 239000002096 quantum dot Substances 0.000 description 2
- 230000000717 retained effect Effects 0.000 description 2
- 230000008901 benefit Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000005855 radiation Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000008719 thickening Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Definitions
- the present application relates to the technical field of terminals, in particular to a restart method and a terminal during recovery mode upgrade.
- Recovery mode is an Android (Android) phone backup function, which refers to a mode that can modify the internal data or system of an Android phone (similar to windows PE or DOS). In this mode, the existing system can be backed up or upgraded, and the factory settings can also be restored here.
- Android Android
- the power button needs to be used to confirm the selection, so the power button is not shielded.
- a text prompt will be given.
- the power button is pressed for a long time and the long press time reaches the restart/shutdown time requirement, it will cause the mobile phone to shut down. Therefore, during the upgrade process of Recovery mode, there may be accidental touches that cause the mobile phone to shut down, that is, the mobile phone shuts down caused by mistakenly pressing the power button for a long time.
- the embodiment of the present application provides a method and terminal for restarting during the upgrading process of the recovery mode, which can reduce the restarting caused by the user's mistaken touch during the upgrading process of the recovery mode, thereby reducing the probability that the mobile phone cannot be used.
- the present application provides a restart method in the recovery mode upgrade process, the method includes: the terminal searches for the system version update package under the main system and downloads it, and after the download is completed, detects whether the user performs a preset operation (such as clicking restart control); if it is detected that the user performs a preset operation, the terminal will call the restart command under the main system and add the restart parameter recovery to restart; when the terminal restarts to lk (little kernel/small operating system (little kernel, lk for short) )) phase, detect whether to enter the recovery mode; if it is detected that the terminal enters the recovery mode during the restart process, the terminal will configure the forced shutdown button to press and hold the power button and the volume button at the same time for a preset time.
- the volume key here can be either a volume up key or a volume down key.
- the preset time here can be 10s or 15s, etc.
- this solution can not only reduce the restart caused by the user's accidental touch during the recovery mode upgrade process (this is Because the probability of the user accidentally touching the combination key at the same time is low), thereby reducing the probability of the mobile phone being unusable, it can also solve the problem of not being able to directly exit the recovery mode in abnormal scenarios (such as a crash, the mobile phone cannot operate normally, etc.) (this is because this solution The forced restart/shutdown function is still retained in recovery mode).
- the terminal configures the forced shutdown button to simultaneously press and hold the power button and the volume button for a preset time, including: the terminal calls a power management integrated circuit (Power Management IC, pmic) to set the register The value is set to 0x01, so that the forced shutdown key is set as a combination key (such as the power key and the volume up key, or the power key and the volume down key, or the volume up key and the volume down key), that is to say, the forced restart trigger mode is set Press and hold the key combination at the same time.
- a power management integrated circuit Power Management IC, pmic
- the forced shutdown button is the power button. That is to say, when the terminal starts to the lk stage, it will call pmic to set the register value to 0x00; when the terminal (in the lk stage) determines to enter the recovery mode, it will call pmic again to set the register value to 0x01 (or set the register value to 0x01). value changed from 0x00 to 0x01).
- the terminal detects whether to enter the recovery mode during the restart process, including: the terminal detects whether there is a flag bit boot-recovery in the misc partition during the restart process; if the terminal detects the misc partition If there is a flag bit boot-recovery in the terminal, the terminal determines to enter the recovery mode during the restart process. If the flag bit boot-recovery does not exist in the misc partition, it means that the recovery mode has not been entered.
- this solution can accurately determine whether the terminal enters the recovery mode by detecting whether the flag bit boot-recovery exists in the misc partition.
- the method further includes: after the terminal enters the recovery mode, monitor the physical buttons of the terminal through a thread, where the physical buttons include a power button, a volume up button, and a volume down button one or more; when it is detected that the power button is long pressed, the terminal monitors whether the volume button is long pressed at the same time; when it is detected that the power button is long pressed and the volume button is not If the preset time is exceeded; if the power button is pressed for longer than the preset time, the terminal will output a first prompt message, which is used to prompt the risk of forced restart and the correct forced shutdown method.
- the way for the terminal to output the first prompt information may be voice, text, ringing, vibration and other ways.
- the terminal outputs the first prompt information, including: the terminal calls the display interface to display the first prompt information at a preset position on the terminal screen (such as the original upgrade interface), and the input parameters of the display interface include the first prompt information and preset positions.
- the preset position is the displayed position coordinates.
- the method further includes: if it is detected that a long press of the power button and a long press of the volume key are detected at the same time, the terminal monitors whether the time of the simultaneous long press exceeds the above preset time; If the time of the long press does not exceed the preset time, the terminal outputs second prompt information, and the second indication information is used to prompt the risk of forced restart.
- the manner in which the terminal outputs the second prompt information may be voice, text, ringing, vibration, and the like.
- the terminal outputs the second prompt information, including: the terminal calls the display interface to display the second prompt information at a preset position on the terminal screen (such as the original upgrade interface), and the input parameters of the display interface include the second prompt information and preset positions.
- the preset position is the displayed position coordinates.
- the method further includes: after the terminal exits the recovery mode, the terminal calls the power management integrated circuit to set the register value to 0x00 during the restart process.
- the embodiment of the present application provides a terminal, and the terminal includes a unit for performing the restart method in the recovery mode upgrade process provided by the above-mentioned first aspect and/or any possible implementation manner of the first aspect and/or modules, so the beneficial effects (or advantages) of the restart method in the recovery mode upgrade process provided by the first aspect can also be realized.
- the present application provides a terminal, including a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and when the processor runs the program instructions, the terminal is made to execute the above-mentioned On the one hand, it provides a restart method during the recovery mode upgrade process.
- the embodiments of the present application provide a computer-readable storage medium for storing computer program instructions used by the first electronic device, including the program for executing the above-mentioned first aspect.
- the present application provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the method for restarting in the recovery mode upgrade process described in the first aspect above.
- Figure 1 is a schematic diagram of the interface changes when pressing and holding the power button during the recovery mode upgrade process
- FIG. 2A is a schematic structural diagram of a terminal provided in an embodiment of the present application.
- FIG. 2B is another schematic structural diagram of a terminal provided by an embodiment of the present application.
- FIG. 3 is a block diagram of a software structure of a terminal provided in an embodiment of the present application.
- FIG. 4 is a schematic flowchart of a restart method in the recovery mode upgrade process provided by the embodiment of the present application.
- Fig. 5 is a schematic diagram of the recovery main interface and the erecovery main interface provided by the embodiment of the present application;
- Fig. 6A is a schematic diagram of the first prompt interface provided by the embodiment of the present application.
- Fig. 6B is another schematic diagram of the first prompt interface provided by the embodiment of the present application.
- Fig. 7 is a schematic diagram of the interface change provided by the embodiment of the present application by pressing and holding the power button and the volume button at the same time;
- FIG. 8 is another schematic flowchart of a restart method during an upgrade in recovery mode provided by an embodiment of the present application.
- “at least one” means one or more, and “multiple” means two or more.
- “And/or” describes the association relationship of associated objects, indicating that there can be three types of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist at the same time, and B exists alone, where A, B can be singular or plural.
- the character “/” generally indicates that the contextual objects are an “or” relationship.
- “At least one of the following” or similar expressions refer to any combination of these items, including any combination of single or plural items.
- At least one item (unit) of a, b, or c may represent: a, b, c; a and b; a and c; b and c; or a and b and c.
- a, b, c can be single or multiple.
- words such as “first” and “second” do not limit the number and order of execution, and words such as “first” and “second” do not necessarily limit the difference.
- B corresponding to A means that B is associated with A, and B can be determined according to A.
- determining B according to A does not mean determining B only according to A, and B may also be determined according to A and/or other information.
- Figure 1 is a schematic diagram of the interface change when pressing and holding the power button during the recovery mode upgrade process.
- the terminal will output text prompts on the upgrade interface, such as "Warning: A long press of the power button has been detected, please release it immediately.” Turn on the power button to avoid device abnormalities.”
- the terminal will be forced to shut down.
- the phone will shut down.
- the partition content will be overwritten and erased. If the upgrade is not completed and the phone is forced to shut down, it may cause damage to a key partition, which will cause the phone to fail to boot into the main system and recovery mode, causing the phone to fail. Not available.
- the embodiment of the present application provides a restart method during the recovery mode upgrade process.
- the forced restart function is configured as long pressing the power button and the volume button for a period of time, which can not only reduce the recovery mode upgrade process It can reduce the probability of the mobile phone being unusable due to the restart caused by the user's mistaken touch, and can also solve the problem of not being able to directly exit the recovery mode in abnormal scenarios (such as crashes, mobile phones not operating normally, etc.).
- FIG. 2A is a schematic structural diagram of a terminal provided by an embodiment of the present application.
- the terminal shown in FIG. 2A may be a mobile phone.
- the terminal 100 may include a processor 111 , a memory 112 , keys 113 , and a display 114 .
- the processor 111, the memory 112, the keys 113, and the display screen 114 can be connected through a bus. It can be understood that, the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal 100 .
- the terminal 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange different components, which may be determined according to actual applications.
- the scene is determined, and there is no limitation here.
- the components shown in FIG. 2A can be implemented in hardware, software, or a combination of software and hardware.
- the processor 111 may include one or more processing units, for example: the processor 111 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal Processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) and so on.
- application processor application processor, AP
- modem processor graphics processing unit
- graphics processing unit graphics processing unit
- ISP image signal processor
- controller memory
- video codec digital signal processor
- DSP digital signal processor
- baseband processor baseband processor
- neural network processor neural-network processing unit
- the controller may be the nerve center and command center of the terminal 100 .
- the controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
- a memory may also be provided in the processor 111 for storing instructions and data.
- the memory in processor 111 is a cache memory.
- the memory may hold instructions or data that the processor 111 has just used or recycled. If the processor 111 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 111 is reduced, thus improving the efficiency of the system.
- the memory 112 is coupled with the processor 111 for storing various software programs and/or sets of instructions.
- Memory 112 may be used to store computer-executable program code, which includes instructions.
- the processor 111 executes various functional applications and data processing of the terminal 100 by executing instructions stored in the memory 112 .
- the memory 112 may include an area for storing programs and an area for storing data.
- the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
- the storage data area can store data created during use of the terminal 100 (such as audio data, image data to be displayed, etc.) and the like.
- the memory 112 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
- the key 113 includes a power key (or called a power key/off key), a volume key, and the like.
- the volume keys specifically include a volume up (+) key and a volume down (-) key.
- the power button (or called a power button/shutdown button) is used to turn on/off/restart the terminal 100 .
- the key 113 can be a mechanical key or a touch key.
- the terminal in the embodiment of the present application is in the form of a mechanical button.
- the display screen 114 can be used to display images, videos, interfaces and the like. In the embodiment of the present application, the display screen 114 is used to display various interfaces output by the system of the terminal 100, and for details, reference may be made to related descriptions in subsequent embodiments.
- the display screen 114 includes a display panel.
- the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
- LCD liquid crystal display
- OLED organic light-emitting diode
- AMOLED active matrix organic light emitting diode
- FLED flexible light-emitting diode
- Miniled MicroLed, Micro-oLed
- quantum dot light emitting diodes quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
- FIG. 2B is another schematic structural diagram of a terminal provided in an embodiment of the present application.
- the terminal shown in FIG. 2B may be a mobile phone.
- the terminal 100 may include other components besides the processor 111 , memory 112 , key 113 , and display screen 114 .
- the other components included in the terminal 100 will be briefly introduced below in conjunction with FIG. 2B .
- the terminal 100 may further include a battery, a charging management module, and a power management module.
- a battery may be used to provide power to the terminal 100 .
- the charging management module is used to receive charging input from the charger.
- the charger may be a wireless charger or a wired charger.
- the charging management module can receive the charging input of the wired charger through the USB interface.
- the charging management module can receive wireless charging input through the wireless charging coil of the terminal 100 .
- the charging management module can also supply power to the electronic device through the power management module.
- the power management module is used for connecting the battery, the charging management module and the processor 111 .
- the power management module receives the input from the battery and/or the charging management module, and supplies power to the processor 111 , the memory 112 , the keys 113 and the display screen 114 .
- the power management module can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
- the power management module may also be disposed in the processor 111 .
- the power management module and the charging management module can also be set in the same device.
- the terminal 100 may also include components for implementing wireless communication functions.
- the terminal 100 further includes an antenna 1, an antenna 2, a mobile communication module, a wireless communication module, a modem processor, a baseband processor, and the like.
- Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
- antenna 1 and antenna 2 can be used to transmit Bluetooth signals.
- Each antenna in terminal 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
- Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
- the antenna can be used in combination with a tuning switch.
- the mobile communication module can provide wireless communication solutions including 2G/3G/4G/5G applied on the terminal 100 .
- the mobile communication module may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like.
- the mobile communication module can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.
- the mobile communication module can also amplify the signal modulated by the modem processor, convert it into electromagnetic wave and radiate it through the antenna 1 .
- at least part of the functional modules of the mobile communication module may be set in the processor 111 .
- at least part of the functional modules of the mobile communication module and at least part of the modules of the processor 111 may be set in the same device.
- a modem processor may include a modulator and a demodulator.
- the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal.
- the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing.
- the low-frequency baseband signal is passed to the application processor after being processed by the baseband processor.
- the application processor outputs sound signals through audio equipment (not limited to speakers, receivers, etc.), or displays images or videos through the display screen 114 .
- the modem processor may be a stand-alone device. In some other feasible implementation manners, the modem processor may be independent from the processor 111, and be set in the same device as the mobile communication module or other functional modules.
- the wireless communication module can provide applications on the terminal 100 including wireless local area networks (wireless local area networks, WLAN) such as Wi-Fi networks, bluetooth (blue tooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
- the wireless communication module may be one or more devices integrating at least one communication processing module.
- the wireless communication module receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 111 .
- the wireless communication module can also receive the signal to be sent from the processor 111 , frequency-modulate it, amplify it, and convert it into electromagnetic wave through the antenna 2 for radiation.
- the wireless communication processing module may include a Bluetooth (BT) communication processing module, a WLAN communication processing module, and an infrared communication processing module.
- BT Bluetooth
- One or more of the Bluetooth (BT) communication processing module and the WLAN communication processing module can monitor the signals emitted by other devices, such as detection requests, scanning signals, etc., and can send response signals, such as detection responses, scanning responses, etc. , so that other devices can discover the terminal 100, establish a wireless communication connection with other devices, and communicate with other devices through one or more wireless communication technologies in Bluetooth or WLAN.
- the Bluetooth (BT) communication processing module can provide one or more Bluetooth communication solutions including classic Bluetooth (BR/EDR) or Bluetooth low energy (Bluetooth low energy, BLE).
- the WLAN communication processing module can include one or more WLAN communication solutions in Wi-Fi direct, Wi-Fi LAN or Wi-Fi softAP.
- the infrared communication processing module can process the infrared signal received by the infrared receiver and the location where the infrared signal is received.
- the antenna 1 of the terminal 100 is coupled to the mobile communication module, and the antenna 2 is coupled to the wireless communication module, so that the terminal 100 can communicate with the network and other devices through wireless communication technology.
- the terminal 100 may further include components such as an audio module, a speaker, a receiver, a microphone, an earphone jack, and an application processor, for implementing audio functions. Such as music playback, recording, etc.
- the audio module is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. Loudspeakers, also called “horns”, are used to convert audio electrical signals into sound signals.
- the receiver also known as the “earpiece”, is used to convert audio electrical signals into sound signals.
- Microphones also known as “microphones” and “microphones”, are used to convert sound signals into electrical signals.
- the headphone jack is used to connect wired headphones.
- the earphone jack can be a USB interface, or a 3.5mm open mobile terminal platform (open mobile terminal platform, OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
- the terminal 100 may further include an indicator, a subscriber identification module (subscriber identification module, SIM) card interface, and a sensor module.
- the indicator can be an indicator light, which can be used to indicate the charging state, the change of the battery capacity, and can also be used to indicate messages, missed calls, notifications, and the like.
- the SIM card interface is used to connect a SIM card.
- the SIM card can be connected to and separated from the terminal 100 by inserting it into the SIM card interface or pulling it out from the SIM card interface.
- the terminal 100 adopts an eSIM, that is, an embedded SIM card.
- the eSIM card can be embedded in the terminal 100 and cannot be separated from the terminal 100 .
- the sensor module includes various sensors for realizing sensing functions.
- the software system of the terminal 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
- an Android system with a layered architecture is taken as an example to illustrate the software structure of the terminal 100 .
- FIG. 3 is a block diagram of a software structure of a terminal provided by an embodiment of the present application.
- the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
- the Android system can be divided into four layers, which are respectively the application program layer, the application program framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer from top to bottom.
- the application layer can consist of a series of application packages.
- the application program package may include Bluetooth, device management application (application with device management function), WLAN, short message, gallery, calendar, call and other application programs (applications, APPs).
- the application framework layer provides application programming interfaces and programming frameworks for applications in the application layer.
- the application framework layer includes some predefined functions.
- the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
- a window manager is used to manage window programs.
- the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
- Content providers are used to store and retrieve data and make it accessible to applications.
- the aforementioned data can include videos, images, audio, calls made and received, browsing history and bookmarks, phonebook, etc.
- the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on.
- the view system can be used to build applications.
- a display interface can consist of one or more views.
- a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
- the phone manager is used to provide a communication function of the terminal 100 .
- the management of call status including connected, hung up, etc.).
- the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
- the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction.
- the notification manager is used to notify the download completion, message reminder, etc.
- the notification manager can also be a notification that appears on the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog interface. For example, prompting text information in the status bar, issuing a prompt sound, vibrating the electronic device, and flashing the indicator light, etc.
- the Android Runtime includes core library and virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
- the core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
- the application layer and the application framework layer run in virtual machines.
- the virtual machine executes the java files of the application program layer and the application program framework layer as binary files.
- the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
- a system library can include multiple function modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
- the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
- the media library supports playback and recording of various commonly used audio and video formats, as well as still image files, etc.
- the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing, etc.
- 2D graphics engine is a drawing engine for 2D drawing.
- the kernel layer is the layer between hardware and software.
- the kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
- the embodiment of the present application provides a restart method during the recovery mode upgrade process.
- the restart caused by the user's mistaken touch during the recovery mode upgrade process is reduced, thereby reducing
- the possibility that the mobile phone cannot be used can also solve the problem of not being able to directly exit the recovery mode in abnormal scenarios.
- the recovery partition and the misc partition of the Android system involved in the embodiment of the present application are briefly described.
- the recovery partition can be understood as an alternative boot partition, allowing the device to boot to a recovery console to perform preset recovery and maintenance operations.
- the misc partition contains system settings in the form of ON/OFF switches. These settings can include CID (Carrier or Region ID), USB configuration and some hardware settings, etc.
- CID Carrier or Region ID
- USB configuration can include USB configuration and some hardware settings, etc.
- the misc partition is an important partition. If it is damaged or lost, some device functions will not work properly.
- FIG. 4 is a schematic flowchart of a restart method during an upgrade in recovery mode provided by an embodiment of the present application.
- Fig. 4 shows the internal data processing process of the terminal.
- the restart method in the recovery mode upgrade process provided by the embodiment of the present application includes but is not limited to the following steps:
- the terminal sets the trigger mode of the forced restart of the terminal to long press the power button and the volume button at the same time.
- the terminal in this embodiment of the present application may be a mobile phone.
- the user can enter the recovery mode through one or more operations on the terminal.
- the terminal can detect whether the system version has been updated under the main system, and if there is an update, the terminal can prompt in the form of a pop-up window or a notification bar. If the user chooses to update the system version, the terminal searches for the system version update package under the main system and downloads it. After the terminal downloads the system version update package required for the upgrade, the restart control is displayed on the system version update interface. If the user clicks the restart control, the terminal will respond to the user’s click operation and call the restart command, and add the restart parameter recovery.
- This restart command will write the flag bit boot-recovery in the misc partition, and then the terminal will restart.
- the terminal enters recovery model.
- the terminal downloads the upgrade package under the main system, and when it needs to be upgraded after downloading the upgrade package, call the restart command, add the restart parameter recovery, write the flag boot-recovery in the misc partition, and then restart to enter the recovery mode Do a HOTA upgrade.
- physical keys such as volume keys and power (power) keys
- FIG. 5 is a schematic diagram of the recovery main interface and the erecovery main interface provided by the embodiment of the present application.
- the terminal needs to use the volume keys to move the cursor on the recovery main interface or the erecovery main interface, and use the power key to confirm.
- the power key and the volume key are located on the same side as shown in FIG. 5 . In actual implementation, the power key and the volume key may be located on different sides of the terminal, which is not limited in this embodiment of the present application.
- the terminal in the embodiment of the present application will detect whether there is a flag, such as boot-recovery, in the misc partition during the startup process (such as the lk stage). If the flag bit boot-recovery exists in the misc partition, the terminal determines to enter the recovery mode. This is because the misc partition is empty during normal startup, and the upgrade information of the misc partition will be written only when it enters the recovery mode, mainly into the flag bit boot-recovery. When it is detected that the terminal enters the recovery mode, the terminal can set the trigger mode of the forced restart of the terminal to press and hold the power button and the volume button at the same time.
- a flag such as boot-recovery
- the startup process of the terminal includes: first power on, and then the CPU starts a preloader (preloader), the preloader is used to start a small kernel/small operating system (little kernel, lk for short), lk is mainly responsible for mode selection, according to Select the mode to load the corresponding content, and then start the corresponding service through the initialization function (init) of the virtual memory disk (ramdisk).
- preloader when the terminal starts to the lk stage, it will initialize the button function according to the configuration file.
- MTK multi-tone keying
- the terminal boots to the lk stage call the long-press restart function setting (such as long_press_reboot_function_setting) function to set the forced restart method.
- the terminal calls the power management integrated circuit (Power Management IC, pmic) to set the register value to 0x00 (eg: PMIC_RG_PWRKEY_KEY_MODE, 0x00), so as to set the power button as a forced restart button, that is to say, set the trigger mode of forced restart to long press the power button.
- Power Management IC Power Management integrated circuit
- the terminal calls pmic to set the register value to 0x01 (such as: PMIC_RG_PWRKEY_KEY_MODE, 0x01), thereby setting
- the forced restart key is set as a combination key, that is to say, the trigger mode of the forced restart is set to press and hold the combination key at the same time. It should also be understood that the terminal will initialize key functions according to the configuration file during each startup process.
- the terminal in the embodiment of the present application sets the forced restart trigger mode of the terminal to long press the power button and the volume button at the same time, including: after the terminal recognizes that it has entered the recovery mode, it calls pmic again to set the register value to 0x01, so that the combined key (For example, the power button and the volume up button, or the power button and the volume down button) are set as the forced restart button, that is to say, the forced restart trigger mode is set to long press the power button and the volume button at the same time.
- the forced restart key is the power key.
- the terminal when the terminal starts to the lk stage, it will call pmic to set the register value to 0x00; when the terminal (in the lk stage) determines to enter the recovery mode, it will call pmic again to set the register value to 0x01 (or set the register value to 0x01). value changed from 0x00 to 0x01).
- the terminal displays a first prompt interface.
- the first prompt interface includes text prompts for prompting the risk of forced restart and the correct trigger method for forced restart.
- the terminal can monitor the physical keys (such as power key and volume key) of the terminal through /adopt/start thread. If the terminal detects that the power button is long pressed after entering the recovery mode, the terminal detects whether the volume button is long pressed at the same time (here refers to the volume up key or the volume down key); if the terminal detects that the volume key is not pressed at the same time, the display interface is called Display the first prompt interface.
- the input parameters of the display interface include displayed content (such as text, image, etc.) and displayed position coordinates.
- the first prompt interface includes a text prompt, which is used to prompt the risk of forced restart and the correct triggering method of forced restart.
- the first prompt interface can be a brand new interface, or a corresponding text prompt can be added to the original upgrade interface.
- the text prompt on the first prompt interface may be "updating, please do not press and hold the power button. During the upgrade process, a forced restart will cause abnormality of the device. If you need to force shutdown, please press and hold the power button and volume up at the same time. /down key".
- the terminal if the terminal detects a long press of the power button after entering the recovery mode and the long press time exceeds the first time threshold, the terminal calls the display interface to display the first prompt interface.
- the first time threshold is 10 seconds (s).
- the display interface may not be invoked to display the first prompt interface, thereby saving power consumption.
- FIG. 6A is a schematic diagram of a first prompt interface provided by an embodiment of the present application.
- the first prompting interface 601 is a brand-new interface, and its text prompting can be positioned at the middle position of the interface, and adopts methods such as thickening, the font of different colors to highlight;
- a The return control 602 is used to return to the original upgrade interface (that is, the original HOTA upgrade interface). Referring to FIG. 6B , FIG.
- FIG. 6B is another schematic diagram of the first prompt interface provided by the embodiment of the present application.
- the terminal enters the recovery mode
- the user presses and holds the power button for more than 10 seconds
- the terminal invokes the display interface to display the first prompt interface 601.
- the first prompt interface 601 is to add corresponding text prompts on the original HOTA upgrade interface.
- the text prompts can be located at the top of the original HOTA upgrade interface, and can also be highlighted in bold or different-colored fonts.
- the terminal displays a second prompt interface, which includes a text prompt, and uses To warn of the risk of a forced restart.
- the terminal after the terminal enters the recovery mode, it monitors the physical buttons (such as the power button and the volume button) of the terminal through /adopting/starting the thread, so if the terminal detects that the power button and the volume button are pressed and held at the same time after entering the recovery mode /down key, and the long-pressed time does not exceed the second time threshold, the display interface is called to display the second prompt interface.
- the input parameters of the display interface include displayed content (such as text, image, etc.) and displayed position coordinates.
- the second prompt interface includes a text prompt for prompting the risk of forced restart.
- the second prompt interface can be a brand new interface, or a corresponding text prompt can be added to the original upgrade interface.
- the second time threshold may be 10s, 15s and so on. It should be understood that the second prompt interface is similar to the above-mentioned first prompt interface, except that the input parameters of the display interfaces are different. Exemplarily, the text prompt on the second prompt interface may be "updating, long pressing the power key and the volume up/down key at the same time will force shutdown, causing the device to be abnormal".
- a timer can be started.
- the terminal may call the display interface to display the second prompt interface. This can reduce the complexity and power consumption of the terminal.
- the third time threshold is smaller than the second time threshold, for example, the third time threshold is 3 seconds, and the second time threshold is 10 seconds.
- FIG. 7 is a schematic diagram of an interface change provided by an embodiment of the present application by simultaneously pressing and holding a power key and a volume key. As shown in FIG.
- the second prompt interface 701 can be a brand new interface, and its text prompt can be located in the middle of the interface, and it can be highlighted by means of bold and different color fonts; optionally, the second prompt interface 701 can also A return control 702 is set for returning to the original upgrade interface (that is, the original HOTA upgrade interface).
- the second prompt interface 701 can also be to add corresponding text prompts on the original HOTA upgrade interface. highlight. If the user continues to press and hold the power button and the volume up button at the same time until the long-press time exceeds 10s, the terminal will be forced to shut down.
- the terminal can output a confirmation message to prompt the user whether to shutdown.
- the terminal When the user selects "Yes”, the terminal will be forced to shut down, and the terminal will exit the recovery mode; when the user selects "No”, the terminal will continue to upgrade, and the terminal will not exit the recovery mode.
- the forced restart trigger mode of the terminal will be set to long press the power button, that is, the terminal will re-read the configuration file for button configuration. That is to say, after the terminal enters the recovery mode, it will change the trigger mode of the forced restart of the terminal from long pressing the power button to long pressing the power button and the volume button at the same time;
- the terminal's original forced restart trigger method is to press and hold the power button to force restart.
- the corresponding relationship between the forced restart function and the physical buttons is changed, and the corresponding content is displayed according to the combination of different detected buttons and the length of time pressed, so as to prompt the user to enter the recovery mode.
- the risks/hazards of forced restart during the mode upgrade process, and the correct forced restart method can not only reduce the restart caused by the user's mistaken touch during the recovery mode upgrade process, thereby reducing the possibility of the phone being unusable, but also solve the problem that the phone cannot be used in abnormal scenarios.
- the problem of exiting recovery mode directly.
- FIG. 8 is another schematic flow chart of a restart method during an upgrade in recovery mode provided by an embodiment of the present application.
- "Y” in FIG. 8 means “yes”
- “N” means “no”.
- the restart method in the recovery mode upgrade process provided by the embodiment of the present application includes but is not limited to the following steps:
- the terminal can check whether the system version is updated under the main system, and if there is an update, it can search for a system version update package (such as an upgrade package or a system package) under the main system and download it. After the download is completed, if a user's preset operation on the terminal (such as a restart operation) is detected, step S802 is performed.
- a system version update package such as an upgrade package or a system package
- This restart command will write the flag bit boot-recovery in the misc partition, and then the terminal will restart under the main system.
- the terminal judges whether to enter the recovery mode during the restart process (such as the lk stage of the restart, the lk stage will detect whether it needs to restart to the main system or the recovery mode), and the judgment method can refer to the corresponding description in the step S1 of the aforementioned Figure 4, That is to detect whether there is a flag bit boot-recovery in the misc partition, if it exists, it means that the terminal enters the recovery mode. If it is determined that the recovery mode is entered, step S804 is performed.
- the terminal configures the forced shutdown button to press and hold the power button and the volume up button at the same time for a preset time (such as 10s or 15s, etc.).
- a preset time such as 10s or 15s, etc.
- the terminal monitors the physical buttons of the terminal through threads to determine whether the power button is pressed for a long time, and if so, executes step S807. If not, it will automatically restart after the upgrade is completed. During the restart process, the forced shutdown button will be configured as the original long press power button.
- the terminal determines whether the volume up key is long pressed at the same time, and if yes, executes step S810; if not, executes step S808.
- the terminal judges whether the time of pressing and holding the power button exceeds the preset time (such as 10s or 15s, etc.), and if so, executes step S809;
- the shutdown button is configured as the original long press power button.
- the terminal outputs first prompt information, which is used to prompt the risk of forced restart and the correct way of forced shutdown.
- the first prompt message is "Upgrading, please do not press the power button for a long time. During the upgrade process, a forced restart will cause abnormalities in the device. If you need to force shutdown, please press and hold the power button and the volume up button at the same time.”
- step S806-step S809 reference may be made to the implementation manner of the aforementioned step S2 in FIG. 4 , which will not be repeated here.
- the terminal determines whether the time of simultaneously pressing and holding the power button and the volume up button exceeds a preset time, if yes, execute step S812, and if not, execute step S811.
- the terminal outputs a second prompt message, which is used to prompt the risk of forced restart.
- the second prompt message is "upgrading, long pressing the power button and the volume up button at the same time will force shutdown, causing the device to be abnormal".
- step S811 reference may be made to the implementation manner of step S3 in FIG. 4 , which will not be repeated here.
- the terminal is forced to shut down.
- step S812 reference may be made to the implementation manner of step S4 in FIG. 4 , which will not be repeated here.
- all or part of them may be implemented by software, hardware, firmware or any combination thereof.
- software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
- the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the present application will be generated in whole or in part.
- the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
- the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server, or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, DSL) or wireless (eg, infrared, wireless, microwave, etc.) means.
- the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
- the available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a Solid State Disk).
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Telephone Function (AREA)
- Stored Programmes (AREA)
Abstract
A method for performing restarting during an upgrade process of a recovery mode, and a terminal. The method comprises: searching in a main system for a system version update package, and downloading same; after downloading is completed, detecting whether a user performs a preset operation; if it is detected that the user performs the preset operation, a terminal calling a restart command in the main system, and performing restarting by adding a restart parameter recovery; and when the restart of the terminal reaches an lk stage, detecting whether the terminal enters a recovery mode; and if it is detected that the terminal enters the recovery mode during the restart process, the terminal configuring a forced shutdown button to be simultaneous long-press of a power button and a volume button for a preset time. Restarts caused by mistaken touches of a user during an upgrade process of a recovery mode can be reduced, thereby reducing the probability of being unable to use a mobile phone.
Description
本申请要求于2021年07月23日提交中国专利局、申请号为202110836801.1、申请名称为“一种recovery模式升级过程中的重启方法及终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110836801.1 and the application title "A restart method and terminal during recovery mode upgrade" submitted to the China Patent Office on July 23, 2021, the entire content of which is by reference incorporated in this application.
本申请涉及终端技术领域,尤其涉及一种recovery模式升级过程中的重启方法及终端。The present application relates to the technical field of terminals, in particular to a restart method and a terminal during recovery mode upgrade.
Recovery模式(恢复模式)是安卓(Android)手机备份功能,指的是一种可以对安卓手机内部的数据或系统进行修改的模式(类似于windows PE或DOS)。在这个模式下可以对已有的系统进行备份或升级,也可以在此恢复出厂设置。Recovery mode (recovery mode) is an Android (Android) phone backup function, which refers to a mode that can modify the internal data or system of an Android phone (similar to windows PE or DOS). In this mode, the existing system can be backed up or upgraded, and the factory settings can also be restored here.
因为Recovery模式升级过程中,需要使用电源(power)键来进行选择的确认,因此电源键是没有屏蔽的。当检测到长按电源键但长按时间还没有达到重启/关机的时间要求之前,会进行文字提示。但当检测到长按电源键且长按时间达到重启/关机的时间要求时,将导致手机关机。因此,在Recovery模式升级过程中可能会存在误触导致手机关机,即误长按电源键导致的手机关机。另外,因为在升级过程中会将升级包中的镜像对应分区的内容进行覆盖,部分分区还可能会先进行擦除操作,然后再进行镜像的烧写。如果手机在Recovery模式升级过程中强制重启,则由于手机没有升级完成,下次启动还会重新进入升级,但是由于上一次升级被中断,可能导致某个关键分区损坏,从而造成手机无法启动到主系统和recovery模式,导致手机无法使用。Because during the upgrade process of Recovery mode, the power button needs to be used to confirm the selection, so the power button is not shielded. When it is detected that the power button has been pressed for a long time but the long press time has not reached the restart/shutdown time requirement, a text prompt will be given. However, when it is detected that the power button is pressed for a long time and the long press time reaches the restart/shutdown time requirement, it will cause the mobile phone to shut down. Therefore, during the upgrade process of Recovery mode, there may be accidental touches that cause the mobile phone to shut down, that is, the mobile phone shuts down caused by mistakenly pressing the power button for a long time. In addition, because the content of the partition corresponding to the image in the upgrade package will be overwritten during the upgrade process, some partitions may be erased first, and then the image will be burned. If the mobile phone is forced to restart during the recovery mode upgrade process, because the mobile phone has not been upgraded, it will re-enter the upgrade next time, but because the previous upgrade was interrupted, a key partition may be damaged, resulting in the failure of the phone to boot to the main The system and recovery mode make the phone unusable.
发明内容Contents of the invention
本申请实施例提供一种recovery模式升级过程中的重启方法及终端,可以减少recovery模式升级过程中用户误触导致的重启,从而可以减少手机无法使用的概率。The embodiment of the present application provides a method and terminal for restarting during the upgrading process of the recovery mode, which can reduce the restarting caused by the user's mistaken touch during the upgrading process of the recovery mode, thereby reducing the probability that the mobile phone cannot be used.
下面从不同的方面介绍本申请,应理解的是,下面的不同方面的实施方式和有益效果可以互相参考。The following introduces the present application from different aspects, and it should be understood that the implementation manners and beneficial effects of the following different aspects can refer to each other.
第一方面,本申请提供一种recovery模式升级过程中的重启方法,该方法包括:终端在主系统下搜索系统版本更新包并下载,在下载完成后,检测用户是否进行预设操作(如点击重启控件);若检测到该用户进行预设操作,则终端在主系统下调用重启命令并加上重启参数recovery进行重启;当终端重启到lk(小内核/小操作系统(little kernel,简称lk))阶段时,检测是否进入recovery模式;若检测到终端在重启过程中进入recovery模式,则终端将强制关机按键配置为同时长按电源键和音量键预设时间。其中,这里的音量键既可以是音量上键,也可以是音量下键。这里的预设时间可以为10s或15s等。In the first aspect, the present application provides a restart method in the recovery mode upgrade process, the method includes: the terminal searches for the system version update package under the main system and downloads it, and after the download is completed, detects whether the user performs a preset operation (such as clicking restart control); if it is detected that the user performs a preset operation, the terminal will call the restart command under the main system and add the restart parameter recovery to restart; when the terminal restarts to lk (little kernel/small operating system (little kernel, lk for short) )) phase, detect whether to enter the recovery mode; if it is detected that the terminal enters the recovery mode during the restart process, the terminal will configure the forced shutdown button to press and hold the power button and the volume button at the same time for a preset time. Wherein, the volume key here can be either a volume up key or a volume down key. The preset time here can be 10s or 15s, etc.
可见,本方案通过在检测到进入recovery模式后,将强制重启功能/强制关机按键配置为长按电源键和音量键一段时间,不仅可以减少recovery模式升级过程中用户误触导致的重启(这是因为用户同时误触组合键的概率低),从而减少手机无法使用的概率,还可以解决在异常场景(如死机,手机无法正常操作等)中无法直接退出recovery模式的问题(这是因为本方案在recovery模式下仍然保留强制重启/关机功能)。It can be seen that by configuring the forced restart function/forced shutdown button as a long press of the power button and volume button for a period of time after the detection of entering the recovery mode, this solution can not only reduce the restart caused by the user's accidental touch during the recovery mode upgrade process (this is Because the probability of the user accidentally touching the combination key at the same time is low), thereby reducing the probability of the mobile phone being unusable, it can also solve the problem of not being able to directly exit the recovery mode in abnormal scenarios (such as a crash, the mobile phone cannot operate normally, etc.) (this is because this solution The forced restart/shutdown function is still retained in recovery mode).
结合第一方面,在一种可能的实现方式中,终端将强制关机按键配置为同时长按电源键和音量键预设时间,包括:终端调用电源管理集成电路(Power Management IC,pmic)将寄存器值设置为0x01,从而将强制关机按键设置为组合键(比如电源键和音量上键,或电源键和音量下键,或音量上键和音量下键),也就是说将强制重启触发方式设置为同时长按组合键。In combination with the first aspect, in a possible implementation, the terminal configures the forced shutdown button to simultaneously press and hold the power button and the volume button for a preset time, including: the terminal calls a power management integrated circuit (Power Management IC, pmic) to set the register The value is set to 0x01, so that the forced shutdown key is set as a combination key (such as the power key and the volume up key, or the power key and the volume down key, or the volume up key and the volume down key), that is to say, the forced restart trigger mode is set Press and hold the key combination at the same time.
可选的,终端在进入recovery模式之前,强制关机按键是电源键。也就是说,当终端启动到lk阶段时,会调用pmic将寄存器值设置为0x00;当终端(在lk阶段)确定进入recovery模式后,再次调用pmic将寄存器值设置为0x01(或者说将寄存器的值从0x00更改为0x01)。Optionally, before the terminal enters the recovery mode, the forced shutdown button is the power button. That is to say, when the terminal starts to the lk stage, it will call pmic to set the register value to 0x00; when the terminal (in the lk stage) determines to enter the recovery mode, it will call pmic again to set the register value to 0x01 (or set the register value to 0x01). value changed from 0x00 to 0x01).
可见,本方案通过调用pmic更改寄存器值,来更改强制重启功能与物理按键的对应关系,有利于减少误触和退出recovery模式后改回原有配置。It can be seen that this solution changes the corresponding relationship between the forced restart function and the physical button by calling the pmic to change the register value, which is conducive to reducing false touches and changing back to the original configuration after exiting the recovery mode.
结合第一方面,在一种可能的实现方式中,终端在重启过程中检测是否进入recovery模式,包括:终端在重启过程中检测misc分区中是否存在标志位boot-recovery;若终端检测到misc分区中存在标志位boot-recovery,则终端确定在重启过程中进入recovery模式。若misc分区中不存在标志位boot-recovery,则说明未进入recovery模式。In combination with the first aspect, in a possible implementation, the terminal detects whether to enter the recovery mode during the restart process, including: the terminal detects whether there is a flag bit boot-recovery in the misc partition during the restart process; if the terminal detects the misc partition If there is a flag bit boot-recovery in the terminal, the terminal determines to enter the recovery mode during the restart process. If the flag bit boot-recovery does not exist in the misc partition, it means that the recovery mode has not been entered.
因为正常启动时misc分区为空,只有在进入recovery模式时才会进行misc分区升级信息的写入,主要写入标志位boot-recovery。所以,本方案通过检测misc分区中是否存在标志位boot-recovery,可以准确判断出终端是否进入recovery模式。Because the misc partition is empty during normal startup, the upgrade information of the misc partition will be written only when entering the recovery mode, mainly into the flag bit boot-recovery. Therefore, this solution can accurately determine whether the terminal enters the recovery mode by detecting whether the flag bit boot-recovery exists in the misc partition.
结合第一方面,在一种可能的实现方式中,该方法还包括:终端在进入recovery模式后,通过线程监测终端的物理按键,该物理按键包括电源键、音量上键、以及音量下键中的一种或多种;当监测到长按电源键时,终端监测是否同时长按音量键;当监测到长按电源键且未同时长按音量键时,终端监测长按电源键的时间是否超过上述预设时间;若长按电源键的时间超过该预设时间,则终端输出第一提示信息,该第一提示信息用于提示强制重启的风险和正确的强制关机方式。其中,终端输出第一提示信息的方式可以是语音、文字、响铃、震动等方式。With reference to the first aspect, in a possible implementation manner, the method further includes: after the terminal enters the recovery mode, monitor the physical buttons of the terminal through a thread, where the physical buttons include a power button, a volume up button, and a volume down button one or more; when it is detected that the power button is long pressed, the terminal monitors whether the volume button is long pressed at the same time; when it is detected that the power button is long pressed and the volume button is not If the preset time is exceeded; if the power button is pressed for longer than the preset time, the terminal will output a first prompt message, which is used to prompt the risk of forced restart and the correct forced shutdown method. Wherein, the way for the terminal to output the first prompt information may be voice, text, ringing, vibration and other ways.
可选的,终端输出第一提示信息,包括:终端调用显示接口将第一提示信息显示在终端屏幕(比如原有的升级界面)的预设位置上,该显示接口的输入参数包括第一提示信息和预设位置。其中,该预设位置是显示的位置坐标。Optionally, the terminal outputs the first prompt information, including: the terminal calls the display interface to display the first prompt information at a preset position on the terminal screen (such as the original upgrade interface), and the input parameters of the display interface include the first prompt information and preset positions. Wherein, the preset position is the displayed position coordinates.
可见,本方案在长按电源键超过预设时间后,输出相应的提示信息,提示强制重启的风险和正确的强制关机方式,一方面有利于在误触场景下的及时发现以及提示风险,另一方面有利于在异常场景(如死机,手机无法正常操作等)下用户进行强制关机。It can be seen that after long pressing the power button for more than the preset time, this solution will output the corresponding prompt information, prompting the risk of forced restart and the correct way of forced shutdown. On the one hand, it is beneficial for users to forcibly shut down in abnormal scenarios (such as crashes, mobile phones cannot operate normally, etc.).
结合第一方面,在一种可能的实现方式中,该方法还包括:若监测到长按电源键且同时长按音量键,则终端监测同时长按的时间是否超过上述预设时间;若同时长按的时间未超过该预设时间,则终端输出第二提示信息,该第二指示信息用于提示强制重启的风险。其中,终端输出第二提示信息的方式可以是语音、文字、响铃、震动等方式。With reference to the first aspect, in a possible implementation manner, the method further includes: if it is detected that a long press of the power button and a long press of the volume key are detected at the same time, the terminal monitors whether the time of the simultaneous long press exceeds the above preset time; If the time of the long press does not exceed the preset time, the terminal outputs second prompt information, and the second indication information is used to prompt the risk of forced restart. Wherein, the manner in which the terminal outputs the second prompt information may be voice, text, ringing, vibration, and the like.
可选的,终端输出第二提示信息,包括:终端调用显示接口将第二提示信息显示在终端屏幕(比如原有的升级界面)的预设位置上,该显示接口的输入参数包括第二提示信息和预设位置。其中,该预设位置是显示的位置坐标。Optionally, the terminal outputs the second prompt information, including: the terminal calls the display interface to display the second prompt information at a preset position on the terminal screen (such as the original upgrade interface), and the input parameters of the display interface include the second prompt information and preset positions. Wherein, the preset position is the displayed position coordinates.
可见,本方案在同时长按电源键和音量键,且同时长按的时间未超过预设时间时,输 出相应的提示信息,提示强制重启的风险,以再次告知强制重启的危害,减少用户在不知情情况下做出错误判断。It can be seen that in this solution, when the power button and the volume button are pressed and held at the same time, and the time of pressing and holding the button at the same time does not exceed the preset time, a corresponding prompt message is output to prompt the risk of forced restart, so as to inform the harm of forced restart again and reduce the user's time spent on the computer. Misjudgment without knowing it.
结合第一方面,在一种可能的实现方式中,该方法还包括:终端退出recovery模式后,终端在重启的过程中调用电源管理集成电路将寄存器值设置为0x00。With reference to the first aspect, in a possible implementation manner, the method further includes: after the terminal exits the recovery mode, the terminal calls the power management integrated circuit to set the register value to 0x00 during the restart process.
可见,本方案在退出recovery模式后,将强制关机按键恢复回原有的长按电源键,便于支持终端在正常模式下的功能和用户操作。It can be seen that in this solution, after exiting the recovery mode, the forced shutdown button is restored to the original long-pressed power button, so as to support the functions and user operations of the terminal in the normal mode.
第二方面,本申请实施例提供一种终端,该终端包括用于执行上述第一方面和/或第一方面的任意一种可能的实现方式所提供的recovery模式升级过程中的重启方法的单元和/或模块,因此也能实现第一方面提供的recovery模式升级过程中的重启方法所具备的有益效果(或优点)。In the second aspect, the embodiment of the present application provides a terminal, and the terminal includes a unit for performing the restart method in the recovery mode upgrade process provided by the above-mentioned first aspect and/or any possible implementation manner of the first aspect and/or modules, so the beneficial effects (or advantages) of the restart method in the recovery mode upgrade process provided by the first aspect can also be realized.
第三方面,本申请提供一种终端,包括处理器和存储器,其中,该存储器用于存储计算机程序,该计算机程序包括程序指令,当该处理器运行该程序指令时,使该终端执行上述第一方面提供的recovery模式升级过程中的重启方法。In a third aspect, the present application provides a terminal, including a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and when the processor runs the program instructions, the terminal is made to execute the above-mentioned On the one hand, it provides a restart method during the recovery mode upgrade process.
第四方面,本申请的实施例提供一种计算机可读存储介质,用于储存为第一电子设备所用的计算机程序指令,其包含用于执行上述第一方面所涉及的程序。In a fourth aspect, the embodiments of the present application provide a computer-readable storage medium for storing computer program instructions used by the first electronic device, including the program for executing the above-mentioned first aspect.
第五方面,本申请提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面描述的recovery模式升级过程中的重启方法。In a fifth aspect, the present application provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the method for restarting in the recovery mode upgrade process described in the first aspect above.
实施本申请实施例,可以减少recovery模式升级过程中用户误触导致的重启,从而可以减少手机无法使用的概率。Implementing the embodiment of the present application can reduce the restart caused by the user's mistaken touch during the recovery mode upgrade process, thereby reducing the probability that the mobile phone cannot be used.
为了更清楚地说明本申请实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings that need to be used in the description of the embodiments.
图1是Recovery模式升级过程中长按电源键的界面变化示意图;Figure 1 is a schematic diagram of the interface changes when pressing and holding the power button during the recovery mode upgrade process;
图2A是本申请实施例提供的终端的一种结构示意图;FIG. 2A is a schematic structural diagram of a terminal provided in an embodiment of the present application;
图2B是本申请实施例提供的终端的另一种结构示意图;FIG. 2B is another schematic structural diagram of a terminal provided by an embodiment of the present application;
图3是本申请实施例提供的终端的软件结构框图;FIG. 3 is a block diagram of a software structure of a terminal provided in an embodiment of the present application;
图4是本申请实施例提供的recovery模式升级过程中的重启方法的流程示意图;FIG. 4 is a schematic flowchart of a restart method in the recovery mode upgrade process provided by the embodiment of the present application;
图5是本申请实施例提供的recovery主界面和erecovery主界面的示意图;Fig. 5 is a schematic diagram of the recovery main interface and the erecovery main interface provided by the embodiment of the present application;
图6A是本申请实施例提供的第一提示界面的一示意图;Fig. 6A is a schematic diagram of the first prompt interface provided by the embodiment of the present application;
图6B是本申请实施例提供的第一提示界面的另一示意图;Fig. 6B is another schematic diagram of the first prompt interface provided by the embodiment of the present application;
图7是本申请实施例提供的同时长按电源键和音量键的界面变化示意图;Fig. 7 is a schematic diagram of the interface change provided by the embodiment of the present application by pressing and holding the power button and the volume button at the same time;
图8是本申请实施例提供的recovery模式升级过程中的重启方法的另一种流程示意图。FIG. 8 is another schematic flowchart of a restart method during an upgrade in recovery mode provided by an embodiment of the present application.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示: 单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c;a和b;a和c;b和c;或a和b和c。其中a,b,c可以是单个,也可以是多个。In the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. "And/or" describes the association relationship of associated objects, indicating that there can be three types of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist at the same time, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the contextual objects are an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one item (unit) of a, b, or c may represent: a, b, c; a and b; a and c; b and c; or a and b and c. Where a, b, c can be single or multiple.
在本申请的描述中,“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。In the description of the present application, words such as "first" and "second" do not limit the number and order of execution, and words such as "first" and "second" do not necessarily limit the difference.
应理解,在本申请中,“当…时”、“若”以及“如果”均指在某种客观情况下装置会做出相应的处理,并非是限定时间,且也不要求装置实现时一定要有判断的动作,也不意味着存在其它限定。It should be understood that in this application, "when", "if" and "if" all mean that the device will make corresponding processing under certain objective circumstances, it is not a time limit, and it is not required that the device must The act of judgment does not mean that there are other restrictions.
本申请中的“同时”可以理解为在相同的时间点,也可以理解为在一段时间段内,还可以理解为在同一个周期内,具体可以结合上下文进行理解。"Simultaneously" in this application can be understood as at the same time point, within a certain period of time, or within the same period, which can be specifically understood in conjunction with the context.
本申请中对于使用单数表示的元素旨在用于表示“一个或多个”,而并非表示“一个且仅一个”,除非有特别说明。In this application, an element expressed in the singular is intended to mean "one or more" rather than "one and only one", unless otherwise specified.
应理解,在本申请各实施例中,“与A对应的B”表示B与A相关联,根据A可以确定B。但还应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。It should be understood that in each embodiment of the present application, "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B may also be determined according to A and/or other information.
目前,Recovery模式升级过程中,如果监测到长按电源键但长按时间还没有达到重启/关机的时间要求(10s)之前,会进行文字提示。参见图1,图1是Recovery模式升级过程中长按电源键的界面变化示意图。如图1所示,用户在Recovery模式升级过程中长按电源键,且长按时间未超过10s,则终端在升级界面上输出文字提示,如“警告:检测到电源键长按,请立即松开电源键,避免设备异常”。当用户继续长按电源,直到长按时间超过10s,则终端进行强制关机。因此,在Recovery模式升级过程中,如果用户误触电源键,即误长按电源键一段时间,将导致手机关机。而Recovery模式升级过程中会进行分区内容的覆盖、擦除等操作,如果没有升级完成就强制关机,则可能会导致某个关键分区损坏,从而造成手机无法启动到主系统和recovery模式,导致手机无法使用。At present, during the recovery mode upgrade process, if it is detected that the power button is long pressed but the long press time has not reached the restart/shutdown time requirement (10s), a text prompt will be given. See Figure 1, Figure 1 is a schematic diagram of the interface change when pressing and holding the power button during the recovery mode upgrade process. As shown in Figure 1, when the user presses and holds the power button during the upgrade in Recovery mode, and the long press does not exceed 10s, the terminal will output text prompts on the upgrade interface, such as "Warning: A long press of the power button has been detected, please release it immediately." Turn on the power button to avoid device abnormalities." When the user continues to press and hold the power until the long press time exceeds 10s, the terminal will be forced to shut down. Therefore, during the recovery mode upgrade process, if the user touches the power button by mistake, that is, presses and holds the power button for a period of time by mistake, the phone will shut down. In the recovery mode upgrade process, the partition content will be overwritten and erased. If the upgrade is not completed and the phone is forced to shut down, it may cause damage to a key partition, which will cause the phone to fail to boot into the main system and recovery mode, causing the phone to fail. Not available.
因此,本申请实施例提供一种recovery模式升级过程中的重启方法,终端在检测到进入recovery模式后,将强制重启功能配置为长按电源键和音量键一段时间,不仅可以减少recovery模式升级过程中用户误触导致的重启,从而减少手机无法使用的概率,还可以解决在异常场景(如死机,手机无法正常操作等)中无法直接退出recovery模式的问题。Therefore, the embodiment of the present application provides a restart method during the recovery mode upgrade process. After the terminal detects that it has entered the recovery mode, the forced restart function is configured as long pressing the power button and the volume button for a period of time, which can not only reduce the recovery mode upgrade process It can reduce the probability of the mobile phone being unusable due to the restart caused by the user's mistaken touch, and can also solve the problem of not being able to directly exit the recovery mode in abnormal scenarios (such as crashes, mobile phones not operating normally, etc.).
为便于理解,下面对本申请实施例提供的终端的结构进行示例说明。For ease of understanding, the structure of the terminal provided in the embodiment of the present application is illustrated below.
参见图2A,图2A是本申请实施例提供的终端的一种结构示意图。图2A所示的终端可以为手机。如图2A所示,终端100可以包括处理器111,存储器112,按键113,以及显示屏114。处理器111,存储器112,按键113,以及显示屏114可以通过总线连接。可以理解的是,本申请实施例示意的结构并不构成对终端100的具体限定。在本申请另一些可行的实施方式中,终端100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置,具体可根据实际应用场景确定,在此不做限制。图2A所示的部件可以以硬件,软件,或软件与硬件的组合实现。Referring to FIG. 2A, FIG. 2A is a schematic structural diagram of a terminal provided by an embodiment of the present application. The terminal shown in FIG. 2A may be a mobile phone. As shown in FIG. 2A , the terminal 100 may include a processor 111 , a memory 112 , keys 113 , and a display 114 . The processor 111, the memory 112, the keys 113, and the display screen 114 can be connected through a bus. It can be understood that, the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal 100 . In other feasible implementations of the present application, the terminal 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange different components, which may be determined according to actual applications. The scene is determined, and there is no limitation here. The components shown in FIG. 2A can be implemented in hardware, software, or a combination of software and hardware.
其中,处理器111可以包括一个或多个处理单元,例如:处理器111可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。Wherein, the processor 111 may include one or more processing units, for example: the processor 111 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal Processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) and so on. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
控制器可以是终端100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the terminal 100 . The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
处理器111中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器111中的存储器为高速缓冲存储器。该存储器可以保存处理器111刚用过或循环使用的指令或数据。如果处理器111需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器111的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 111 for storing instructions and data. In some embodiments, the memory in processor 111 is a cache memory. The memory may hold instructions or data that the processor 111 has just used or recycled. If the processor 111 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 111 is reduced, thus improving the efficiency of the system.
存储器112与处理器111耦合,用于存储各种软件程序和/或多组指令。存储器112可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器111通过运行存储在存储器112的指令,从而执行终端100的各种功能应用以及数据处理。存储器112可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端100使用过程中所创建的数据(比如音频数据,待显示的图像数据等)等。此外,存储器112可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The memory 112 is coupled with the processor 111 for storing various software programs and/or sets of instructions. Memory 112 may be used to store computer-executable program code, which includes instructions. The processor 111 executes various functional applications and data processing of the terminal 100 by executing instructions stored in the memory 112 . The memory 112 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data created during use of the terminal 100 (such as audio data, image data to be displayed, etc.) and the like. In addition, the memory 112 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
按键113包括电源(power)键(或称为开机键/关机键),音量键等。音量键具体包括音量上(+)键和音量下(-)键。电源键(或称为开机键/关机键)用于开启/关闭/重启终端100。按键113可以是机械按键,也可以是触摸式按键。本申请实施例的终端采用机械按键的形式。The key 113 includes a power key (or called a power key/off key), a volume key, and the like. The volume keys specifically include a volume up (+) key and a volume down (-) key. The power button (or called a power button/shutdown button) is used to turn on/off/restart the terminal 100 . The key 113 can be a mechanical key or a touch key. The terminal in the embodiment of the present application is in the form of a mechanical button.
显示屏114,可用于显示图像,视频,界面等。本申请实施例中,显示屏114用于显示终端100的系统输出的各个界面,具体可参考后续实施例的相关描述。显示屏114包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。The display screen 114 can be used to display images, videos, interfaces and the like. In the embodiment of the present application, the display screen 114 is used to display various interfaces output by the system of the terminal 100, and for details, reference may be made to related descriptions in subsequent embodiments. The display screen 114 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
在一些实施例中,参见图2B,图2B是本申请实施例提供的终端的另一种结构示意图。图2B所示的终端可以为手机。如图2B所示,终端100除包括处理器111,存储器112,按键113,以及显示屏114外,还可以包括其他部件,下面结合图2B对终端100包括的其他部件进行简要介绍。In some embodiments, referring to FIG. 2B , FIG. 2B is another schematic structural diagram of a terminal provided in an embodiment of the present application. The terminal shown in FIG. 2B may be a mobile phone. As shown in FIG. 2B , the terminal 100 may include other components besides the processor 111 , memory 112 , key 113 , and display screen 114 . The other components included in the terminal 100 will be briefly introduced below in conjunction with FIG. 2B .
其中,终端100还可以包括电池、充电管理模块、电源管理模块。电池可以用于为终端100提供电源。充电管理模块用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块可以通过USB接 口接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块可以通过终端100的无线充电线圈接收无线充电输入。充电管理模块为电池充电的同时,还可以通过电源管理模块为电子设备供电。电源管理模块用于连接电池,充电管理模块与处理器111。电源管理模块接收电池和/或充电管理模块的输入,为处理器111,存储器112,按键113以及显示屏114等供电。电源管理模块还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块也可以设置于处理器111中。在另一些实施例中,电源管理模块和充电管理模块也可以设置于同一个器件中。Wherein, the terminal 100 may further include a battery, a charging management module, and a power management module. A battery may be used to provide power to the terminal 100 . The charging management module is used to receive charging input from the charger. Wherein, the charger may be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module can receive the charging input of the wired charger through the USB interface. In some wireless charging embodiments, the charging management module can receive wireless charging input through the wireless charging coil of the terminal 100 . While charging the battery, the charging management module can also supply power to the electronic device through the power management module. The power management module is used for connecting the battery, the charging management module and the processor 111 . The power management module receives the input from the battery and/or the charging management module, and supplies power to the processor 111 , the memory 112 , the keys 113 and the display screen 114 . The power management module can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance). In some other embodiments, the power management module may also be disposed in the processor 111 . In some other embodiments, the power management module and the charging management module can also be set in the same device.
在一些实施例中,该终端100还可以包括用于实现无线通信功能的部件。示例性的,终端100还包括天线1,天线2,移动通信模块,无线通信模块,调制解调处理器以及基带处理器等。In some embodiments, the terminal 100 may also include components for implementing wireless communication functions. Exemplarily, the terminal 100 further includes an antenna 1, an antenna 2, a mobile communication module, a wireless communication module, a modem processor, a baseband processor, and the like.
天线1和天线2用于发射和接收电磁波信号。可选的,天线1和天线2可以用于发射蓝牙信号。终端100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些可行的实施方式中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Optionally, antenna 1 and antenna 2 can be used to transmit Bluetooth signals. Each antenna in terminal 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In some other feasible implementation manners, the antenna can be used in combination with a tuning switch.
移动通信模块可以提供应用在终端100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些可行的实施方式中,移动通信模块的至少部分功能模块可以被设置于处理器111中。在一些可行的实施方式中,移动通信模块的至少部分功能模块可以与处理器111的至少部分模块被设置在同一个器件中。The mobile communication module can provide wireless communication solutions including 2G/3G/4G/5G applied on the terminal 100 . The mobile communication module may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. The mobile communication module can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation. The mobile communication module can also amplify the signal modulated by the modem processor, convert it into electromagnetic wave and radiate it through the antenna 1 . In some feasible implementation manners, at least part of the functional modules of the mobile communication module may be set in the processor 111 . In some feasible implementation manners, at least part of the functional modules of the mobile communication module and at least part of the modules of the processor 111 may be set in the same device.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器,受话器等)输出声音信号,或通过显示屏114显示图像或视频。在一些可行的实施方式中,调制解调处理器可以是独立的器件。在另一些可行的实施方式中,调制解调处理器可以独立于处理器111,与移动通信模块或其他功能模块设置在同一个器件中。A modem processor may include a modulator and a demodulator. Wherein, the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is passed to the application processor after being processed by the baseband processor. The application processor outputs sound signals through audio equipment (not limited to speakers, receivers, etc.), or displays images or videos through the display screen 114 . In some possible implementations, the modem processor may be a stand-alone device. In some other feasible implementation manners, the modem processor may be independent from the processor 111, and be set in the same device as the mobile communication module or other functional modules.
无线通信模块可以提供应用在终端100上的包括无线局域网(wireless local area networks,WLAN)如Wi-Fi网络,蓝牙(blue tooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器111。无线通信模块还可以从处理器111接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module can provide applications on the terminal 100 including wireless local area networks (wireless local area networks, WLAN) such as Wi-Fi networks, bluetooth (blue tooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module may be one or more devices integrating at least one communication processing module. The wireless communication module receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 111 . The wireless communication module can also receive the signal to be sent from the processor 111 , frequency-modulate it, amplify it, and convert it into electromagnetic wave through the antenna 2 for radiation.
可选的,无线通信处理模块可以包括蓝牙(BT)通信处理模块、WLAN通信处理模块、红外线通信处理模块。蓝牙(BT)通信处理模块、WLAN通信处理模块中的一项或多项可以监听到其他设备发射的信号,如探测请求、扫描信号等等,并可以发送响应信号,如探 测响应、扫描响应等,使得其他设备可以发现终端100,并与其他设备建立无线通信连接,通过蓝牙或WLAN中的一种或多种无线通信技术与其他设备进行通信。其中,蓝牙(BT)通信处理模块可以提供包括经典蓝牙(BR/EDR)或蓝牙低功耗(Bluetooth low energy,BLE)中一项或多项蓝牙通信的解决方案。WLAN通信处理模块可以包括Wi-Fi direct、Wi-Fi LAN或Wi-Fi softAP中一项或多项WLAN通信的解决方案。红外线通信处理模块可以处理红外接收器接收到红外信号以及接收红外信号的位置。Optionally, the wireless communication processing module may include a Bluetooth (BT) communication processing module, a WLAN communication processing module, and an infrared communication processing module. One or more of the Bluetooth (BT) communication processing module and the WLAN communication processing module can monitor the signals emitted by other devices, such as detection requests, scanning signals, etc., and can send response signals, such as detection responses, scanning responses, etc. , so that other devices can discover the terminal 100, establish a wireless communication connection with other devices, and communicate with other devices through one or more wireless communication technologies in Bluetooth or WLAN. Among them, the Bluetooth (BT) communication processing module can provide one or more Bluetooth communication solutions including classic Bluetooth (BR/EDR) or Bluetooth low energy (Bluetooth low energy, BLE). The WLAN communication processing module can include one or more WLAN communication solutions in Wi-Fi direct, Wi-Fi LAN or Wi-Fi softAP. The infrared communication processing module can process the infrared signal received by the infrared receiver and the location where the infrared signal is received.
在一些实施例中,终端100的天线1和移动通信模块耦合,天线2和无线通信模块耦合,使得终端100可以通过无线通信技术与网络以及其他设备通信。In some embodiments, the antenna 1 of the terminal 100 is coupled to the mobile communication module, and the antenna 2 is coupled to the wireless communication module, so that the terminal 100 can communicate with the network and other devices through wireless communication technology.
在一些实施例中,终端100还可以包括音频模块,扬声器,受话器,麦克风,耳机接口,以及应用处理器等部件,用于实现音频功能。例如音乐播放,录音等。In some embodiments, the terminal 100 may further include components such as an audio module, a speaker, a receiver, a microphone, an earphone jack, and an application processor, for implementing audio functions. Such as music playback, recording, etc.
音频模块用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。扬声器,也称“喇叭”,用于将音频电信号转换为声音信号。受话器,也称“听筒”,用于将音频电信号转换成声音信号。麦克风,也称“话筒”,“传声器”,用于将声音信号转换为电信号。耳机接口用于连接有线耳机。耳机接口可以是USB接口,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The audio module is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. Loudspeakers, also called "horns", are used to convert audio electrical signals into sound signals. The receiver, also known as the "earpiece", is used to convert audio electrical signals into sound signals. Microphones, also known as "microphones" and "microphones", are used to convert sound signals into electrical signals. The headphone jack is used to connect wired headphones. The earphone jack can be a USB interface, or a 3.5mm open mobile terminal platform (open mobile terminal platform, OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
在一些实施例中,终端100还可以包括指示器、用户识别模块(subscriber identification module,SIM)卡接口、以及传感器模块。其中,指示器可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口用于连接SIM卡。SIM卡可以通过插入SIM卡接口,或从SIM卡接口拔出,实现和终端100的接触和分离。在一些可行的实施方式中,终端100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在终端100中,不能和终端100分离。传感器模块中包括各种传感器,用于实现传感功能。In some embodiments, the terminal 100 may further include an indicator, a subscriber identification module (subscriber identification module, SIM) card interface, and a sensor module. Wherein, the indicator can be an indicator light, which can be used to indicate the charging state, the change of the battery capacity, and can also be used to indicate messages, missed calls, notifications, and the like. The SIM card interface is used to connect a SIM card. The SIM card can be connected to and separated from the terminal 100 by inserting it into the SIM card interface or pulling it out from the SIM card interface. In some feasible implementation manners, the terminal 100 adopts an eSIM, that is, an embedded SIM card. The eSIM card can be embedded in the terminal 100 and cannot be separated from the terminal 100 . The sensor module includes various sensors for realizing sensing functions.
终端100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明终端100的软件结构。The software system of the terminal 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In this embodiment of the present application, an Android system with a layered architecture is taken as an example to illustrate the software structure of the terminal 100 .
参见图3,图3是本申请实施例提供的终端的软件结构框图。Referring to FIG. 3 , FIG. 3 is a block diagram of a software structure of a terminal provided by an embodiment of the present application.
如图3所示,分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些可行的实施方式中,可将安卓系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。As shown in Figure 3, the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some feasible implementation manners, the Android system can be divided into four layers, which are respectively the application program layer, the application program framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer from top to bottom.
应用程序层可以包括一系列应用程序包。The application layer can consist of a series of application packages.
如图3所示,应用程序包可以包括蓝牙,设备管理应用(具备设备管理功能的应用),WLAN,短消息,图库,日历,通话等应用程序(application,APP)。As shown in FIG. 3 , the application program package may include Bluetooth, device management application (application with device management function), WLAN, short message, gallery, calendar, call and other application programs (applications, APPs).
应用程序框架层为应用程序层的应用程序提供应用编程接口和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides application programming interfaces and programming frameworks for applications in the application layer. The application framework layer includes some predefined functions.
如图3所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 3, the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。上述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make it accessible to applications. The aforementioned data can include videos, images, audio, calls made and received, browsing history and bookmarks, phonebook, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供终端100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide a communication function of the terminal 100 . For example, the management of call status (including connected, hung up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话界面形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the download completion, message reminder, etc. The notification manager can also be a notification that appears on the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog interface. For example, prompting text information in the status bar, issuing a prompt sound, vibrating the electronic device, and flashing the indicator light, etc.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core library and virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application program layer and the application program framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。A system library can include multiple function modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of various commonly used audio and video formats, as well as still image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing, etc.
2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
上述内容简要介绍了本申请实施例中终端的软件和硬件结构,下面将结合更多的附图对本申请提供的技术方案进行详细说明。The above content briefly introduces the software and hardware structures of the terminal in the embodiments of the present application, and the technical solutions provided by the present application will be described in detail below in conjunction with more drawings.
本申请实施例提供一种recovery模式升级过程中的重启方法,通过在recovery模式升级过程中更改强制重启功能与物理按键的对应关系,来减少recovery模式升级过程中用户误触导致的重启,从而减少手机无法使用的可能性,还可以解决在异常场景中无法直接退出recovery模式的问题。The embodiment of the present application provides a restart method during the recovery mode upgrade process. By changing the corresponding relationship between the forced restart function and the physical button during the recovery mode upgrade process, the restart caused by the user's mistaken touch during the recovery mode upgrade process is reduced, thereby reducing The possibility that the mobile phone cannot be used can also solve the problem of not being able to directly exit the recovery mode in abnormal scenarios.
在介绍本申请技术方案之前,先对本申请实施例涉及的安卓系统的recovery分区和misc分区进行简要说明。其中,recovery分区可以理解为一种替代启动分区,让设备启动 到一个recovery控制台上执行预置的恢复和维护操作。misc分区包含ON/OFF开关形式的系统设置。这些设置可包括CID(Carrier or Region ID),USB配置和某些硬件的设置等。misc分区是一个重要的分区,如果损坏或丢失,一些设备的功能将不能正常工作。Before introducing the technical solution of the present application, the recovery partition and the misc partition of the Android system involved in the embodiment of the present application are briefly described. Among them, the recovery partition can be understood as an alternative boot partition, allowing the device to boot to a recovery console to perform preset recovery and maintenance operations. The misc partition contains system settings in the form of ON/OFF switches. These settings can include CID (Carrier or Region ID), USB configuration and some hardware settings, etc. The misc partition is an important partition. If it is damaged or lost, some device functions will not work properly.
参见图4,图4是本申请实施例提供的recovery模式升级过程中的重启方法的流程示意图。图4示出了终端的内部数据处理过程。如图4所示,本申请实施例提供的recovery模式升级过程中的重启方法包括但不限于以下步骤:Referring to FIG. 4 , FIG. 4 is a schematic flowchart of a restart method during an upgrade in recovery mode provided by an embodiment of the present application. Fig. 4 shows the internal data processing process of the terminal. As shown in Figure 4, the restart method in the recovery mode upgrade process provided by the embodiment of the present application includes but is not limited to the following steps:
S1,若检测到终端进入recovery模式,则终端将该终端的强制重启触发方式设置为同时长按电源键和音量键。S1. If it is detected that the terminal enters the recovery mode, the terminal sets the trigger mode of the forced restart of the terminal to long press the power button and the volume button at the same time.
可选的,本申请实施例中的终端可以是手机。用户可以在终端上通过一次或多次操作进入recovery模式。一个示例中,终端在主系统下可以检测系统版本是否有更新,如果有更新,终端可以以弹窗或通知栏等方式进行提示。如果用户选择进行系统版本更新,终端就在主系统下搜索系统版本更新包并下载。当终端下载完升级所需的系统版本更新包后,在系统版本更新界面上显示重启控件。如果用户点击重启控件,终端响应于用户的点击操作,调用重启命令,并加上重启参数recovery,此重启命令会在misc分区写入标志位boot-recovery,之后终端会重启,此时终端进入recovery模式。简言之,终端在主系统下下载升级包,在下载完升级包需要进行升级时,调用重启命令,并加上重启参数recovery,在misc分区写入标志位boot-recovery,再重启进入recovery模式进行HOTA升级。另一个示例中,终端关机后,仍然会读取终端的物理按键(比如音量键和电源(power)键)和是否连接充电器/PC-USB。当终端监测到同时长按音量上(+)/下(-)键和power键以及连接充电器/PC-USB,终端重启并显示recovery主界面或erecovery主界面,此时终端进入recovery模式。参见图5,图5是本申请实施例提供的recovery主界面和erecovery主界面的示意图。如图5所示,终端在recovery主界面或erecovery主界面上需要通过音量键来移动光标,通过电源键来进行确认。应理解,图5所示电源键和音量键位于同一侧,实际实现中,电源键和音量键可以位于终端的不同侧,本申请实施例对此不做限定。Optionally, the terminal in this embodiment of the present application may be a mobile phone. The user can enter the recovery mode through one or more operations on the terminal. In an example, the terminal can detect whether the system version has been updated under the main system, and if there is an update, the terminal can prompt in the form of a pop-up window or a notification bar. If the user chooses to update the system version, the terminal searches for the system version update package under the main system and downloads it. After the terminal downloads the system version update package required for the upgrade, the restart control is displayed on the system version update interface. If the user clicks the restart control, the terminal will respond to the user’s click operation and call the restart command, and add the restart parameter recovery. This restart command will write the flag bit boot-recovery in the misc partition, and then the terminal will restart. At this time, the terminal enters recovery model. In short, the terminal downloads the upgrade package under the main system, and when it needs to be upgraded after downloading the upgrade package, call the restart command, add the restart parameter recovery, write the flag boot-recovery in the misc partition, and then restart to enter the recovery mode Do a HOTA upgrade. In another example, after the terminal is powered off, physical keys (such as volume keys and power (power) keys) of the terminal and whether a charger/PC-USB is connected will still be read. When the terminal detects that the volume up (+)/down (-) button and the power button are pressed and held at the same time and the charger/PC-USB is connected, the terminal restarts and displays the recovery main interface or erecovery main interface, and the terminal enters recovery mode at this time. Referring to FIG. 5 , FIG. 5 is a schematic diagram of the recovery main interface and the erecovery main interface provided by the embodiment of the present application. As shown in Figure 5, the terminal needs to use the volume keys to move the cursor on the recovery main interface or the erecovery main interface, and use the power key to confirm. It should be understood that the power key and the volume key are located on the same side as shown in FIG. 5 . In actual implementation, the power key and the volume key may be located on different sides of the terminal, which is not limited in this embodiment of the present application.
可见,在recovery模式下,除了HOTA升级,还有recovery主界面,erecovery升级等多个界面会用到电源键。因此,为了防止recovery模式升级过程中的误触重启,不能直接屏蔽recovery模式下的power键,并且为了避免异常场景,如死机,手机无法正常操作,也必须保留能通过按键强制重启的方式。It can be seen that in the recovery mode, in addition to the HOTA upgrade, there are recovery main interface, erecovery upgrade and other interfaces that use the power button. Therefore, in order to prevent accidental restart during the recovery mode upgrade process, the power button in recovery mode cannot be directly blocked, and in order to avoid abnormal scenarios, such as crashes, and the phone cannot operate normally, the method of forcing a restart through the button must also be retained.
因此,本申请实施例中的终端在启动过程(比如lk阶段)中会检测misc分区中是否存在标志位,比如boot-recovery。如果misc分区中存在标志位boot-recovery,则终端确定进入recovery模式。这是因为正常启动时misc分区为空,只有在进入recovery模式时才会进行misc分区升级信息的写入,主要写入标志位boot-recovery。当检测到终端进入recovery模式时,终端可以将该终端的强制重启触发方式设置为同时长按电源键和音量键。Therefore, the terminal in the embodiment of the present application will detect whether there is a flag, such as boot-recovery, in the misc partition during the startup process (such as the lk stage). If the flag bit boot-recovery exists in the misc partition, the terminal determines to enter the recovery mode. This is because the misc partition is empty during normal startup, and the upgrade information of the misc partition will be written only when it enters the recovery mode, mainly into the flag bit boot-recovery. When it is detected that the terminal enters the recovery mode, the terminal can set the trigger mode of the forced restart of the terminal to press and hold the power button and the volume button at the same time.
应理解,终端的启动过程包括:首先上电,接着CPU启动预加载程序(preloader),预加载程序用于启动小内核/小操作系统(little kernel,简称lk),lk主要负责模式选择,根据选择的模式去加载对应的内容,然后通过虚拟内存盘(ramdisk)的初始化函数(init)去启动相应的服务。其中,终端启动到lk阶段时,会根据配置文件初始化按键功能。以多频音键控(multi-tone keying,MTK)为例,终端启动到lk阶段时,调用长按重启功能设置(如 long_press_reboot_function_setting)函数设置强制重启的方式。如果配置文件中配置的与重启相关的宏是一键重启模式(比如配置文件中包括宏“CONFIG_ONEKEY_REBOOT_NORMAL_MODE=y”),则终端调用电源管理集成电路(Power Management IC,pmic)将寄存器值设置为0x00(如:PMIC_RG_PWRKEY_KEY_MODE,0x00),从而将电源键设置为强制重启键,也就是说将强制重启触发方式设置为长按电源键。如果配置文件中配置的与重启相关的宏是两键重启模式(比如配置文件中包括宏“CONFIG_TWOKEY_REBOOT_NORMAL_MODE=y”),则终端调用pmic将寄存器值设置为0x01(如:PMIC_RG_PWRKEY_KEY_MODE,0x01),从而将强制重启键设置为组合键,也就是说将强制重启触发方式设置为同时长按组合键。还应理解,终端在每次启动过程中都会根据配置文件初始化按键功能。It should be understood that the startup process of the terminal includes: first power on, and then the CPU starts a preloader (preloader), the preloader is used to start a small kernel/small operating system (little kernel, lk for short), lk is mainly responsible for mode selection, according to Select the mode to load the corresponding content, and then start the corresponding service through the initialization function (init) of the virtual memory disk (ramdisk). Among them, when the terminal starts to the lk stage, it will initialize the button function according to the configuration file. Taking multi-tone keying (MTK) as an example, when the terminal boots to the lk stage, call the long-press restart function setting (such as long_press_reboot_function_setting) function to set the forced restart method. If the restart-related macro configured in the configuration file is the one-key restart mode (for example, the configuration file includes the macro "CONFIG_ONEKEY_REBOOT_NORMAL_MODE=y"), the terminal calls the power management integrated circuit (Power Management IC, pmic) to set the register value to 0x00 (eg: PMIC_RG_PWRKEY_KEY_MODE, 0x00), so as to set the power button as a forced restart button, that is to say, set the trigger mode of forced restart to long press the power button. If the restart-related macro configured in the configuration file is the two-key restart mode (for example, the configuration file includes the macro "CONFIG_TWOKEY_REBOOT_NORMAL_MODE=y"), the terminal calls pmic to set the register value to 0x01 (such as: PMIC_RG_PWRKEY_KEY_MODE, 0x01), thereby setting The forced restart key is set as a combination key, that is to say, the trigger mode of the forced restart is set to press and hold the combination key at the same time. It should also be understood that the terminal will initialize key functions according to the configuration file during each startup process.
本申请实施例的终端将该终端的强制重启触发方式设置为同时长按电源键和音量键,包括:终端在识别到进入recovery模式后,再次调用pmic将寄存器值设置为0x01,从而将组合键(比如电源键和音量上键,或电源键和音量下键)设置为强制重启键,也就是说将强制重启触发方式设置为同时长按电源键和音量键。其中,本申请实施例的终端在进入recovery模式之前,强制重启键是电源键。也就是说,当终端启动到lk阶段时,会调用pmic将寄存器值设置为0x00;当终端(在lk阶段)确定进入recovery模式后,再次调用pmic将寄存器值设置为0x01(或者说将寄存器的值从0x00更改为0x01)。The terminal in the embodiment of the present application sets the forced restart trigger mode of the terminal to long press the power button and the volume button at the same time, including: after the terminal recognizes that it has entered the recovery mode, it calls pmic again to set the register value to 0x01, so that the combined key (For example, the power button and the volume up button, or the power button and the volume down button) are set as the forced restart button, that is to say, the forced restart trigger mode is set to long press the power button and the volume button at the same time. Wherein, before the terminal in the embodiment of the present application enters the recovery mode, the forced restart key is the power key. That is to say, when the terminal starts to the lk stage, it will call pmic to set the register value to 0x00; when the terminal (in the lk stage) determines to enter the recovery mode, it will call pmic again to set the register value to 0x01 (or set the register value to 0x01). value changed from 0x00 to 0x01).
S2,若终端在进入recovery模式后监测到长按电源键,则终端显示第一提示界面,该第一提示界面上包括文字提示,用于提示强制重启的风险和正确的强制重启触发方式。S2. If the terminal detects that the power button has been pressed for a long time after entering the recovery mode, the terminal displays a first prompt interface. The first prompt interface includes text prompts for prompting the risk of forced restart and the correct trigger method for forced restart.
可选的,终端在进入recovery模式后,可以通过/采用/启动线程监测终端的物理按键(比如电源键和音量键)。如果终端在进入recovery模式后监测到长按电源键,则终端监测是否同时长按音量键(这里指音量上键或音量下键);如果终端监测到没有同时长按音量键,则调用显示接口显示第一提示界面。该显示接口的输入参数包括显示的内容(比如文字、图像等)和显示的位置坐标。其中,该第一提示界面上包括文字提示,用于提示强制重启的风险和正确的强制重启触发方式。该第一提示界面既可以是一个全新的界面,也可以是在原有的升级界面上增加相应的文字提示。示例性的,第一提示界面上的文字提示可以是“正在升级,请勿长按电源键,升级过程中,强制重启会导致设备异常,如果需要强制关机,请同时长按电源键和音量上/下键”。Optionally, after the terminal enters the recovery mode, it can monitor the physical keys (such as power key and volume key) of the terminal through /adopt/start thread. If the terminal detects that the power button is long pressed after entering the recovery mode, the terminal detects whether the volume button is long pressed at the same time (here refers to the volume up key or the volume down key); if the terminal detects that the volume key is not pressed at the same time, the display interface is called Display the first prompt interface. The input parameters of the display interface include displayed content (such as text, image, etc.) and displayed position coordinates. Wherein, the first prompt interface includes a text prompt, which is used to prompt the risk of forced restart and the correct triggering method of forced restart. The first prompt interface can be a brand new interface, or a corresponding text prompt can be added to the original upgrade interface. Exemplarily, the text prompt on the first prompt interface may be "updating, please do not press and hold the power button. During the upgrade process, a forced restart will cause abnormality of the device. If you need to force shutdown, please press and hold the power button and volume up at the same time. /down key".
可选的,如果终端在进入recovery模式后监测到长按电源键且长按时间超过第一时间阈值,则终端调用显示接口显示第一提示界面。比如,第一时间阈值为10秒(s)。这样,如果用户长按电源键的时间不足预设的时间阈值,则可以不调用显示接口去显示第一提示界面,节省功耗。Optionally, if the terminal detects a long press of the power button after entering the recovery mode and the long press time exceeds the first time threshold, the terminal calls the display interface to display the first prompt interface. For example, the first time threshold is 10 seconds (s). In this way, if the user presses the power button for less than the preset time threshold, the display interface may not be invoked to display the first prompt interface, thereby saving power consumption.
示例性的,参见图6A,图6A是本申请实施例提供的第一提示界面的一示意图。如图6A所示,终端在进入recovery模式后,用户长按电源键超过10s,终端调用显示接口显示第一提示界面601。第一提示界面601是一个全新的界面,其文字提示可位于界面的中间位置,采用加粗、不同颜色的字体等方式来突出显示;可选的,该第一提示界面601上还可以设置一个返回控件602,用于返回到原有的升级界面(即原有的HOTA升级界面)。参见图6B,图6B是本申请实施例提供的第一提示界面的另一示意图。如图6B所示,如图 6B所示,终端在进入recovery模式后,用户长按电源键超过10s,终端调用显示接口显示第一提示界面601。第一提示界面601是在原有的HOTA升级界面上增加相应的文字提示,该文字提示可位于原有HOTA升级界面的最顶部位置,同样可采用加粗、不同颜色的字体等方式来突出显示。For example, refer to FIG. 6A , which is a schematic diagram of a first prompt interface provided by an embodiment of the present application. As shown in FIG. 6A , after the terminal enters the recovery mode, the user presses and holds the power button for more than 10 seconds, and the terminal invokes the display interface to display a first prompt interface 601 . The first prompting interface 601 is a brand-new interface, and its text prompting can be positioned at the middle position of the interface, and adopts methods such as thickening, the font of different colors to highlight; Optionally, a The return control 602 is used to return to the original upgrade interface (that is, the original HOTA upgrade interface). Referring to FIG. 6B , FIG. 6B is another schematic diagram of the first prompt interface provided by the embodiment of the present application. As shown in FIG. 6B, after the terminal enters the recovery mode, the user presses and holds the power button for more than 10 seconds, and the terminal invokes the display interface to display the first prompt interface 601. The first prompt interface 601 is to add corresponding text prompts on the original HOTA upgrade interface. The text prompts can be located at the top of the original HOTA upgrade interface, and can also be highlighted in bold or different-colored fonts.
S3,若终端在进入recovery模式后监测到同时长按电源键和音量键且长按的时间未超过第二时间阈值,则终端显示第二提示界面,该第二提示界面上包括文字提示,用于提示强制重启的风险。S3, if the terminal detects that the power button and the volume button are pressed and held at the same time after entering the recovery mode and the time of the long press does not exceed the second time threshold, the terminal displays a second prompt interface, which includes a text prompt, and uses To warn of the risk of a forced restart.
可选的,因为终端在进入recovery模式后,通过/采用/启动线程监测终端的物理按键(比如电源键和音量键),所以如果终端在进入recovery模式后监测到同时长按电源键和音量上/下键,且长按的时间未超过第二时间阈值,则调用显示接口显示第二提示界面。该显示接口的输入参数包括显示的内容(比如文字、图像等)和显示的位置坐标。其中,该第二提示界面上包括文字提示,用于提示强制重启的风险。该第二提示界面既可以是一个全新的界面,也可以是在原有的升级界面上增加相应的文字提示。其中,第二时间阈值可以为10s,15s等。应理解,第二提示界面与上述第一提示界面类似,其不同之处在于,显示接口的输入参数不相同。示例性的,第二提示界面上的文字提示可以是“正在升级,同时长按电源键和音量上/下键会强制关机,导致设备异常”。Optionally, after the terminal enters the recovery mode, it monitors the physical buttons (such as the power button and the volume button) of the terminal through /adopting/starting the thread, so if the terminal detects that the power button and the volume button are pressed and held at the same time after entering the recovery mode /down key, and the long-pressed time does not exceed the second time threshold, the display interface is called to display the second prompt interface. The input parameters of the display interface include displayed content (such as text, image, etc.) and displayed position coordinates. Wherein, the second prompt interface includes a text prompt for prompting the risk of forced restart. The second prompt interface can be a brand new interface, or a corresponding text prompt can be added to the original upgrade interface. Wherein, the second time threshold may be 10s, 15s and so on. It should be understood that the second prompt interface is similar to the above-mentioned first prompt interface, except that the input parameters of the display interfaces are different. Exemplarily, the text prompt on the second prompt interface may be "updating, long pressing the power key and the volume up/down key at the same time will force shutdown, causing the device to be abnormal".
可选的,当终端监测到同时长按电源键和音量键时,可以启动一个计时器。当这个计时器的时间超过第三时间阈值但未超过第二时间阈值时,则终端可以调用显示接口显示第二提示界面。这样可以减少终端的复杂度和功耗。其中,第三时间阈值小于第二时间阈值,比如,第三时间阈值是3秒,第二时间阈值是10秒。Optionally, when the terminal detects that the power button and the volume button are pressed and held at the same time, a timer can be started. When the time of the timer exceeds the third time threshold but does not exceed the second time threshold, the terminal may call the display interface to display the second prompt interface. This can reduce the complexity and power consumption of the terminal. Wherein, the third time threshold is smaller than the second time threshold, for example, the third time threshold is 3 seconds, and the second time threshold is 10 seconds.
S4,若终端在进入recovery模式后监测到同时长按电源键和音量键的时间超过该第二时间阈值,则终端进行强制关机。S4. After the terminal enters the recovery mode and detects that the time for pressing and holding the power button and the volume button at the same time exceeds the second time threshold, the terminal is forced to shut down.
可选的,因为终端在进入recovery模式后,通过/采用/启动线程监测终端的物理按键(比如电源键和音量键),所以如果终端在进入recovery模式后监测到同时长按电源键和音量上/下键,且同时长按的时间超过上述第二时间阈值,则终端进行强制关机。应理解,这里终端强制关机可以理解为退出了recovery模式。示例性的,参见图7,图7是本申请实施例提供的同时长按电源键和音量键的界面变化示意图。如图7所示,终端在进入recovery模式后,用户同时长按电源键和音量上键未超过10s,终端调用显示接口显示第二提示界面701。第二提示界面701既可以是一个全新的界面,其文字提示可位于界面的中间位置,采用加粗、不同颜色的字体等方式来突出显示;可选的,该第二提示界面701上还可以设置一个返回控件702,用于返回到原有的升级界面(即原有的HOTA升级界面)。该第二提示界面701也可以是在原有的HOTA升级界面上增加相应的文字提示,该文字提示可位于原有HOTA升级界面的最顶部位置,同样可采用加粗、不同颜色的字体等方式来突出显示。如果用户继续同时长按电源键和音量上键,直到长按时间超过10s,则终端进行强制关机。Optionally, after the terminal enters the recovery mode, it monitors the physical buttons (such as the power button and the volume button) of the terminal through /adopting/starting the thread, so if the terminal detects that the power button and the volume button are pressed and held at the same time after entering the recovery mode / down key, and the time of long pressing at the same time exceeds the above-mentioned second time threshold, the terminal will be forced to shut down. It should be understood that the forced shutdown of the terminal here can be understood as exiting the recovery mode. For example, refer to FIG. 7 . FIG. 7 is a schematic diagram of an interface change provided by an embodiment of the present application by simultaneously pressing and holding a power key and a volume key. As shown in FIG. 7 , after the terminal enters the recovery mode, the user simultaneously presses the power button and the volume up button for less than 10 seconds, and the terminal invokes the display interface to display a second prompt interface 701 . The second prompt interface 701 can be a brand new interface, and its text prompt can be located in the middle of the interface, and it can be highlighted by means of bold and different color fonts; optionally, the second prompt interface 701 can also A return control 702 is set for returning to the original upgrade interface (that is, the original HOTA upgrade interface). The second prompt interface 701 can also be to add corresponding text prompts on the original HOTA upgrade interface. highlight. If the user continues to press and hold the power button and the volume up button at the same time until the long-press time exceeds 10s, the terminal will be forced to shut down.
可选的,如果终端在进入recovery模式后监测到同时长按电源键和音量上/下键,且同时长按的时间超过上述第二时间阈值,则终端可以输出确认信息,用于提示用户是否关机。当用户选择“是”时,终端进行强制关机,终端退出recovery模式;当用户选择“否”时,终端继续进行升级,终端不退出recovery模式。Optionally, if the terminal detects that the power button and the volume up/down button are pressed and held at the same time after entering the recovery mode, and the time of the simultaneous long press exceeds the second time threshold, the terminal can output a confirmation message to prompt the user whether to shutdown. When the user selects "Yes", the terminal will be forced to shut down, and the terminal will exit the recovery mode; when the user selects "No", the terminal will continue to upgrade, and the terminal will not exit the recovery mode.
可选的,终端退出recovery模式后在重启的过程中或重启后,会将该终端的强制重启触发方式设置为长按电源键,即终端会重新读取配置文件进行按键配置。也就是说,终端在进入recovery模式后,会将该终端的强制重启触发方式从长按电源键修改为同时长按电源键和音量键;终端在退出recovery模式并重启的过程中,会恢复该终端原来的强制重启触发方式,即长按电源键进行强制重启。Optionally, after the terminal exits the recovery mode and is in the process of restarting or after restarting, the forced restart trigger mode of the terminal will be set to long press the power button, that is, the terminal will re-read the configuration file for button configuration. That is to say, after the terminal enters the recovery mode, it will change the trigger mode of the forced restart of the terminal from long pressing the power button to long pressing the power button and the volume button at the same time; The terminal's original forced restart trigger method is to press and hold the power button to force restart.
可见,本申请实施例在终端进入recovery模式后,更改强制重启功能与物理按键的对应关系,并且根据检测到的不同按键的组合和按的时间长短,去显示对应的内容,以提示用户在recovery模式升级过程中强制重启的风险/危害,以及正确的强制重启方式,不仅可以减少recovery模式升级过程中用户误触导致的重启,从而减少手机无法使用的可能性,还可以解决在异常场景中无法直接退出recovery模式的问题。It can be seen that in the embodiment of the present application, after the terminal enters the recovery mode, the corresponding relationship between the forced restart function and the physical buttons is changed, and the corresponding content is displayed according to the combination of different detected buttons and the length of time pressed, so as to prompt the user to enter the recovery mode. The risks/hazards of forced restart during the mode upgrade process, and the correct forced restart method can not only reduce the restart caused by the user's mistaken touch during the recovery mode upgrade process, thereby reducing the possibility of the phone being unusable, but also solve the problem that the phone cannot be used in abnormal scenarios. The problem of exiting recovery mode directly.
为更好地理解本申请实施例提供的技术方案,下面通过一个示例来简要说明。In order to better understand the technical solutions provided by the embodiments of the present application, an example is briefly described below.
一个示例中,参见图8,图8是本申请实施例提供的recovery模式升级过程中的重启方法的另一种流程示意图。其中,图8中的“Y”表示“是”,“N”表示“否”。如图8所示,本申请实施例提供的recovery模式升级过程中的重启方法包括但不限于以下步骤:For an example, refer to FIG. 8 , which is another schematic flow chart of a restart method during an upgrade in recovery mode provided by an embodiment of the present application. Wherein, "Y" in FIG. 8 means "yes", and "N" means "no". As shown in Figure 8, the restart method in the recovery mode upgrade process provided by the embodiment of the present application includes but is not limited to the following steps:
S801,主系统下搜包并下载完成。S801, searching and downloading packages under the main system is completed.
可选的,终端可以在主系统下检测系统版本是否有更新,如果有更新,则可以在主系统下搜索系统版本更新包(如升级包或系统包)并下载。在下载完成后,如果检测到用户针对终端的预设操作(比如重启操作),则执行步骤S802。Optionally, the terminal can check whether the system version is updated under the main system, and if there is an update, it can search for a system version update package (such as an upgrade package or a system package) under the main system and download it. After the download is completed, if a user's preset operation on the terminal (such as a restart operation) is detected, step S802 is performed.
S802,重启。S802, restart.
可选的,调用重启命令,并加上重启参数recovery,此重启命令会在misc分区写入标志位boot-recovery,之后终端在主系统下重启。Optionally, call the restart command and add the restart parameter recovery. This restart command will write the flag bit boot-recovery in the misc partition, and then the terminal will restart under the main system.
S803,判断是否进入recovery模式。S803, judging whether to enter the recovery mode.
可选的,终端在重启过程中(比如重启的lk阶段,lk阶段会检测需要重启到主系统还是recovery模式)判断是否进入recovery模式,判断方式可参考前述图4的步骤S1中的相应描述,即检测misc分区中是否存在标志位boot-recovery,如果存在,则说明终端进入recovery模式。如果判断出进入recovery模式,则执行步骤S804。Optionally, the terminal judges whether to enter the recovery mode during the restart process (such as the lk stage of the restart, the lk stage will detect whether it needs to restart to the main system or the recovery mode), and the judgment method can refer to the corresponding description in the step S1 of the aforementioned Figure 4, That is to detect whether there is a flag bit boot-recovery in the misc partition, if it exists, it means that the terminal enters the recovery mode. If it is determined that the recovery mode is entered, step S804 is performed.
S804,通过配置pinmux,将强制关机按键配置成同时长按电源键和音量上键预设时间。S804, by configuring pinmux, configure the forced shutdown button to simultaneously press and hold the power button and the volume up button for a preset time.
可选的,终端通过配置pinmux(引脚多路复用),将强制关机按键配置成同时长按电源键和音量上键预设时间(比如10s或15s等),具体配置方式可参考前述图4的步骤S1中的相应描述,此处不再赘述。Optionally, by configuring pinmux (pin multiplexing), the terminal configures the forced shutdown button to press and hold the power button and the volume up button at the same time for a preset time (such as 10s or 15s, etc.). The specific configuration method can refer to the preceding figure The corresponding description in step S1 of 4 will not be repeated here.
S805,开始升级。S805, start to upgrade.
可选的,终端配置完成后在recovery模式下开始升级。Optionally, start the upgrade in recovery mode after the terminal configuration is complete.
S806,在升级过程中判断是否长按电源键。S806, judging whether to press and hold the power button during the upgrade process.
可选的,终端在升级过程中通过线程监测终端的物理按键,判断是否长按电源键,若是,则执行步骤S807。若否,则等待升级完成后自动重启,在重启过程中会将强制关机按键配置成原来的长按电源键。Optionally, during the upgrade process, the terminal monitors the physical buttons of the terminal through threads to determine whether the power button is pressed for a long time, and if so, executes step S807. If not, it will automatically restart after the upgrade is completed. During the restart process, the forced shutdown button will be configured as the original long press power button.
S807,判断是否同时长按音量上键。S807, judging whether to press and hold the volume up key at the same time.
可选的,终端判断是否同时长按音量上键,若是,则执行步骤S810;若否,则执行步 骤S808。Optionally, the terminal determines whether the volume up key is long pressed at the same time, and if yes, executes step S810; if not, executes step S808.
S808,判断是否长按电源键超过预设时间。S808, judging whether the long press of the power button exceeds a preset time.
可选的,终端判断长按电源键的时间是否超过预设时间(比如10s或15s等),若是,则执行步骤S809;若否,则等待升级完成后自动重启,在重启过程中会将强制关机按键配置成原来的长按电源键。Optionally, the terminal judges whether the time of pressing and holding the power button exceeds the preset time (such as 10s or 15s, etc.), and if so, executes step S809; The shutdown button is configured as the original long press power button.
S809,输出提示1。S809, output prompt 1.
可选的,终端输出第一提示信息,用于提示强制重启的风险和正确的强制关机方式。比如,第一提示信息为“正在升级,请勿长按电源键,升级过程中,强制重启会导致设备异常,如果需要强制关机,请同时长按电源键和音量上键”。具体地,上述步骤S806-步骤S809的实现方式可参考前述图4的步骤S2的实现方式,此处不再赘述。Optionally, the terminal outputs first prompt information, which is used to prompt the risk of forced restart and the correct way of forced shutdown. For example, the first prompt message is "Upgrading, please do not press the power button for a long time. During the upgrade process, a forced restart will cause abnormalities in the device. If you need to force shutdown, please press and hold the power button and the volume up button at the same time." Specifically, for the implementation manner of the above step S806-step S809, reference may be made to the implementation manner of the aforementioned step S2 in FIG. 4 , which will not be repeated here.
S810,判断是否同时长按超过预设时间。S810, judging whether the simultaneous long press exceeds a preset time.
可选的,终端判断同时长按电源键和音量上键的时间是否超过预设时间,若是,则执行步骤S812,若否,则执行步骤S811。Optionally, the terminal determines whether the time of simultaneously pressing and holding the power button and the volume up button exceeds a preset time, if yes, execute step S812, and if not, execute step S811.
S811,输出提示2。S811, output prompt 2.
可选的,终端输出第二提示信息,用于提示强制重启的风险。比如,第二提示信息为“正在升级,同时长按电源键和音量上键会强制关机,导致设备异常”。具体地,步骤S811的实现方式可参考前述图4的步骤S3的实现方式,此处不再赘述。Optionally, the terminal outputs a second prompt message, which is used to prompt the risk of forced restart. For example, the second prompt message is "upgrading, long pressing the power button and the volume up button at the same time will force shutdown, causing the device to be abnormal". Specifically, for the implementation manner of step S811, reference may be made to the implementation manner of step S3 in FIG. 4 , which will not be repeated here.
S812,强制关机。S812, force shutdown.
可选的,终端强制关机。具体地,步骤S812的实现方式可参考前述图4的步骤S4的实现方式,此处不再赘述。Optionally, the terminal is forced to shut down. Specifically, for the implementation manner of step S812, reference may be made to the implementation manner of step S4 in FIG. 4 , which will not be repeated here.
本申请的各实施方式可以任意进行组合,以实现不同的技术效果。Various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk)等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server, or data center Transmission to another website site, computer, server, or data center by wired (eg, coaxial cable, optical fiber, DSL) or wireless (eg, infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a Solid State Disk).
以上所述的具体实施方式,对本申请的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本申请的具体实施方式而已,并不用于限定本申请的保护范围,凡在本申请的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。The specific implementation manners described above have further described the purpose, technical solutions and beneficial effects of the application in detail. It should be understood that the above descriptions are only specific implementation modes of the application and are not intended to limit the scope of the application. Scope of protection: All modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of this application shall be included within the scope of protection of this application.
Claims (12)
- 一种recovery模式升级过程中的重启方法,其特征在于,包括:A method for restarting in a recovery mode upgrade process, characterized in that it comprises:终端在主系统下搜索系统版本更新包并下载,所述终端下载完成所述系统版本更新包后,检测用户是否进行预设操作;The terminal searches for a system version update package under the main system and downloads it. After the terminal downloads the system version update package, it detects whether the user performs a preset operation;若检测到所述用户进行所述预设操作,则所述终端在主系统下调用重启命令进行重启;If it is detected that the user performs the preset operation, the terminal invokes a restart command under the main system to restart;所述终端在重启过程中检测是否进入recovery模式;The terminal detects whether to enter the recovery mode during the restart process;若所述终端在重启过程中进入recovery模式,则所述终端将强制关机按键配置为同时长按电源键和音量键预设时间。If the terminal enters the recovery mode during the restart process, the terminal configures the forced shutdown button to simultaneously press and hold the power button and the volume button for a preset time.
- 根据权利要求1所述的方法,其特征在于,所述终端将强制关机按键配置为同时长按电源键和音量键预设时间,包括:The method according to claim 1, wherein the terminal configures the forced shutdown button to simultaneously press and hold the power button and the volume button for a preset time, including:所述终端调用电源管理集成电路将寄存器值设置为0x01。The terminal calls the power management integrated circuit to set the register value to 0x01.
- 根据权利要求1或2所述的方法,其特征在于,所述终端在重启过程中检测是否进入recovery模式,包括:The method according to claim 1 or 2, wherein the terminal detects whether to enter recovery mode during the restart process, comprising:所述终端在重启过程中检测misc分区中是否存在标志位boot-recovery;The terminal detects whether there is a flag bit boot-recovery in the misc partition during the restart process;若所述终端检测到misc分区中存在标志位boot-recovery,则所述终端确定在重启过程中进入recovery模式。If the terminal detects that the flag bit boot-recovery exists in the misc partition, the terminal determines to enter the recovery mode during the restart process.
- 根据权利要求1-3中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-3, further comprising:所述终端在进入recovery模式后,通过线程监测终端的物理按键,所述物理按键包括电源键、音量上键、以及音量下键中的一种或多种;After the terminal enters the recovery mode, the physical keys of the terminal are monitored through threads, and the physical keys include one or more of a power key, a volume up key, and a volume down key;若监测到长按电源键,则所述终端监测是否同时长按音量键;If a long press of the power key is detected, the terminal monitors whether the volume key is long pressed at the same time;若监测到长按电源键且未同时长按音量键,则所述终端监测长按电源键的时间是否超过所述预设时间;If it is detected that the power button is long pressed and the volume button is not long pressed at the same time, the terminal monitors whether the time of long pressing the power button exceeds the preset time;若长按电源键的时间超过所述预设时间,则所述终端输出第一提示信息,所述第一提示信息用于提示强制重启的风险和正确的强制关机方式。If the power button is pressed for longer than the preset time, the terminal outputs first prompt information, and the first prompt information is used to prompt the risk of forced restart and the correct way of forced shutdown.
- 根据权利要求4所述的方法,其特征在于,所述方法还包括:The method according to claim 4, characterized in that the method further comprises:若监测到长按电源键且同时长按音量键,则所述终端监测同时长按的时间是否超过所述预设时间;If it is detected that the power button is long pressed and the volume button is long pressed at the same time, the terminal monitors whether the time of the simultaneous long press exceeds the preset time;若同时长按的时间未超过所述预设时间,则所述终端输出第二提示信息,所述第二指示信息用于提示强制重启的风险。If the simultaneous long press time does not exceed the preset time, the terminal outputs second prompt information, and the second indication information is used to prompt the risk of forced restart.
- 根据权利要求5所述的方法,其特征在于,所述方法还包括:The method according to claim 5, wherein the method further comprises:若同时长按的时间超过所述预设时间,则所述终端强制关机。If the time of simultaneous long pressing exceeds the preset time, the terminal is forced to shut down.
- 根据权利要求4-6中任一项所述的方法,其特征在于,所述终端输出第一提示信息,包括:The method according to any one of claims 4-6, wherein the terminal outputs first prompt information, including:所述终端调用显示接口将第一提示信息显示在终端屏幕的预设位置上,所述显示接口的输入参数包括所述第一提示信息和所述预设位置。The terminal invokes the display interface to display the first prompt information at a preset position on the terminal screen, and the input parameters of the display interface include the first prompt information and the preset position.
- 根据权利要求5或6所述的方法,其特征在于,所述终端输出第二提示信息,包括:The method according to claim 5 or 6, wherein the terminal outputs second prompt information, comprising:所述终端调用显示接口将第二提示信息显示在终端屏幕的预设位置上,所述显示接口的输入参数包括所述第二提示信息和所述预设位置。The terminal invokes the display interface to display the second prompt information at a preset position on the terminal screen, and the input parameters of the display interface include the second prompt information and the preset position.
- 根据权利要求1-8中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-8, further comprising:所述终端退出recovery模式后,所述终端在重启的过程中调用电源管理集成电路将寄存器值设置为0x00。After the terminal exits the recovery mode, the terminal calls the power management integrated circuit to set the register value to 0x00 during the restart process.
- 一种终端,其特征在于,包括处理器和存储器,其中,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,当所述处理器运行所述程序指令时,使所述终端执行如权利要求1-9中任一项所述的方法。A terminal, characterized by comprising a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and when the processor executes the program instructions, the terminal executes The method according to any one of claims 1-9.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时使所述计算机执行如权利要求1-9中任一项所述的方法。A computer-readable storage medium, characterized in that, the computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the computer program according to claim 1. - the method described in any one of 9.
- 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-9中任一项所述的方法。A computer program product, characterized in that, when the computer program product is run on a computer, the computer is made to execute the method according to any one of claims 1-9.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110836801.1 | 2021-07-23 | ||
CN202110836801.1A CN113672297A (en) | 2021-07-23 | 2021-07-23 | Restarting method and terminal in recovery mode upgrading process |
Publications (2)
Publication Number | Publication Date |
---|---|
WO2023000777A1 true WO2023000777A1 (en) | 2023-01-26 |
WO2023000777A9 WO2023000777A9 (en) | 2023-06-15 |
Family
ID=78540120
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/092001 WO2023000777A1 (en) | 2021-07-23 | 2022-05-10 | Method for performing restarting during upgrade process of recovery mode, and terminal |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113672297A (en) |
WO (1) | WO2023000777A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113672297A (en) * | 2021-07-23 | 2021-11-19 | 荣耀终端有限公司 | Restarting method and terminal in recovery mode upgrading process |
CN114879991B (en) * | 2022-04-25 | 2023-05-02 | 杭州振华仪表有限公司 | Software upgrading method, system and storage medium |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103593289A (en) * | 2013-11-12 | 2014-02-19 | 浪潮齐鲁软件产业有限公司 | Design method for android set top box production testing software |
CN104699515A (en) * | 2015-04-01 | 2015-06-10 | 广东欧珀移动通信有限公司 | Android operating system based upgrading method and intelligent terminal |
CN104809010A (en) * | 2015-04-09 | 2015-07-29 | 华为技术有限公司 | Re-installing method and intelligent terminal |
CN105095003A (en) * | 2014-05-21 | 2015-11-25 | 华为技术有限公司 | Method and apparatus for restoring system software of intelligent terminal |
CN106293845A (en) * | 2016-08-15 | 2017-01-04 | 中科创达软件科技(深圳)有限公司 | A kind of terminal enters control method and the device of brush machine pattern |
CN106534512A (en) * | 2016-11-02 | 2017-03-22 | 惠州Tcl移动通信有限公司 | Mobile terminal forced restart mode switching method and system |
US20170286091A1 (en) * | 2016-04-01 | 2017-10-05 | Intel Corporation | Update failure rebooting and recovery for a smart device |
CN107526574A (en) * | 2016-06-20 | 2017-12-29 | 阿里巴巴集团控股有限公司 | The control method and device of system start-up mode |
CN107643898A (en) * | 2016-07-21 | 2018-01-30 | 中兴通讯股份有限公司 | Terminal staging method and device |
WO2019084737A1 (en) * | 2017-10-30 | 2019-05-09 | 华为技术有限公司 | Method for updating selinux security policy, and terminal |
CN113672297A (en) * | 2021-07-23 | 2021-11-19 | 荣耀终端有限公司 | Restarting method and terminal in recovery mode upgrading process |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105100485B (en) * | 2015-08-03 | 2019-01-18 | 北京集创北方科技股份有限公司 | Mobile terminal is anti-error to touch anti-theft alarming method and system |
CN107122212A (en) * | 2017-04-28 | 2017-09-01 | 环球智达科技(北京)有限公司 | Firmware encrypting method |
CN109753411A (en) * | 2019-01-17 | 2019-05-14 | Oppo广东移动通信有限公司 | Abnormality eliminating method, device, mobile terminal and storage medium |
CN110399153B (en) * | 2019-07-25 | 2023-11-03 | Oppo广东移动通信有限公司 | System upgrading method, device, terminal and computer readable storage medium |
-
2021
- 2021-07-23 CN CN202110836801.1A patent/CN113672297A/en active Pending
-
2022
- 2022-05-10 WO PCT/CN2022/092001 patent/WO2023000777A1/en active Application Filing
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103593289A (en) * | 2013-11-12 | 2014-02-19 | 浪潮齐鲁软件产业有限公司 | Design method for android set top box production testing software |
CN105095003A (en) * | 2014-05-21 | 2015-11-25 | 华为技术有限公司 | Method and apparatus for restoring system software of intelligent terminal |
CN104699515A (en) * | 2015-04-01 | 2015-06-10 | 广东欧珀移动通信有限公司 | Android operating system based upgrading method and intelligent terminal |
CN104809010A (en) * | 2015-04-09 | 2015-07-29 | 华为技术有限公司 | Re-installing method and intelligent terminal |
US20170286091A1 (en) * | 2016-04-01 | 2017-10-05 | Intel Corporation | Update failure rebooting and recovery for a smart device |
CN107526574A (en) * | 2016-06-20 | 2017-12-29 | 阿里巴巴集团控股有限公司 | The control method and device of system start-up mode |
CN107643898A (en) * | 2016-07-21 | 2018-01-30 | 中兴通讯股份有限公司 | Terminal staging method and device |
CN106293845A (en) * | 2016-08-15 | 2017-01-04 | 中科创达软件科技(深圳)有限公司 | A kind of terminal enters control method and the device of brush machine pattern |
CN106534512A (en) * | 2016-11-02 | 2017-03-22 | 惠州Tcl移动通信有限公司 | Mobile terminal forced restart mode switching method and system |
WO2019084737A1 (en) * | 2017-10-30 | 2019-05-09 | 华为技术有限公司 | Method for updating selinux security policy, and terminal |
CN113672297A (en) * | 2021-07-23 | 2021-11-19 | 荣耀终端有限公司 | Restarting method and terminal in recovery mode upgrading process |
Also Published As
Publication number | Publication date |
---|---|
CN113672297A (en) | 2021-11-19 |
WO2023000777A9 (en) | 2023-06-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023000777A1 (en) | Method for performing restarting during upgrade process of recovery mode, and terminal | |
EP3893118A1 (en) | Recovery from application anomaly | |
KR102148948B1 (en) | Multi tasking method of electronic apparatus and electronic apparatus thereof | |
EP2979177B1 (en) | Method for controlling process of application and computer system | |
CN106713608B (en) | Application function state modification method and device and terminal | |
WO2014161353A1 (en) | Method for starting process of application and computer system | |
CN113645341A (en) | Power key false touch detection method and electronic equipment | |
US20140304720A1 (en) | Method for starting process of application and computer system | |
WO2020037560A1 (en) | Application installation method and terminal | |
CN110865837A (en) | Method and terminal for upgrading system | |
CN107341407A (en) | More Android system implementation method, storage medium and terminals based on terminal | |
WO2022161024A1 (en) | Upgrade prompt method, terminal device, and computer readable storage medium | |
WO2014166307A1 (en) | Method for determining performance of process of application and computer system | |
US9928134B2 (en) | Method and apparatus for repairing dynamic link library file | |
CN115941674B (en) | Multi-device application connection method, device and storage medium | |
CN114896097B (en) | Application program non-response processing method and electronic equipment | |
US20140310711A1 (en) | Method for determining performance of process of application and computer system | |
WO2022021534A1 (en) | Data reading method, storage medium, and mobile terminal | |
CN114138293A (en) | Terminal and method for upgrading portable system of external memory card | |
CN117076089B (en) | Application management method, terminal device and storage medium | |
WO2023124791A1 (en) | Control method for cellular network, and electronic device | |
CN116737258B (en) | Method and related device for unloading application | |
CN117082419B (en) | Speaker control method, system, device, apparatus and storage medium | |
CN115828227B (en) | Method for identifying advertisement popup, electronic equipment and storage medium | |
CN114173315B (en) | Bluetooth reconnection method and terminal equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22844944 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 22844944 Country of ref document: EP Kind code of ref document: A1 |