Display method, terminal device, and computer-readable storage medium
Embodiments of this application provide a display method, a terminal device, and a computer-readable storage medium. The method is applied to the terminal device that includes an outer display screen and an inner display screen. The method includes: obtaining identification information of a first process when the unfolding event is identified, where the first process is a process that is in the terminal device and that is related to display of the inner display screen; adjusting the first process from a first priority to a second priority based on the identification information of the first process, where the second priority is higher than the first priority; scheduling, based on the second priority, the first process for running; and lighting up the inner display screen and displaying an interface on the inner display screen after running of the first process is completed.
1 . A display method, applied to a terminal device, wherein the terminal device comprises an outer display screen and an inner display screen, a status of the terminal device comprises a folded state and an unfolded state, and the method comprises:
identifying, by the terminal device, an unfolding event when the terminal device is in the folded state and the outer display screen is off, wherein the unfolding event is used to indicate the terminal device to switch from the folded state to the unfolded state;
obtaining, by the terminal device when identifying the unfolding event, identification information of a first process, wherein the first process is a process that is in the terminal device and that is related to display of the inner display screen;
adjusting, by the terminal device, a scheduling priority of the first process from a first priority to a second priority based on the identification information of the first process, wherein the second priority is higher than the first priority, and wherein the scheduling priority determines an order in which a processor of the terminal device schedules processes for execution;
scheduling, by the terminal device based on the second priority, the first process for running; and
lighting up, by the terminal device after running of the first process is completed, the inner display screen, and displaying an interface on the inner display screen.
2 . The method according to claim 1 , wherein the obtaining, by the terminal device when identifying the unfolding event, identification information of a first process comprises:
obtaining, by the terminal device, the identification information of the first process when invoking the first process.
3 . The method according to claim 1 , wherein the obtaining, by the terminal device when identifying the unfolding event, identification information of a first process comprises:
reading, by the terminal device when identifying the unfolding event, the identification information of the first process from a local cache;
before the identifying, by the terminal device, an unfolding event when the terminal device is in a screen-off folded state, the method further comprises:
writing, by the terminal device, the identification information of the first process into a database when the first process is started; and
storing, by the terminal device, the identification information of the first process in the local cache when the terminal device detects that the identification information of the first process is written into the database.
4 . The method according to claim 1 , wherein the first process comprises a system interface process, and the system interface process is used to draw the interface.
5 . The method according to claim 4 , wherein the first process is the system interface process; and
the adjusting, by the terminal device, the first process from the second priority to the first priority comprises:
adjusting, by the terminal device, the first process from the second priority to the first priority when the first process completes drawing of the interface.
6 . The method according to claim 1 , wherein after running of the first process is completed, the method further comprises:
adjusting, by the terminal device, the first process from the second priority to the first priority.
7 . The method according to claim 1 wherein the method further comprises:
adjusting the first process from the second priority to the first priority upon expiration of a preset time interval after the first process is adjusted from the first priority to the second priority.
8 . The method according to claim 1 , wherein the method further comprises:
adjusting, by the terminal device, the first process from the second priority to the first priority when the inner display screen is lighted up.
9 . The method according to claim 1 , wherein a processor CPU of the terminal device comprises a plurality of cores, and the method further comprises:
adjusting, by the terminal device, the first process from a first CPU core to a second CPU core, wherein a computing capability of the second CPU core is greater than a computing capability of the first CPU core.
10 . The method according to claim 1 , wherein the method further comprises:
invoking, by the first process, a second process after the first process is adjusted from the first priority to the second priority; and
adjusting, by the terminal device, the second process from a third priority to the second priority, wherein the second process is a process invoked in response to the first process; and
adjusting, by the terminal device, a third process from a fourth priority to the second priority, wherein the third process has a dependency relationship with the first process; and
deleting, by the terminal device, a lock in a fourth process, wherein the fourth process is the first process, and/or a process that uses a same lock as the first process.
11 . A terminal device, wherein the terminal device comprises a processor and a memory, and
the memory stores computer-executable instructions; and
the processor executes the computer-executable instructions stored in the memory, and when the terminal device executes the computer instructions, the terminal device performs the following operations:
identifying, by the terminal device, an unfolding event when the terminal device is in a folded state and an outer display screen of the terminal device is off, wherein the unfolding event is used to indicate the terminal device to switch from the folded state to an unfolded state;
obtaining, by the terminal device when identifying the unfolding event, identification information of a first process, wherein the first process is a process that is in the terminal device and that is related to display of an inner display screen of the terminal device;
adjusting, by the terminal device, a scheduling priority of the first process from a first priority to a second priority based on the identification information of the first process, wherein the second priority is higher than the first priority, and wherein the scheduling priority determines an order in which a processor of the terminal device schedules processes for execution;
scheduling, by the terminal device based on the second priority, the first process for running; and
lighting up, by the terminal device after running of the first process is completed, the inner display screen, and displaying an interface on the inner display screen.
12 . The terminal device according to claim 11 , wherein the obtaining, by the terminal device when identifying the unfolding event, identification information of a first process, and when the terminal device executes the computer instructions, the terminal device performs the following operations:
obtaining, by the terminal device, the identification information of the first process when invoking the first process.
13 . The terminal device according to claim 11 , wherein the obtaining when identifying the unfolding event, by the terminal device, identification information of a first process, and when the terminal device executes the computer instructions, the terminal device performs the following operations:
reading, by the terminal device when identifying the unfolding event, the identification information of the first process from a local cache;
before the identifying, by the terminal device, an unfolding event when the terminal device is in a screen-off folded state, and when the terminal device executes the computer instructions, the terminal device performs the following operations:
writing, by the terminal device, the identification information of the first process into a database when the first process is started; and
storing, by the terminal device, the identification information of the first process in the local cache when the terminal device detects that the identification information of the first process is written into the database.
14 . The terminal device according to claim 11 , wherein when the terminal device executes the computer instructions, the terminal device performs the following operations:
The first process comprises a system interface process, and the system interface process is used to draw the interface.
15 . The terminal device according to claim 11 , wherein when the terminal device executes the computer instructions, the terminal device performs the following operations:
adjusting, by the terminal device after the running of the first process is completed, the first process from the second priority to the first priority.
16 . The terminal device according to claim 15 , wherein the first process is a system interface process; and the adjusting, by the terminal device, the first process from the second priority to the first priority, and when the terminal device executes the computer instructions, the terminal device performs the following operations:
adjusting, by the terminal device, the first process from the second priority to the first priority when the first process completes drawing of the interface.
17 . The terminal device according to claim 11 , wherein when the terminal device executes the computer instructions, the terminal device performs the following operations:
adjusting the first process from the second priority to the first priority upon expiration of a preset time interval after the first process is adjusted from the first priority to the second priority.
18 . The terminal device according to claim 11 , wherein when the terminal device executes the computer instructions, the terminal device performs the following operations:
adjusting, by the terminal device, the first process from the second priority to the first priority when the inner display screen is lighted up.
19 . The terminal device according to claim 11 , wherein when the terminal device executes the computer instructions, the terminal device performs the following operations:
invoking, by the first process after the first process is adjusted from the first priority to the second priority, a second process; and
adjusting, by the terminal device, the second process from a third priority to the second priority, wherein the second process is a process invoked in response to the first process; and
adjusting, by the terminal device, a third process from a fourth priority to the second priority, wherein the third process has a dependency relationship with the first process; and
deleting, by the terminal device, a lock in a fourth process, wherein the fourth process is the first process, and/or a process that uses a same lock as the first process.
20 . A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores a computer program, and when the computer program is run on a terminal device, the terminal device performs the following operations:
identifying, by the terminal device, an unfolding event when the terminal device is in a folded state and a outer display screen of the terminal device is off, wherein the unfolding event is used to indicate the terminal device to switch from the folded state to an unfolded state;
obtaining, by the terminal device when identifying the unfolding event, identification information of a first process, wherein the first process is a process that is in the terminal device and that is related to display of an inner display screen of the terminal device;
adjusting, by the terminal device, a scheduling priority of the first process from a first priority to a second priority based on the identification information of the first process, wherein the second priority is higher than the first priority, and wherein the scheduling priority determines an order in which a processor of the terminal device schedules processes for execution:
scheduling, by the terminal device based on the second priority, the first process for running; and
lighting up, by the terminal device after running of the first process is completed, the inner display screen, and displaying an interface on the inner display screen.