A restart method and terminal during recovery mode upgrade process
By configuring the forced shutdown button during the Recovery mode upgrade process of Android phones, pressing the power button and volume button at the same time, and using the misc partition flag to determine the mode, the restart problem caused by user error touch is solved, the upgrade success rate is improved and the provision of Exit method in abnormal scenarios.
Patent Information
- Application Number
- CN202110836801.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-23
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2041-07-23
AI Technical Summary
During the Android phone's Recovery mode upgrade process, the user accidentally touches the power button and causes the phone to restart, which may lead to the problem of the upgrade failure and the phone not being able to start.
When detecting user operations under the main system and restarting to the small kernel stage, the forced shutdown button is to hold the power button and the volume button at the same time. By detecting the misc partition flag, determine whether to enter Recovery mode, and output prompt information if necessary Guide the correct way to force shutdown.
Reduces the restart caused by user error during the Recovery mode upgrade process, reduces the probability that the phone cannot be used, and provides a method to directly exit Recovery mode in abnormal scenarios.
Smart Images

Figure CN113672297B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a restart method and a terminal during a recovery mode upgrade process. Background Art
[0002] Recovery mode is an Android phone backup function, which refers to a mode that can modify the data or system inside the Android phone (similar to Windows PE or DOS). In this mode, you can back up or upgrade the existing system, or restore the factory settings.
[0003] Because the power button is required to confirm the selection during the Recovery mode upgrade, the power button is not shielded. When the power button is detected to be 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 the power button is detected to be pressed for a long time and the long press time reaches the restart / shutdown time requirement, the phone will be shut down. Therefore, during the Recovery mode upgrade, there may be an accidental touch that causes the phone to shut down, that is, the phone shuts down due to an accidental long press of the power button. In addition, because the contents 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 is burned. If the phone is forced to restart during the Recovery mode upgrade, since the phone has not completed the upgrade, it will re-enter the upgrade at the next startup, but since the last upgrade was interrupted, a key partition may be damaged, causing the phone to be unable to boot into the main system and recovery mode, making the phone unusable. Summary of the invention
[0004] The embodiments of the present application provide a restart method and terminal during a recovery mode upgrade process, which can reduce restarts caused by user accidental touches during a recovery mode upgrade process, thereby reducing the probability of a mobile phone being unusable.
[0005] The present application is introduced below from different aspects. It should be understood that the implementation methods and beneficial effects of the following different aspects can be referenced to each other.
[0006] On the first aspect, the present application provides a restart method during the recovery mode upgrade process, the method comprising: 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 the restart control); if it is detected that the user performs a preset operation, the terminal calls the restart command under the main system and adds the restart parameter recovery to restart; when the terminal restarts to the lk (little kernel / little operating system (little kernel, referred to as lk)) stage, detects whether to enter the recovery mode; if it is detected that the terminal enters the recovery mode during the restart process, the terminal configures the forced shutdown button to press and hold the power button and the volume button for a preset time at the same time. Among them, the volume button here can be either the volume up button or the volume down button. The preset time here can be 10s or 15s, etc.
[0007] It can be seen that this solution can not only reduce the restart caused by user accidental touch during the recovery mode upgrade process (this is because the probability of users accidentally touching the combination keys at the same time is low), thereby reducing the probability of the phone being unusable, but also solve the problem of not being able to directly exit the recovery mode in abnormal scenarios (such as freezes, mobile phone cannot operate normally, etc.) (this is because this solution still retains the forced restart / shutdown function in recovery mode).
[0008] In combination with the first aspect, in one possible implementation method, the terminal configures the forced shutdown button to press and hold the power button and the volume button at the same time for a preset time, including: the terminal calls the power management integrated circuit (Power Management IC, pmic) to set the register value to 0x01, thereby setting the forced shutdown button to a combination key (such as the power button and the volume up button, or the power button and the volume down button, or the volume up button and the volume down button), that is, the forced restart trigger mode is set to press and hold the combination key at the same time.
[0009] Optionally, before the terminal enters recovery mode, the forced shutdown button is the power button. That is, when the terminal boots to the lk stage, pmic is called to set the register value to 0x00; when the terminal (in the lk stage) determines to enter recovery mode, pmic is called again to set the register value to 0x01 (or change the register value from 0x00 to 0x01).
[0010] It can be seen that this solution changes the correspondence between the forced restart function and the physical button by calling pmic to change the register value, which is helpful to reduce accidental touches and return to the original configuration after exiting the recovery mode.
[0011] 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 that there is a flag bit boot-recovery in the misc partition, the terminal determines to enter the recovery mode during the restart process. If there is no flag bit boot-recovery in the misc partition, it means that the recovery mode has not been entered.
[0012] Because the misc partition is empty during normal startup, the misc partition upgrade information is written only when entering the recovery mode, mainly writing the flag bit boot-recovery. Therefore, this solution can accurately determine whether the terminal has entered the recovery mode by detecting whether the flag bit boot-recovery exists in the misc partition.
[0013] In combination with the first aspect, in a possible implementation, the method further includes: after the terminal enters the recovery mode, the terminal monitors the physical buttons of the terminal through a thread, and the physical buttons include one or more of the power button, the volume up button, and the volume down button; when the power button is detected to be long pressed, the terminal monitors whether the volume button is long pressed at the same time; when the power button is detected to be long pressed and the volume button is not long pressed at the same time, the terminal monitors whether the long press time of the power button exceeds the above preset time; if the long press time of the power button exceeds the preset time, the terminal outputs a first prompt message, and the first prompt message is used to prompt the risk of forced restart and the correct forced shutdown method. The terminal may output the first prompt message in the form of voice, text, ringing, vibration, etc.
[0014] Optionally, the terminal outputs the first prompt information, including: the terminal calls a display interface to display the first prompt information at a preset position on the terminal screen (such as an original upgrade interface), and the input parameters of the display interface include the first prompt information and the preset position. The preset position is the displayed position coordinates.
[0015] It can be seen that this solution outputs corresponding prompt information after long pressing the power button for more than the preset time, prompting the risk of forced restart and the correct way to force shutdown. On the one hand, it is conducive to timely discovery and risk prompting in accidental touch scenarios, and on the other hand, it is conducive to users to force shutdown in abnormal scenarios (such as freezes, mobile phones cannot operate normally, etc.).
[0016] In combination with the first aspect, in a possible implementation, the method further includes: if it is detected that the power button and the volume button are long pressed at the same time, the terminal monitors whether the long pressing time at the same time exceeds the above preset time; if the long pressing time at the same time does not exceed the preset time, the terminal outputs a second prompt information, and the second indication information is used to prompt the risk of forced restart. The terminal may output the second prompt information in a voice, text, ringing, vibration, or other manner.
[0017] Optionally, the terminal outputs the second prompt information, including: the terminal calls a 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 the preset position. The preset position is the displayed position coordinates.
[0018] It can be seen that this solution outputs corresponding prompt information when the power button and the volume button are long pressed at the same time, and the long pressing time does not exceed the preset time, prompting the risk of forced restart, so as to inform the user again of the dangers of forced restart and reduce the user from making wrong judgments without knowing it.
[0019] In combination with 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.
[0020] It can be seen that after exiting the recovery mode, this solution restores the forced shutdown button to the original long-press power button, which is convenient for supporting the functions and user operations of the terminal in normal mode.
[0021] In the second aspect, an embodiment of the present application provides a terminal, which includes a unit and / or module for executing the restart method in the recovery mode upgrade process provided by the above-mentioned first aspect and / or any possible implementation method of the first aspect, thereby also being able to achieve the beneficial effects (or advantages) of the restart method in the recovery mode upgrade process provided by the first aspect.
[0022] In a third aspect, the present application provides a terminal comprising a processor and a memory, wherein the memory is used to store a computer program, the computer program comprising program instructions, and when the processor runs the program instructions, the terminal executes the restart method in the recovery mode upgrade process provided in the first aspect above.
[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing computer program instructions for a first electronic device, which includes instructions for executing the program involved in the above-mentioned first aspect.
[0024] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the restart method in the recovery mode upgrade process described in the first aspect above.
[0025] By implementing the embodiments of the present application, it is possible to reduce restarts caused by accidental user touches during the recovery mode upgrade process, thereby reducing the probability of the mobile phone becoming unusable. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for describing the embodiments are briefly introduced below.
[0027] Figure 1 This is a diagram of the interface changes when you long press the power button during the Recovery mode upgrade process;
[0028] Figure 2A is a schematic diagram of the structure of a terminal provided in an embodiment of the present application;
[0029] Figure 2B is another structural schematic diagram of a terminal provided in an embodiment of the present application;
[0030] Figure 3 is a software structure block diagram of the terminal provided in the embodiment of the present application;
[0031] Figure 4 It is a flowchart of a restart method in a recovery mode upgrade process provided in an embodiment of the present application;
[0032] Figure 5 It is a schematic diagram of the recovery main interface and the eRecovery main interface provided in the embodiment of the present application;
[0033] Fig. 6A is a schematic diagram of a first prompt interface provided in an embodiment of the present application;
[0034] Figure 6B is another schematic diagram of the first prompt interface provided in an embodiment of the present application;
[0035] Figure 7 This is a schematic diagram of the interface changes when the power button and the volume button are long pressed simultaneously, as provided in an embodiment of the present application;
[0036] Figure 8 This is another flowchart of the restart method in the recovery mode upgrade process provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] 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.
[0038] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c; a and b; a and c; b and c; or a and b and c. Among them, a, b, c can be single or multiple.
[0039] In the description of the present application, words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the differences.
[0040] It should be understood that in the present application, "when", "if" and "if" all mean that the device will take corresponding actions under certain objective circumstances, and do not limit the time, nor do they require that the device must have a judgment action when it is implemented, nor do they mean that there are other limitations.
[0041] The term “simultaneously” in the present application may be understood as at the same time point, within a period of time, or within the same cycle, and may be understood in conjunction with the context.
[0042] Elements used in the singular herein are intended to mean "one or more" rather than "one and only one" unless specifically stated otherwise.
[0043] 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 can also be determined according to A and / or other information.
[0044] Currently, during the Recovery mode upgrade process, if the power button is detected to be pressed for a long time but the long press time has not reached the restart / shutdown time requirement (10s), a text prompt will be displayed. Figure 1 , Figure 1 This is a schematic diagram of the interface changes when you long press the power button during the Recovery mode upgrade process. Figure 1As shown, if the user long presses the power button during the Recovery mode upgrade process, and the long press time does not exceed 10 seconds, the terminal will output a text prompt on the upgrade interface, such as "Warning: The power button is detected to be long pressed, please release the power button immediately to avoid device abnormalities." When the user continues to long press the power button until the long press time exceeds 10 seconds, the terminal will force a shutdown. Therefore, during the Recovery mode upgrade process, if the user accidentally touches the power button, that is, accidentally long presses the power button for a period of time, the phone will shut down. During the Recovery mode upgrade process, the partition content will be overwritten, erased, and other operations will be performed. If the phone is forced to shut down before the upgrade is completed, a key partition may be damaged, resulting in the inability to boot the phone into the main system and recovery mode, making the phone unusable.
[0045] Therefore, an 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 to long press the power button and the volume button for a period of time. This can not only reduce the restarts caused by accidental touches by users during the recovery mode upgrade process, thereby reducing the probability of the mobile phone being unusable, but also solve the problem of not being able to directly exit the recovery mode in abnormal scenarios (such as freezing, the mobile phone cannot operate normally, etc.).
[0046] For ease of understanding, the structure of the terminal provided in the embodiments of the present application is described below by way of example.
[0047] See also Figure 2A , Figure 2A It is a structural diagram of a terminal provided in an embodiment of the present application. Figure 2A The terminal shown can be a mobile phone. Figure 2A As shown, the terminal 100 may include a processor 111, a memory 112, a button 113, and a display screen 114. The processor 111, the memory 112, the button 113, and the display screen 114 may be connected via a bus. It is 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 certain components, or split certain components, or arrange different components, which may be determined according to the actual application scenario and is not limited here. Figure 2A The components shown may be implemented in hardware, software, or a combination of software and hardware.
[0048] The processor 111 may include one or more processing units, for example, the processor 111 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated in one or more processors.
[0049] The controller may be the nerve center and command center of the terminal 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0050] The processor 111 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 111 is a cache memory. The memory may store instructions or data that the processor 111 has just used or cyclically used. If the processor 111 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 111, and thus improves the efficiency of the system.
[0051] The memory 112 is coupled to the processor 111 and is used to store various software programs and / or multiple sets of instructions. The memory 112 can be used to store computer executable program codes, which include instructions. The processor 111 executes various functional applications and data processing of the terminal 100 by running the instructions stored in the memory 112. The memory 112 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal 100 (such as audio data, image data to be displayed, etc.), etc. 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 disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0052] The button 113 includes a power button (or a power button / power off button), a volume button, etc. The volume button specifically includes a volume up (+) button and a volume down (-) button. The power button (or a power button / power off button) is used to turn on / off / restart the terminal 100. The button 113 can be a mechanical button or a touch button. The terminal of the embodiment of the present application adopts a mechanical button.
[0053] The display screen 114 can be used to display images, videos, interfaces, etc. In the embodiment of the present application, the display screen 114 is used to display various interfaces of the system output of the terminal 100. For details, please refer to the relevant description of the 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 (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc.
[0054] In some embodiments, see Figure 2B , Figure 2B This is another structural diagram of the terminal provided in an embodiment of the present application. Figure 2B The terminal shown can be a mobile phone. Figure 2B As shown, the terminal 100 includes not only a processor 111, a memory 112, a key 113, and a display screen 114, but also other components. Figure 2B Other components included in the terminal 100 are briefly introduced.
[0055] Among them, the terminal 100 may also include a battery, a charging management module, and a power management module. The battery can be used to provide power for the terminal 100. The charging management module is used to receive charging input from the charger. Among them, the charger can be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module can receive charging input from the wired charger through a USB interface. In some embodiments of wireless charging, the charging management module can receive wireless charging input through the wireless charging coil of the terminal 100. While the charging management module charges the battery, it can also power the electronic device through the power management module. The power management module is used to connect the battery, the charging management module and the processor 111. The power management module receives input from the battery and / or the charging management module, and powers the processor 111, the memory 112, the button 113 and the display screen 114. The power management module can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module can also be set 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.
[0056] In some embodiments, the terminal 100 may also include components for implementing wireless communication functions. Exemplarily, the terminal 100 also includes antenna 1, antenna 2, a mobile communication module, a wireless communication module, a modem processor, and a baseband processor.
[0057] 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 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other feasible implementations, the antenna can be used in combination with a tuning switch.
[0058] The mobile communication module can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied on the terminal 100. The mobile communication module may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some feasible embodiments, at least some of the functional modules of the mobile communication module 150 may be arranged in the processor 111. In some feasible embodiments, at least some of the functional modules of the mobile communication module may be arranged in the same device as at least some of the modules of the processor 111.
[0059] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker, a receiver, etc.), or displays an image or video through a display screen 114. In some feasible embodiments, the modem processor may be an independent device. In other feasible embodiments, the modem processor may be independent of the processor 111 and be set in the same device as the mobile communication module or other functional modules.
[0060] The wireless communication module can provide wireless communication solutions including wireless local area networks (WLAN) such as Wi-Fi networks, Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) and the like applied on the terminal 100. The wireless communication module can be one or more devices integrating at least one communication processing module. The wireless communication module receives electromagnetic waves via antenna 2, modulates and filters the electromagnetic wave signals, and sends the processed signals to processor 111. The wireless communication module can also receive the signal to be sent from processor 111, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through antenna 2.
[0061] 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 signals transmitted 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 find the terminal 100, and 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 solutions including one or more Bluetooth communications in classic Bluetooth (BR / EDR) or Bluetooth low energy (Bluetooth low energy, BLE). The WLAN communication processing module may 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 receiver receiving the infrared signal and the location where the infrared signal is received.
[0062] In some embodiments, antenna 1 of terminal 100 is coupled to a mobile communication module, and antenna 2 is coupled to a wireless communication module, so that terminal 100 can communicate with a network and other devices through wireless communication technology.
[0063] In some embodiments, the terminal 100 may also include an audio module, a speaker, a receiver, a microphone, an earphone interface, and an application processor, etc., for implementing audio functions, such as music playback, recording, etc.
[0064] 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 signals. The speaker, also known as the "horn", is 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. The microphone, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack is used to connect wired headphones. The headphone jack can be a USB interface, or it can be a 3.5mm open mobile terminal platform (OMTP) standard interface, or the cellular telecommunications industry association of the USA (CTIA) standard interface.
[0065] In some embodiments, the terminal 100 may also include an indicator, a subscriber identification module (SIM) card interface, and a sensor module. Among them, the indicator can be an indicator light, which can be used to indicate the charging status, power changes, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface is used to connect the SIM card. The SIM card can be inserted into the SIM card interface or pulled out from the SIM card interface to achieve contact and separation with the terminal 100. In some feasible implementations, the terminal 100 uses 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 the sensing function.
[0066] The software system of the terminal 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the terminal 100.
[0067] See also Figure 3 , Figure 3 It is a software structure block diagram of the terminal provided in the embodiment of the present application.
[0068] like Figure 3 As shown, the layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some feasible implementations, the Android system can be divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer.
[0069] The application layer can include a series of application packages.
[0070] like Figure 3 As shown, the application package may include Bluetooth, device management application (application with device management function), WLAN, short message, gallery, calendar, call and other application (application, APP).
[0071] The application framework layer provides application programming interface and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0072] like Figure 3 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0073] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0074] Content providers are used to store and retrieve data and make it accessible to applications. The above data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0075] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0076] The phone manager is used to provide communication functions of the terminal 100, such as management of call status (including connection, disconnection, etc.).
[0077] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0078] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications from applications running in the background, or a notification that appears on the screen in the form of a dialogue interface. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0079] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0080] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0081] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application 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.
[0082] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0083] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0084] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static 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.
[0085] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0086] A 2D graphics engine is a drawing engine for 2D drawings.
[0087] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0088] The above content briefly introduces the software and hardware structure of the terminal in the embodiment of the present application. The technical solution provided by the present application will be described in detail in conjunction with more drawings below.
[0089] An embodiment of the present application provides a restart method during a recovery mode upgrade process. By changing the correspondence between the forced restart function and the physical button during the recovery mode upgrade process, the restart caused by the user's accidental touch during the recovery mode upgrade process is reduced, thereby reducing the possibility 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.
[0090] Before introducing the technical solution of the present application, the recovery partition and 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 an ON / OFF switch. These settings may include CID (Carrier or Region ID), USB configuration, and settings for certain hardware. The misc partition is an important partition. If it is damaged or lost, the functions of some devices will not work properly.
[0091] See also Figure 4 , Figure 4It is a flowchart of the restart method in the recovery mode upgrade process provided in an embodiment of the present application. Figure 4 The internal data processing process of the terminal is shown. Figure 4 As shown, the restart method in the recovery mode upgrade process provided in the embodiment of the present application includes but is not limited to the following steps:
[0092] S1, if it is detected that the terminal enters the recovery mode, the terminal sets the forced restart trigger mode of the terminal to long press the power button and the volume button at the same time.
[0093] Optionally, the terminal in the 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 one example, the terminal can detect whether the system version is updated under the main system. 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 responds to the user's click operation, calls the restart command, and adds the restart parameter recovery. This restart command will write the flag boot-recovery in the misc partition, and then the terminal will restart, and the terminal will enter the recovery mode at this time. In short, the terminal downloads the upgrade package under the main system, and when the upgrade package needs to be upgraded after downloading, the restart command is called, and the restart parameter recovery is added, and the flag boot-recovery is written in the misc partition, and then the terminal is restarted to enter the recovery mode for HOTA upgrade. In another example, after the terminal is turned off, it still reads the terminal's physical buttons (such as the volume button and the power button) and whether the charger / PC-USB is connected. When the terminal detects that the volume up (+) / down (-) button and the power button are pressed and the charger / PC-USB is connected, the terminal restarts and displays the recovery main interface or the eRecovery main interface. At this time, the terminal enters the recovery mode. See Figure 5 , Figure 5 Schematic diagram of the recovery main interface and the eRecovery main interface provided by the embodiment of the present application. Figure 5 As shown, the terminal needs to use the volume key 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 Figure 5 The power button and volume button are shown to be located on the same side. In actual implementation, the power button and volume button may be located on different sides of the terminal, which is not limited in the embodiments of the present application.
[0094] It can be seen that in recovery mode, in addition to HOTA upgrade, the power button is also used in the recovery main interface, eRecovery upgrade and other interfaces. 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 freezing and the phone cannot operate normally, the method of forcing a restart by pressing the button must also be retained.
[0095] Therefore, the terminal in the embodiment of the present application will detect whether there is a flag bit, 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 misc partition upgrade information is written only when entering the recovery mode, mainly writing the flag bit boot-recovery. When it is detected that the terminal enters the recovery mode, the terminal can set the forced restart trigger mode of the terminal to long press the power button and the volume button at the same time.
[0096] It should be understood that the startup process of the terminal includes: first power on, then the CPU starts the preloader (preloader), the preloader is used to start the little kernel / little operating system (little kernel, referred to as lk), lk is mainly responsible for mode selection, loads the corresponding content according to the selected mode, and then starts the corresponding service through the initialization function (init) of the virtual memory disk (ramdisk). Among them, when the terminal boots to the lk stage, the key function will be initialized according to the configuration file. Taking multi-tone keying (MTK) as an example, when the terminal boots to the lk stage, the long press restart function setting (such as long_press_reboot_function_setting) function is called to set the forced restart method. If the restart-related macro configured in the configuration file is a 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 (such as: PMIC_RG_PWRKEY_KEY_MODE, 0x00), thereby setting the power key to the forced restart key, that is, setting the forced restart trigger mode to long press the power key. If the restart-related macro configured in the configuration file is a 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 to a combination key, that is, setting the forced restart trigger mode to long press the combination key at the same time. It should also be understood that the terminal will initialize the key function according to the configuration file during each startup process.
[0097] The terminal of 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 as to set the combination key (such as the power button and the volume up button, or the power button and the volume down button) to the forced restart key, that is, the forced restart trigger mode is set to long press the power button and the volume button at the same time. Among them, before the terminal of the embodiment of the present application enters the recovery mode, the forced restart key is the power button. That is to say, when the terminal boots to the lk stage, it will call pmic to set the register value to 0x00; when the terminal (in the lk stage) determines that it has entered the recovery mode, it calls pmic again to set the register value to 0x01 (or changes the register value from 0x00 to 0x01).
[0098] S2: If the terminal detects that the power button is long pressed after entering the recovery mode, the terminal displays a first prompt interface, which includes a text prompt for prompting the risk of forced restart and the correct way to trigger forced restart.
[0099] Optionally, after entering the recovery mode, the terminal can monitor the physical buttons of the terminal (such as the power button and the volume button) by / adopting / starting a thread. If the terminal detects that the power button is long pressed after entering the recovery mode, the terminal monitors whether the volume button (here refers to the volume up button or the volume down button) is long pressed at the same time; if the terminal detects that the volume button is not long pressed at the same time, the display interface is called to display the first prompt interface. The input parameters of the display interface include the displayed content (such as text, images, etc.) and the displayed location coordinates. Among them, the first prompt interface includes text prompts to prompt the risks of forced restart and the correct way to trigger forced restart. The first prompt interface can be a brand new interface, or it can be a corresponding text prompt added to the original upgrade interface. Exemplarily, the text prompt on the first prompt interface can be "Upgrading, please do not long press the power button. During the upgrade process, forced restart will cause device abnormalities. If forced shutdown is required, please long press the power button and the volume up / down button at the same time."
[0100] Optionally, if the terminal detects that the power button is long pressed 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 called to display the first prompt interface, saving power consumption.
[0101] For example, see Fig. 6A , Fig. 6A is a schematic diagram of the first prompt interface provided in the embodiment of the present application. Fig. 6A As shown, after the terminal enters the recovery mode, the user presses the power button for more than 10 seconds, and the terminal calls the display interface to display the first prompt interface 601. The first prompt interface 601 is a brand new interface, and its text prompt can be located in the middle of the interface, and is highlighted by bold, different color fonts, etc.; optionally, a return control 602 can also be set on the first prompt interface 601 to return to the original upgrade interface (that is, the original HOTA upgrade interface). Figure 6B , Figure 6B is another schematic diagram of the first prompt interface provided in the embodiment of the present application. Figure 6B As shown, Figure 6BAs shown, after the terminal enters the recovery mode, the user presses the power button for more than 10 seconds, and the terminal calls the display interface to display the first prompt interface 601. The first prompt interface 601 is to add a corresponding text prompt on the original HOTA upgrade interface, and the text prompt can be located at the top of the original HOTA upgrade interface, and can also be highlighted by bolding, using different color fonts, etc.
[0102] S3: If the terminal detects that the power button and the volume button are pressed for a long time at the same time after entering the recovery mode and the long pressing time does not exceed the second time threshold, the terminal displays a second prompt interface, which includes a text prompt for prompting the risk of forced restart.
[0103] Optionally, because the terminal monitors the physical buttons of the terminal (such as the power button and the volume button) through / adopting / starting a thread after entering the recovery mode, if the terminal detects that the power button and the volume up / down button are pressed for a long time at the same time after entering the recovery mode, and the long press 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 the displayed content (such as text, images, etc.) and the displayed location coordinates. Among them, the second prompt interface includes a text prompt for prompting the risk of forced restart. The second prompt interface can be either a brand new interface or a corresponding text prompt added to the original upgrade interface. Among them, the second time threshold can be 10s, 15s, etc. It should be understood that the second prompt interface is similar to the above-mentioned first prompt interface, the difference is that the input parameters of the display interface are different. Exemplarily, the text prompt on the second prompt interface can be "Upgrading, long pressing the power button and the volume up / down button at the same time will force shutdown, causing device abnormality".
[0104] Optionally, when the terminal detects that the power button and the volume button are long pressed at the same time, a timer can be started. When the time of this timer exceeds the third time threshold but does not exceed the second time threshold, the terminal can call the display interface to display the second prompt interface. This can reduce the complexity and power consumption of the terminal. Among them, the third time threshold is less than the second time threshold, for example, the third time threshold is 3 seconds, and the second time threshold is 10 seconds.
[0105] S4: If the terminal detects that the power button and the volume button are pressed for a long time for a period exceeding the second time threshold after entering the recovery mode, the terminal is forced to shut down.
[0106] Optionally, because the terminal monitors the physical buttons (such as the power button and the volume button) of the terminal through / adopting / starting a thread after entering the recovery mode, if the terminal detects that the power button and the volume up / down button are pressed for a long time at the same time after entering the recovery mode, and the time of the long press exceeds the above second time threshold, the terminal is forced to shut down. It should be understood that the terminal forced shutdown here can be understood as exiting the recovery mode. For example, see Figure 7 , Figure 7 Schematic diagram of the interface changes when the power button and volume button are pressed and held simultaneously according to an embodiment of the present application. Figure 7 As shown, 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 calls the display interface to display the 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 is highlighted by bold, different color fonts, etc.; Optionally, a return control 702 can also be set on the second prompt interface 701 to return to the original upgrade interface (i.e., the original HOTA upgrade interface). The second prompt interface 701 can also be to add corresponding text prompts to the original HOTA upgrade interface, and the text prompts can be located at the top of the original HOTA upgrade interface, and can also be highlighted by bold, different color fonts, etc. If the user continues to press the power button and the volume up button at the same time until the long press time exceeds 10 seconds, the terminal is forced to shut down.
[0107] Optionally, if the terminal detects that the power button and the volume up / down button are pressed and held simultaneously 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 shut down the device. When the user selects "Yes", the terminal is forced to shut down and exits the recovery mode; when the user selects "No", the terminal continues to upgrade and does not exit the recovery mode.
[0108] Optionally, after the terminal exits recovery mode, during the restart process or after the restart, the terminal's forced restart trigger mode will be set to long press the power button, that is, the terminal will re-read the configuration file to configure the button. In other words, after the terminal enters recovery mode, the terminal's forced restart trigger mode will be changed from long press the power button to long press the power button and volume button at the same time; when the terminal exits recovery mode and restarts, the terminal's original forced restart trigger mode will be restored, that is, long press the power button to force restart.
[0109] It can be seen that after the terminal enters the recovery mode, the embodiment of the present application changes the correspondence between the forced restart function and the physical buttons, and displays the corresponding content according to the combination of different buttons detected and the length of time they are pressed, so as to remind the user of the risks / harms of forced restart during the recovery mode upgrade process, as well as the correct forced restart method. This can not only reduce the restarts caused by accidental touches by users during the recovery mode upgrade process, thereby reducing the possibility of the mobile phone being unusable, but also solve the problem of not being able to directly exit the recovery mode in abnormal scenarios.
[0110] In order to better understand the technical solution provided by the embodiment of the present application, a brief explanation is given below through an example.
[0111] For an example, see Figure 8 , Figure 8 is another flowchart of the restart method in the recovery mode upgrade process provided by the embodiment of the present application. Figure 8 "Y" means "yes" and "N" means "no". Figure 8 As shown, the restart method in the recovery mode upgrade process provided in the embodiment of the present application includes but is not limited to the following steps:
[0112] S801, the main system searches for packages and downloads them.
[0113] Optionally, the terminal can detect whether the system version is updated in the main system. If there is an update, the system version update package (such as an upgrade package or a system package) can be searched and downloaded in the main system. After the download is completed, if a preset operation of the user for the terminal (such as a restart operation) is detected, step S802 is executed.
[0114] S802, restart.
[0115] Optionally, call the reboot command and add the reboot parameter recovery. This reboot command will write the flag boot-recovery to the misc partition, and then the terminal will reboot in the main system.
[0116] S803: Determine whether to enter recovery mode.
[0117] Optionally, the terminal determines whether to enter recovery mode during the restart process (for example, the lk stage of the restart, the lk stage will detect whether to restart to the main system or recovery mode). The judgment method can refer to the above Figure 4The corresponding description in step S1 is to detect whether there is a flag bit boot-recovery in the misc partition. If there is, it means that the terminal enters the recovery mode. If it is determined that the terminal enters the recovery mode, step S804 is executed.
[0118] S804, by configuring pinmux, configure the forced shutdown button to press and hold the power button and the volume up button simultaneously for a preset time.
[0119] Optionally, the terminal configures the forced shutdown button to press and hold the power button and volume up button for a preset time (such as 10s or 15s, etc.) by configuring pinmux (pin multiplexing). For specific configuration methods, please refer to the above Figure 4 The corresponding description in step S1 will not be repeated here.
[0120] S805, start upgrading.
[0121] Optionally, after the terminal configuration is complete, start the upgrade in recovery mode.
[0122] S806, during the upgrade process, determine whether the power button is long pressed.
[0123] Optionally, the terminal monitors the physical buttons of the terminal through a thread during the upgrade process to determine whether the power button is long pressed, and if so, execute step S807. If not, wait for the upgrade to complete and automatically restart, and during the restart process, the forced shutdown button will be configured as the original long press power button.
[0124] S807, determine whether the volume up button is pressed and held at the same time.
[0125] Optionally, the terminal determines whether the volume up button is long pressed at the same time, and if so, executes step S810; if not, executes step S808.
[0126] S808, determining whether the power button is pressed for a long time exceeding a preset time.
[0127] Optionally, the terminal determines whether the long press time of the power button exceeds a preset time (such as 10s or 15s, etc.). If so, execute step S809; if not, wait for the upgrade to be completed and then restart automatically. During the restart process, the forced shutdown button will be configured to the original long press power button.
[0128] S809, output prompt 1.
[0129] Optionally, the terminal outputs a first prompt message to prompt the risk of forced restart and the correct forced shutdown method. For example, the first prompt message is "Upgrading, please do not press and hold the power button. During the upgrade process, forced restart will cause device abnormalities. If forced shutdown is required, please press and hold the power button and the volume up button at the same time." Specifically, the implementation method of the above steps S806-S809 can refer to the aforementioned Figure 4 The implementation method of step S2 is not repeated here.
[0130] S810, determining whether the simultaneous long press exceeds a preset time.
[0131] Optionally, the terminal determines whether the time for long pressing the power button and the volume up button at the same time exceeds a preset time, and if so, executes step S812, and if not, executes step S811.
[0132] S811, output prompt 2.
[0133] Optionally, the terminal outputs a second prompt message to indicate 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 device abnormality." Specifically, the implementation method of step S811 can refer to the aforementioned Figure 4 The implementation method of step S3 is not repeated here.
[0134] S812, forced shutdown.
[0135] Optionally, the terminal is forced to shut down. Specifically, the implementation of step S812 can refer to the aforementioned Figure 4 The implementation method of step S4 is not repeated here.
[0136] The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.
[0137] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can 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 a computer, the process or function described in this application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk), etc.
[0138] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation methods of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the scope of protection of the present application.
Claims
1. A restart method in the recovery mode upgrade process, characterized in that: include: The terminal searches for and downloads a system version update package under the main system. After the terminal has downloaded 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 calls a restart command in the main system and adds a restart parameter recovery to restart; When the terminal restarts to the small kernel lk stage, the power management integrated circuit pmic is called to set the value of the register to 0x00, so as to set the forced restart trigger mode to long press the power button; the terminal detects whether there is a flag bit boot-recovery in the misc partition in the small kernel lk stage; If the terminal detects that there is a flag bit boot-recovery in the misc partition, the terminal determines to enter the recovery mode during the restart process; When the terminal determines to enter the recovery mode in the small kernel lk stage, pmic is called again to change the register value from 0x00 to 0x01, so as to set the forced restart trigger mode to long press the power button and the volume button at the same time; when it is detected that the power button is long pressed for more than a preset time, the terminal outputs a first prompt message, the first prompt message is used to prompt the risk of forced restart and the correct forced shutdown method, and when it is detected that the power button and the volume button are long pressed for more than a preset time, the terminal is forced to shut down; After the terminal exits the recovery mode, the terminal re-reads the configuration file and calls pmic to change the register value from 0x01 to 0x00 to set the forced restart trigger mode to long press the power button; if it is detected that the power button is long pressed for more than the preset time, the terminal is forced to shut down.
2. The method according to claim 1, characterized in that: The method further comprises: After the terminal enters the recovery mode, the terminal monitors physical buttons of the terminal through a thread, where the physical buttons include one or more of a power button, a volume up button, and a volume down button; If a long press of the power button is detected, the terminal detects whether a volume button 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 long pressing time of the power button exceeds the preset time; If the power button is long pressed for longer than the preset time, the terminal outputs a first prompt message, where the first prompt message is used to prompt the risk of forced restart and the correct forced shutdown method.
3. The method according to claim 2, characterized in that The method further comprises: If a long press of the power button and a long press of the volume button are detected, the terminal monitors whether the time of the simultaneous long presses exceeds the preset time; If the long pressing time does not exceed the preset time, the terminal outputs a second prompt message, where the second prompt message is used to prompt the risk of forced restart.
4. The method according to claim 3, characterized in that The method further comprises: If the long pressing time exceeds the preset time, the terminal is forced to shut down.
5. The method according to any one of claims 1 to 4, characterized in that The terminal outputs first prompt information, including: The terminal calls a display interface to display the first prompt information at a preset position on the terminal screen, and input parameters of the display interface include the first prompt information and the preset position.
6. The method according to claim 3 or 4, characterized in that: The terminal outputs the second prompt information, including: The terminal calls a display interface to display the second prompt information at a preset position on the terminal screen, and input parameters of the display interface include the second prompt information and the preset position.
7. A terminal, characterized in that: The terminal comprises a processor and a memory, wherein the memory is used to store a computer program, and the computer program comprises program instructions. When the processor runs the program instructions, the terminal executes the method according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 6.