A startup animation exit method, storage medium and terminal device
By detecting the exit attribute value of the Android device startup animation and using the ctl.stop command, the problem of the startup animation cannot exit normally is solved, and the device startup stability and user experience are improved.
Patent Information
- Application Number
- CN202010304417.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-17
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2040-04-17
AI Technical Summary
When the Android device is started, the startup animation cannot exit normally due to a custom logic vulnerability of the system or manufacturer, resulting in the device being unable to enter the operable interface.
By detecting the exit attribute value of the boot animation, if it is not detected, the preset exit animation instruction ctl.stop is used to achieve the exit of the boot animation.
It avoids the problem of the startup animation not being able to exit normally, improves the user experience, and prevents the device from being used due to lag.
Smart Images

Figure CN113535240B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a startup animation exit method, a storage medium and a terminal device. Background Art
[0002] When an Android device starts up, there will be a boot animation to start the entire system. During this process, due to system reasons or customized logic loopholes of the manufacturer, the system will always be at the boot animation, and thus cannot enter the system's operational interface; in the Android native process, the exit process of the boot animation mainly determines whether the animation needs to exit by detecting the attribute value of the animation exit attribute (service.bootanim.exit), but this operation is synchronized with the animation playback process, so there is a problem. When the boot animation is stuck in a certain process, the value of the service.bootanim.exit attribute cannot be detected, that is, the boot animation falls into an infinite loop, and the boot animation cannot exit normally. Summary of the invention
[0003] In view of the deficiencies in the prior art, the present invention provides a method for exiting a startup animation, a storage medium and a terminal device to solve the problem that the startup animation of Android cannot be exited normally.
[0004] The technical solution adopted by the present invention is as follows:
[0005] A method for exiting a startup animation, comprising:
[0006] When the boot animation needs to be exited, detecting the exit attribute value of the boot animation;
[0007] If the exit attribute value is not detected, the startup animation is exited according to a preset exit animation instruction.
[0008] The method for exiting the boot animation, wherein the preset exit animation instruction is ctl.stop.
[0009] The method for exiting the boot animation, wherein the method for exiting the boot animation further includes:
[0010] If the exit attribute value of the animation is detected, the boot animation is exited.
[0011] The method for exiting the boot animation, wherein if the exit attribute value of the animation is detected, then exiting the boot animation is specifically:
[0012] If the exit attribute value of the animation is detected, the exit attribute value of the animation is set to exit the boot animation.
[0013] The method for exiting the boot animation, wherein the method for exiting the boot animation further includes:
[0014] When the terminal device starts up, detect the running status of the boot animation;
[0015] Determine whether to exit the startup animation according to the running status of the startup animation.
[0016] The method for exiting the boot animation, wherein when the terminal device is started, detecting the running state of the boot animation specifically includes:
[0017] When the terminal device is started, the value of the animation running status attribute is detected;
[0018] If the state of the boot animation corresponding to the value of the animation running state attribute is started, the boot animation is in the running state;
[0019] If the state of the boot animation corresponding to the value of the animation running state attribute is stopped, the boot animation is in the exit state.
[0020] The method for exiting the boot animation, wherein when the terminal device is started, detecting the value of the animation running state attribute specifically includes:
[0021] When the terminal device is started, the preset application cycle function is called;
[0022] The value of the animation running state attribute is obtained in the preset application cycle function.
[0023] The method for exiting the boot animation, wherein determining whether to exit the boot animation according to the running state of the boot animation specifically includes:
[0024] If the state of the boot animation corresponding to the value of the animation running state attribute is started, exit the boot animation;
[0025] If the state of the boot animation corresponding to the value of the animation running state attribute is stopped, it means that the boot animation has been exited, and there is no need to execute the operation of exiting the boot animation.
[0026] The method for exiting the boot animation, wherein if the state of the boot animation corresponding to the value of the animation running state attribute is started, then exiting the boot animation is specifically:
[0027] If the state of the boot animation corresponding to the value of the animation running state attribute is started, then the boot animation is exited, and the ctl.stop command is called to exit the boot animation.
[0028] A computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the method for exiting the boot animation as described in any one of the above.
[0029] A terminal device comprises: a processor and a memory; the memory stores a computer-readable program executable by the processor; when the processor executes the computer-readable program, the steps in the method for exiting the startup animation as described in any one of the above are implemented.
[0030] Beneficial effect: Compared with the prior art, the present invention provides a method, storage medium and terminal device for exiting a boot animation, the method comprising: when the boot animation needs to exit, detecting the exit attribute value of the boot animation; if the exit attribute value is not detected, implementing the exit of the boot animation according to a preset exit animation instruction. The present invention avoids the problem of the boot animation running when the terminal device is started due to a logic loophole customized by the system or the manufacturer. When the value of the animation exit attribute is not detected, the present invention implements the exit of the boot animation through a preset exit animation instruction, thereby avoiding the problem that the boot animation cannot be exited normally and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 The present invention is a flowchart of the method for exiting the startup animation.
[0032] Figure 2 Another flow chart of the method for exiting the startup animation provided by the present invention.
[0033] Figure 3 This is a structural principle diagram of the terminal device provided by the present invention. DETAILED DESCRIPTION
[0034] The present invention provides a method for exiting a startup animation, a storage medium, and a terminal device. To make the purpose, technical solution, and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0035] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0036] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.
[0037] The invention is further described below by describing embodiments in conjunction with the accompanying drawings.
[0038] This embodiment provides a method for exiting the boot animation, such as Figure 1 As shown, the method includes:
[0039] S100: When the startup animation needs to be exited, detecting an exit attribute value of the startup animation.
[0040] Specifically, the present invention is a terminal device based on the Android system. When the terminal device is started, the terminal device will start the boot animation accordingly. However, due to system reasons or manufacturer-customized logic loopholes, the terminal device will always be stuck at the boot animation, so that the terminal device cannot enter the operational interface. Therefore, there may be a situation where the boot animation cannot be exited normally. In order to ensure that users can use it normally, the present invention proposes an optimization solution for exiting the boot animation.
[0041] Furthermore, in the Android native process, the exit of the boot animation is determined by detecting the value of the animation exit attribute in the boot animation to determine whether the boot animation needs to be exited. The animation exit attribute is specifically service.bootanim.exit, that is, by detecting the service.bootanim.exit attribute value to determine whether the animation needs to be exited, the service.bootanim.exit attribute exists in the Android native, and this attribute is 0, indicating that the system has not been started, and the boot animation needs to be played all the time; when this attribute becomes 1, it means that the system has been started and the boot animation can be exited.
[0042] Furthermore, SurfaceFlinger is the Android drawing process. The boot animation of the Android system is started by SurfaceFlinger. When the system is started, it will call back to the bootFinished method of SurfaceFlinger. The bootFinished method is an end animation method in surfaceflinger. The value of the animation exit attribute can be modified in this method. In other words, if the value of service.bootanim.exit in the bootFinished method is 1, it means the animation is exited; if the value of service.bootanim.exit in the bootFinished method is 0, it means the animation is running.
[0043] S200: If the exit attribute value is not detected, exiting the boot animation according to a preset exit animation instruction.
[0044] Specifically, in the Android native process, the exit of the boot animation is determined by detecting the value of the service.bootanim.exit attribute in the boot animation to determine whether the animation needs to exit. However, this operation is synchronized with the animation playback process, so there is a problem. When the boot animation is stuck in a certain process, it is impossible to detect the value of the service.bootanim.exit attribute, which will make the boot animation unable to exit normally. Therefore, when the value of the service.bootanim.exit attribute is not detected, the present invention adds a preset exit animation instruction in the bootFinished method to realize the exit of the boot animation. In this embodiment, the preset exit animation instruction is ctl.stop, and the specific process of the exit animation instruction is property_set("ctl.stop","bootanim"), wherein the boot animation will be started by ctl.start, therefore, the boot animation can be ended by ctl.stop, and the ctl.stop represents stopping a service, therefore, the boot animation can be stopped by this instruction, and the boot animation can be exited, thereby avoiding the freeze caused by the boot animation during its operation on the mobile phone and affecting the user's use.
[0045] Furthermore, in an implementation of this embodiment, the method for exiting the boot animation further includes:
[0046] S300: If the exit attribute value of the animation is detected, then exit the boot animation
[0047] Specifically, if the exit attribute value of the animation is detected, then exiting the boot animation is specifically: if the exit attribute value of the animation is detected, then setting the exit attribute value of the animation to exit the boot animation. That is to say, when the value of the service.bootanim.exit attribute is detected, the present invention exits the boot animation specifically: if the value of the service.bootanim.exit attribute is detected, then the value of the service.bootanim.exit attribute can be set to 1 in the bootFinished method to exit the boot animation.
[0048] In one implementation of this embodiment, Figure 2 As shown, Figure 2 Another flow chart of the method for exiting the boot animation provided by the present invention. The method for exiting the boot animation also includes:
[0049] S10: When the terminal device is started, the running status of the startup animation is detected.
[0050] Specifically, the present invention can also determine whether to exit the boot animation according to the running state of the boot animation. Accordingly, when the terminal device is started, detecting the running state of the boot animation specifically includes:
[0051] S11. When the terminal device is started, the value of the animation running state attribute is detected;
[0052] S12: If the state of the boot animation corresponding to the value of the animation running state attribute is startup, the boot animation is in the running state;
[0053] S13: If the state of the boot animation corresponding to the value of the animation running state attribute is stopped, the boot animation is in an exit state.
[0054] Specifically, the present invention determines the running state of the animation through the value of the init.svc.bootanim attribute. The init.svc.bootanim attribute is used to detect whether the boot animation is still running. In the Android system, each time an application is started, the state of the application's Activity is detected. Therefore, in this embodiment, when the first application is started, it is determined whether the boot animation is running; the state of the application's Activity is detected as follows: the main thread at the bottom of the Android platform detects the state of the application's Activity through the ActivityManager, and when it is detected that the Activity starts to execute the onResume method, the value of the init.svc.bootanim attribute is obtained. If the state of the boot animation corresponding to the value of the animation running state attribute is starting (running), the boot animation is in the running state; if the state of the boot animation corresponding to the value of the animation running state attribute is stopped (stopped), the boot animation is in the exit state.
[0055] Further, in an implementation of this embodiment, when the terminal device is started, detecting the value of the animation running state attribute specifically includes:
[0056] S111, when the terminal device is started, calling a preset application cycle function;
[0057] S112: Obtain the value of the animation running state attribute in the preset application cycle function.
[0058] Specifically, ActivityStack is a class, and the preset application cycle function is a method in this class. In this embodiment, the preset application cycle function is esumeTopActivityInnerLocked. Further, when it is detected that the Activity starts to execute the onResume method, since the resumeTopActivityInnerLockedd method of ActivityStack will be called at this time, we can check the value of the init.svc.bootanim property in this method, and determine whether to exit the boot animation based on the checked value of the init.svc.bootanim property.
[0059] S20: Determine whether to exit the startup animation according to the running status of the startup animation.
[0060] In this embodiment, determining whether to exit the boot animation according to the running state of the boot animation specifically includes:
[0061] S21, if the state of the boot animation corresponding to the value of the animation running state attribute is started, exit the boot animation;
[0062] S22: If the state of the boot animation corresponding to the value of the animation running state attribute is stopped, it means that the boot animation has been exited, and there is no need to execute the operation of exiting the boot animation.
[0063] Specifically, if the state of the boot animation corresponding to the value of the init.svc.bootanim attribute is started (running), it means that the boot animation of the terminal device is still in the running state, and it is necessary to exit the boot animation. The specific process includes: if the state of the boot animation corresponding to the value of the animation running state attribute is started (running), call the ctl.stop command to exit the boot animation. That is to say, if the state of the boot animation corresponding to the value of the init.svc.bootanim attribute is started (running), call ctl.stop to exit the boot animation. Correspondingly, if the state of the boot animation corresponding to the value of the init.svc.bootanim attribute is stopped (stopped), it means that the boot animation has been exited, and there is no need to execute the operation of exiting the boot animation at this time.
[0064] In summary, the present invention provides a method for exiting a boot animation, the method comprising: when the boot animation needs to exit, detecting the exit attribute value of the boot animation; if the exit attribute value is not detected, implementing the exit of the boot animation according to a preset exit animation instruction. The present invention avoids the problem of the boot animation running when the terminal device is started due to a logic loophole customized by the system or the manufacturer. When the value of the animation exit attribute is not detected, the present invention implements the exit of the boot animation through a preset exit animation instruction, thereby avoiding the problem that the boot animation cannot be exited normally and improving the user experience.
[0065] Based on the above-mentioned method for exiting the startup animation, the present invention also provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps in the method for exiting the startup animation described in the above-mentioned embodiment.
[0066] Based on the above-mentioned method for exiting the boot animation, the present invention also provides a terminal device, such as Figure 3 As shown, it includes at least one processor (processor) 20; display screen 21; and memory (memory) 22, and may also include a communications interface (Communications Interface) 23 and a bus 24. Among them, the processor 20, the display screen 21, the memory 22 and the communication interface 23 can communicate with each other through the bus 24. The display screen 21 is configured to display a preset user guide interface in the initial setting mode. The communication interface 23 can transmit information. The processor 20 can call the logic instructions in the memory 22 to execute the method in the above embodiment.
[0067] In addition, the logic instructions in the memory 22 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0068] The memory 22, as a computer-readable storage medium, can be configured to store software programs, computer executable programs, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 30 executes functional applications and data processing by running the software programs, instructions or modules stored in the memory 22, that is, implementing the methods in the above embodiments.
[0069] The memory 22 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 22 may include a high-speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, may also be a transient storage medium.
[0070] In addition, the specific process of loading and executing the multiple instruction processors in the above storage medium and the terminal device has been described in detail in the above method and will not be described here one by one.
[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for exiting a startup animation, characterized in that: It includes: When the boot animation needs to be exited, detecting the exit attribute value of the boot animation; If the exit attribute value is not detected, the boot animation is exited according to a preset exit animation instruction; The exit method of the boot animation also includes: When the terminal device starts up, detect the running status of the boot animation; Determining whether to exit the boot animation according to the running state of the boot animation; When the terminal device is started, detecting the running state of the boot animation specifically includes: When the terminal device is started, the value of the animation running status attribute is detected; If the state of the boot animation corresponding to the value of the animation running state attribute is started, the boot animation is in the running state; If the state of the boot animation corresponding to the value of the animation running state attribute is stopped, the boot animation is in the exit state; The step of determining whether to exit the boot animation according to the running state of the boot animation specifically includes: If the state of the boot animation corresponding to the value of the animation running state attribute is started, exit the boot animation; If the state of the boot animation corresponding to the value of the animation running state attribute is stopped, it means that the boot animation has been exited, and there is no need to execute the operation of exiting the boot animation; If the state of the boot animation corresponding to the value of the animation running state attribute is started, then exiting the boot animation is specifically: If the state of the boot animation corresponding to the value of the animation running state attribute is started, then the boot animation is exited, and the ctl.stop command is called to exit the boot animation; The running state attribute of the animation is init.svc.bootanim, and the animation exit attribute is service.bootanim.exit. If the service.bootanim.exit attribute is 0, the boot animation is in the running state. If the service.bootanim.exit attribute is 1, the boot animation state is stopped. If the value of the service.bootanim.exit property is detected, the value of the service.bootanim.exit property is set to 1 in the end animation method of the drawing process to exit the boot animation.
2. The method for exiting the boot animation according to claim 1, characterized in that: The preset exit animation instruction is ctl.stop.
3. The method for exiting the boot animation according to claim 1, characterized in that: The method for exiting the boot animation also includes: If the exit attribute value of the animation is detected, the boot animation is exited.
4. The method for exiting the boot animation according to claim 3, characterized in that: If the exit attribute value of the animation is detected, then exiting the boot animation is specifically: If the exit attribute value of the animation is detected, the exit attribute value of the animation is set to exit the boot animation.
5. The method for exiting the boot animation according to claim 1, characterized in that: When the terminal device is started, the value of the animation running state attribute is detected, which specifically includes: When the terminal device is started, the preset application cycle function is called; The value of the animation running state attribute is obtained in the preset application cycle function.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the method for exiting the startup animation as described in any one of claims 1 to 5.
7. A terminal device, characterized in that: include: A processor and a memory; the memory stores a computer-readable program that can be executed by the processor; when the processor executes the computer-readable program, the steps in the method for exiting the startup animation as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Process control method, process control device and terminal equipment
CN105824668A
Method, device, storage medium and terminal for detecting abnormal boot-up of terminal
CN109542744A