Method for displaying QR code and related electronic device
By using the back screen of the folding screen to display the QR code on an electronic device with an outer folding folding screen, the problem of many operation steps and poor user experience in displaying the QR code in the prior art is solved, and the fast and convenient QR code display is realized, improving the user experience and protecting the security of user information.
Patent Information
- Application Number
- PCT/CN2024/079219
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-18
- Filing Date
- 2024-02-29
- Publication Date
- 2025-02-27
AI Technical Summary
When existing electronic devices need to display QR codes, they need to interrupt the current task, open the corresponding application and display the QR code, which has many operation steps and affects the user experience.
A method is provided to display a QR code on the back screen in response to a user's operation using an electronic device with an outer folding folding screen without interrupting task execution of the home screen when the display screen is in a folded state.
Without interrupting the home screen task, quickly display the QR code, reduce operation steps, improve user experience, and protect user information security if necessary.
Smart Images

Figure CN2024079219_27022025_PF_FP_ABST
Abstract
Description
Method for displaying QR code and related electronic equipment
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on August 18, 2023, with application number 202311052022.8 and application name “Method for displaying QR code and related electronic equipment”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a method for displaying a QR code and related electronic equipment. Background Art
[0003] In the process of using an electronic device, if you encounter a scenario where you need to present a QR code such as a payment code or a boarding code, you need to interrupt the current task. Then open the corresponding application, and then open the QR code in the application. For example, the electronic device is displaying the content of an e-book on the display interface. If you need to present a QR code such as a payment code or a boarding code at this time, the electronic device will pause the display of the content of the e-book. Then, in response to the user's startup operation, the corresponding application (such as WeChat or Alipay) is started, and then the corresponding QR code is further displayed on the display interface in response to the user's related operations. This way of displaying QR codes, on the one hand, has many operating steps; on the other hand, it interrupts the current task, affecting the user experience.
[0004] Summary of the Invention
[0005] The present application provides a method for displaying a QR code and related electronic equipment, which are applied to electronic devices with an outward-folding screen and can improve user experience.
[0006] In a first aspect, the present application provides a method for displaying a QR code, the method being applied to an electronic device, the electronic device comprising a display screen, the display screen comprising a first screen and a second screen, wherein when the display screen is in a folded state, the display directions of the first screen and the second screen are opposite to each other, and when the display screen is in an unfolded state, the display directions of the first screen and the second screen are the same, and the first screen and the second screen are two different display areas of the display screen;
[0007] The display screen is in a folded state, and a first user interface is displayed on the first screen, where the first user interface includes an interface of a first application;
[0008] receiving a first operation of a user at a first time point, and displaying a first QR code of a second application on the second screen in response to the first operation; and displaying the first user interface on the first screen while the first QR code is displayed on the second screen;
[0009] After the first QR code is scanned, closing the second screen;
[0010] The display screen is in an expanded state, and a second user interface of the first application is displayed on the display screen, where the second user interface is an interface of the first user interface adapted to the expanded state;
[0011] At the second time point, the user's first operation is received, and the first QR code of the second application is not displayed on the second screen.
[0012] Optionally, the first operation includes tapping twice on the back of the first screen. For example, if the display screen is in a folded state, the back of the first screen refers to the front of the second screen. If the display screen is in an unfolded state, the back of the first screen refers to the back cover of the electronic device.
[0013] In the above solution, when the display screen of the electronic device is in a folded state, in order not to affect the execution of tasks on the main screen (i.e., the above-mentioned first screen), if the user needs to present a QR code (such as a boarding code, a payment code, or a collection code, etc.), the electronic device can display the QR code on the back screen (i.e., the above-mentioned second screen) in response to the user's operation (such as the above-mentioned first operation). That is, this solution can quickly pull up the QR code to be used on the back screen for display without interrupting the task currently being performed on the first screen of the electronic device, thereby reducing the operation steps for displaying the corresponding QR code and improving the user experience. In addition, if the display screen is in an unfolded state, in order not to affect the user's current use of the display screen, the aforementioned QR code will not be displayed on the second screen even if the above-mentioned first operation is received.
[0014] In one possible implementation, the display screen is in a folded state, and the first screen is in a locked state or a screen-off state;
[0015] At a third time point, a first operation of the user is received, and based on the fact that the first screen is in a locked state or an off-screen state, the first QR code of the second application is not displayed.
[0016] In the above solution, when the display screen is folded and the first screen is locked or off, the QR code will not be displayed on the second screen even if the first action is received. This prevents accidental touches and protects user information security, preventing unnoticed leakage of user information.
[0017] In one possible implementation, before the first screen displays the first user interface, the method further includes:
[0018] The electronic device is in an unfolded state, and the electronic device displays the second user interface, which does not include the first floating window;
[0019] The aforementioned first screen displays a first user interface, including:
[0020] After the electronic device changes from the unfolded state to the folded state, the electronic device displays the first user interface on the first screen, the first user interface includes the first floating window, and the first floating window includes the first interface element of the first QR code.
[0021] For example, in one implementation, the electronic device displays the above-mentioned first user interface on the first screen in response to the operation of changing from the expanded state to the folded state, and the first user interface at this time includes a floating ball (for example, see the operable control 402A shown in (a) of Figure 4A). Then, the electronic device displays the above-mentioned first floating window in response to the operation of the floating ball. Alternatively, in another possible implementation, the electronic device displays the above-mentioned first user interface on the first screen in response to the operation of changing from the expanded state to the folded state, and the first user interface includes the above-mentioned first floating window. Optionally, if no user operation on the first floating window is received within a preset time (for example, 3 seconds or 5 seconds, etc.) after the first floating window is displayed, then the first floating window becomes hidden by the floating ball.
[0022] Optionally, the method further includes: when the display screen is in a folded state, the first user interface receives a second operation of the user on the first interface element; and in response to the second operation, displays the first QR code on the second screen.
[0023] Optionally, the first interface element includes at least one of the icon and name of the second application and the type of the first QR code.
[0024] In the above solution, when the display screen is folded, the first screen can also display the first floating window, providing the user with another operational interface for pulling up the corresponding QR code display on the second screen. This enriches the operation of pulling up the QR code on the second screen, takes into account the needs of different users, and improves the user experience.
[0025] In one possible implementation, the aforementioned method further includes:
[0026] In response to an operation on a pull-down control of the first floating window, the first floating window is expanded and a second interface element of a second QR code of a third application is displayed;
[0027] A third operation of the user on the second interface element is received, and the second QR code is displayed on the second screen in response to the third operation.
[0028] In the above solution, the first floating window can also be expanded to display more QR code options, from which the user can select the QR code to be displayed on the back screen, which is convenient to operate.
[0029] In a possible implementation, after the first QR code is scanned, the method further includes:
[0030] A second floating window is displayed on the first screen, and the second floating window includes indication information that the first QR code has been scanned.
[0031] In the above solution, after the QR code displayed on the back screen is scanned, a window prompting the completion of the scan can be displayed on the main screen to inform the user in time and improve the user experience.
[0032] In one possible implementation, the receiving of the first operation by the user, before displaying the first QR code of the second application on the second screen in response to the first operation, further includes:
[0033] Obtaining first status information of the display screen;
[0034] When the first state information indicates that the display screen is in a folded state, is unlocked, and is bright, an input event of the first operation is monitored.
[0035] In the above solution, the electronic device monitors the input event of the first operation only when the display screen is in the folded, unlocked and bright states, so that the corresponding event can be captured in time and responded to quickly.
[0036] In a possible implementation, the receiving of the first operation by the user, before the display screen displays the first QR code, further includes:
[0037] Obtaining second status information of the display screen;
[0038] When the second state information indicates that the display screen is in the target state, the monitoring of the input event of the first operation is canceled; the target state includes the display screen being in the expanded state, the locked state or the off state.
[0039] In the above solution, the electronic device cancels monitoring of the first operation when the display screen is in the expanded state, locked state, or off-screen state. Specifically, canceling monitoring of the first operation does not pull up the QR code on the second screen. This does not affect the task currently being performed on the display screen when the display screen is in the expanded state. When the display screen is in the locked state or off-screen state, user information can be protected and prevented from being leaked.
[0040] In one possible implementation, displaying the first QR code of the second application on the second screen in response to the first operation includes:
[0041] In response to the first operation, a target window and a third user interface are displayed on the second screen; the third user interface is a user interface of the second application that includes the first QR code; the target window includes a first area and a second area, the first area is a transparent area, and the second area is a black area; the target window covers the third user interface, and the first QR code and the first area are positioned correspondingly. That is, the first QR code is displayed through the first area.
[0042] In the above solution, the target window acts as a mask, so that it can cover the content other than the QR code in the third user interface, thereby reducing unnecessary interference.
[0043] In a possible implementation, closing the second screen includes:
[0044] Set the aforementioned first area to black;
[0045] removing the task window displayed on the second screen, wherein the task window includes the third user interface;
[0046] Close the aforementioned target window.
[0047] In the above solution, in order to quickly show the user that the second screen has been closed and to avoid displaying additional content to distract the user, the transparent first area can be set to black. Then, the entire target window covering the upper layer will be black, and the entire back screen will be black. Then, the back screen task window can be removed and the target window can be closed to complete the closing of the back screen.
[0048] In a second aspect, the present application provides a method for displaying a QR code, the method being applied to an electronic device, the electronic device comprising a display screen, the display screen comprising a first screen and a second screen, wherein when the display screen is in a folded state, the display directions of the first screen and the second screen are opposite to each other, and when the display screen is in an unfolded state, the display directions of the first screen and the second screen are the same, and the first screen and the second screen are two different display areas of the display screen;
[0049] The display screen is in a folded state, and a user interface of a first application and a first floating window are displayed on the first screen, wherein the first floating window includes a first interface element of a first QR code of a second application;
[0050] receiving a user selection operation of the first interface element at a first time point, and displaying the first QR code on the second screen in response to the selection operation; displaying the user interface of the first application on the first screen while the first QR code is displayed on the second screen; and closing the second screen after the first QR code is scanned;
[0051] When the display screen is in a target state, the display screen does not display the first floating window, and the target state includes the display screen being in an expanded state, a locked state, or an off-screen state.
[0052] In the above solution, when the display screen of the electronic device is in a folded state, in order not to affect the execution of tasks on the main screen (i.e., the above-mentioned first screen), if the user needs to present a certain QR code (such as a boarding code, a payment code, or a collection code, etc.), then the electronic device can display the QR code on the back screen (i.e., the above-mentioned second screen) in response to the user's operation (such as the above-mentioned selection operation). That is, this solution can quickly pull up the QR code to be used on the back screen to display it without interrupting the task currently being performed on the first screen of the electronic device, reducing the operation steps for displaying the corresponding QR code and improving the user experience. In addition, if the display screen is in an unfolded state, in order not to affect the user's current use of the display screen, the aforementioned QR code will not be displayed on the second screen even if the above-mentioned first operation is received. If the display screen is in a locked screen state or a screen-off state, in order to protect the user's information security, the aforementioned QR code will not be displayed on the second screen even if the above-mentioned first operation is received.
[0053] In a third aspect, the present application provides an electronic device, comprising a display screen, the display screen comprising a first screen and a second screen, wherein when the display screen is in a folded state, the display directions of the first screen and the second screen are opposite to each other, and when the display screen is in an unfolded state, the display directions of the first screen and the second screen are the same, and the first screen and the second screen are two different display areas of the display screen;
[0054] The electronic device further includes a processing unit configured to perform the following operations:
[0055] The display screen is in a folded state, and a first user interface is displayed on the first screen, where the first user interface includes an interface of a first application;
[0056] receiving a first operation of a user at a first time point, and displaying a first QR code of a second application on the second screen in response to the first operation; and displaying the first user interface on the first screen while the first QR code is displayed on the second screen;
[0057] After the first QR code is scanned, closing the second screen;
[0058] The display screen is in an expanded state, and a second user interface of the first application is displayed on the display screen, where the second user interface is an interface of the first user interface adapted to the expanded state;
[0059] At the second time point, the user's first operation is received, and the first QR code of the second application is not displayed on the second screen.
[0060] Optionally, the first operation includes tapping twice on the back of the first screen. For example, if the display screen is in a folded state, the back of the first screen refers to the front of the second screen. If the display screen is in an unfolded state, the back of the first screen refers to the back cover of the electronic device.
[0061] In one possible implementation, the display screen is in a folded state, and the first screen is in a locked state or an off-screen state; and the processing unit is further configured to perform the following operations:
[0062] At a third time point, a first operation of the user is received, and based on the fact that the first screen is in a locked state or an off-screen state, the first QR code of the second application is not displayed.
[0063] In a possible implementation, before the first screen displays the first user interface, the processing unit is further configured to perform the following operations:
[0064] The electronic device is in an unfolded state, and the electronic device displays the second user interface, which does not include the first floating window;
[0065] The aforementioned processing unit is specifically configured to perform the following operations:
[0066] After the electronic device changes from the unfolded state to the folded state, the electronic device displays the first user interface on the first screen, the first user interface includes the first floating window, and the first floating window includes the first interface element of the first QR code.
[0067] For example, in one implementation, the electronic device displays the above-mentioned first user interface on the first screen in response to the operation of changing from the expanded state to the folded state, and the first user interface at this time includes a floating ball (for example, see the operable control 402A shown in (a) of Figure 4A). Then, the electronic device displays the above-mentioned first floating window in response to the operation of the floating ball. Alternatively, in another possible implementation, the electronic device displays the above-mentioned first user interface on the first screen in response to the operation of changing from the expanded state to the folded state, and the first user interface includes the above-mentioned first floating window. Optionally, if no user operation on the first floating window is received within a preset time (for example, 3 seconds or 5 seconds, etc.) after the first floating window is displayed, then the first floating window becomes hidden by the floating ball.
[0068] Optionally, the processing unit is further used to perform the following operations: when the display screen is in a folded state, the first user interface receives a second operation of the user on the first interface element; and in response to the second operation, the first QR code is displayed on the second screen.
[0069] Optionally, the first interface element includes at least one of the icon and name of the second application and the type of the first QR code.
[0070] In one possible implementation, the processing unit is further configured to perform the following operations:
[0071] In response to an operation on a pull-down control of the first floating window, the first floating window is expanded and a second interface element of a second QR code of a third application is displayed;
[0072] A third operation of the user on the second interface element is received, and the second QR code is displayed on the second screen in response to the third operation.
[0073] In a possible implementation, after the first QR code is scanned, the processing unit is further configured to perform the following operations:
[0074] A second floating window is displayed on the first screen, and the second floating window includes indication information that the first QR code has been scanned.
[0075] In one possible implementation, in the aforementioned receiving of the first operation by the user, before displaying the first QR code of the second application on the second screen in response to the first operation, the aforementioned processing unit is further configured to perform the following operations:
[0076] Obtaining first status information of the display screen;
[0077] When the first state information indicates that the display screen is in a folded state, is unlocked, and is bright, an input event of the first operation is monitored.
[0078] In a possible implementation, after receiving the first operation from the user and before the display screen displays the first QR code, the processing unit is further configured to perform the following operations:
[0079] Obtaining second status information of the display screen;
[0080] When the second state information indicates that the display screen is in the target state, the monitoring of the input event of the first operation is canceled; the target state includes the display screen being in the expanded state, the locked state or the off state.
[0081] In one possible implementation, the processing unit is specifically configured to perform the following operations:
[0082] In response to the aforementioned first operation, a target window and a third user interface are displayed on the aforementioned second screen; the aforementioned third user interface is a user interface in the aforementioned second application that contains the aforementioned first QR code, the aforementioned target window includes a first area and a second area, the aforementioned first area is a transparent area, the aforementioned second area is a black area, the aforementioned target window covers the aforementioned third user interface, and the aforementioned first QR code and the aforementioned first area correspond in position.
[0083] In one possible implementation, the processing unit is specifically configured to perform the following operations:
[0084] Set the aforementioned first area to black;
[0085] removing the task window displayed on the second screen, wherein the task window includes the third user interface;
[0086] Close the aforementioned target window.
[0087] In a fourth aspect, the present application provides an electronic device, comprising a display screen, the display screen comprising a first screen and a second screen, wherein when the display screen is in a folded state, the display directions of the first screen and the second screen are opposite to each other, and when the display screen is in an unfolded state, the display directions of the first screen and the second screen are the same, and the first screen and the second screen are two different display areas of the display screen; the electronic device further comprising a processing unit configured to perform the following operations:
[0088] The display screen is in a folded state, and a user interface of a first application and a first floating window are displayed on the first screen, wherein the first floating window includes a first interface element of a first QR code of a second application;
[0089] receiving a user selection operation of the first interface element at a first time point, and displaying the first QR code on the second screen in response to the selection operation; displaying the user interface of the first application on the first screen while the first QR code is displayed on the second screen; and closing the second screen after the first QR code is scanned;
[0090] When the display screen is in a target state, the display screen does not display the first floating window, and the target state includes the display screen being in an expanded state, a locked state, or an off-screen state.
[0091] In a fifth aspect, the present application provides an electronic device comprising: a display screen, one or more processors, and one or more memories; the one or more processors are coupled to the display screen and the one or more memories; the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect and any one of its possible implementations.
[0092] In a sixth aspect, the present application provides an electronic device comprising: a display screen, one or more processors, and one or more memories; the one or more processors are coupled to the display screen and the one or more memories; the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in the second aspect.
[0093] In a seventh aspect, the present application provides a computer-readable storage medium comprising instructions, which, when the aforementioned instructions are executed on an electronic device, enable the aforementioned electronic device to execute the method described in the aforementioned first aspect and any one of its possible implementations.
[0094] In an eighth aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the second aspect.
[0095] In a ninth aspect, the present application provides a computer program product comprising instructions, which, when the aforementioned computer program product is run on an electronic device, enables the aforementioned electronic device to execute the method described in the aforementioned first aspect and any one of its possible implementations.
[0096] In a tenth aspect, the present application provides a computer program product comprising instructions, which, when the computer program product is run on an electronic device, enables the electronic device to execute the method described in the second aspect.
[0097] The above-mentioned third to tenth aspects are used to cooperate with the implementation of any one of the methods in the above-mentioned first aspect, second aspect and possible implementation methods, and therefore have corresponding beneficial effects to the above-mentioned first aspect, second aspect and possible implementation methods, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] 1A to 1D are schematic diagrams of electronic devices provided in embodiments of the present application;
[0099] FIG2 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0100] FIG3 is a schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0101] FIG4 is a schematic diagram of a user holding an electronic device according to an embodiment of the present application;
[0102] 4A to 4K are schematic diagrams of user interfaces displayed on electronic devices according to embodiments of the present application;
[0103] 5 to 10 are schematic diagrams of the internal interaction process of the electronic device provided in the embodiments of the present application. DETAILED DESCRIPTION
[0104] 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. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Mentioning "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiment can be included in at least one embodiment of the present embodiment application. The appearance of this phrase in various positions in the specification does not necessarily mean the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It can be understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without making creative work are within the scope of protection of this application.
[0105] In the specification, claims, and accompanying drawings of this application, the terms "first," "second," "third," and the like are used to distinguish different objects and are not used to describe a particular order. Furthermore, the terms "including," "comprising," "having," and any variations thereof are intended to cover non-exclusive inclusions. For example, a list of steps or elements may be included, or alternatively, steps or elements not listed may be included, or other steps or elements may be included that are inherent to the process, method, product, or apparatus.
[0106] Only part relevant to the present application is shown in the accompanying drawings, not all of it. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processing or methods depicted as flow charts. Although flow charts describe various operations (or steps) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of various operations can be rearranged. When its operation is completed, the processing can be terminated, but can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.
[0107] As used in this specification, the terms "component," "module," "system," "unit," and the like are used to refer to computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a unit can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or distributed between two or more computers. In addition, these units can be executed from various computer-readable media having various data structures stored thereon. Units can communicate, for example, through local and / or remote processes based on signals having one or more data packets (e.g., data from a second unit interacting with another unit in a local system, a distributed system, and / or a network. For example, the Internet interacts with other systems via signals).
[0108] With the development of users' diversified demands for electronic devices, foldable screen electronic devices with both large screens and convenience are widely welcomed by users. The foldable screen of an electronic device can be folded to form at least two screens. For example, the foldable screen can be folded along a folding edge or a folding axis to form a first screen and a second screen. The folding methods of foldable screens on electronic devices can be divided into two categories. One is a foldable screen that folds outward (referred to as an outward folding screen), and the other is a foldable screen that folds inward (referred to as an inward folding screen). Among them, take the foldable screen that can be folded to form a first screen and a second screen as an example. After the outward folding screen is folded, the display direction of the first screen and the display direction of the second screen are opposite to each other. The display direction is the direction of the front of the screen, or the direction facing the front of the screen. When the screen is displayed, the display direction is the direction of the screen display. Exemplarily, the display screen of the electronic device is a flexible screen. The first screen and the second screen are two different display areas in the same display screen.
[0109] The electronic devices involved in the embodiments of the present application are mainly taken as examples electronic devices with outward folding screens. For example, the outward folding screen can include two ways of folding: vertical folding and horizontal folding. Vertical folding refers to folding the screen of the electronic device longitudinally outward. Horizontal folding refers to folding the screen of the electronic device laterally outward. The embodiments of the present application are introduced by taking the screen of the electronic device folding outward laterally as an example. For example, please refer to Figures 1A to 1D for example, which show the appearance schematic diagrams of an electronic device with a laterally outward folding screen provided by the embodiments of the present application. Among them, Figure 1A shows a schematic diagram of the display screen of the electronic device in the unfolded state (which can be simply referred to as the unfolded state). It can be seen that the electronic device includes a first screen and a second screen. In the unfolded state, the first screen and the second screen can form a large display screen to display the user interface. The first screen and the second screen can be folded along a folding axis or a folding edge (the folding axis is shown as an example in Figures 1A to 1D).
[0110] For example, in FIG1A , the second screen can be folded along the direction shown in 1a, and / or the first screen can be folded along the direction shown in 1b to obtain the state shown in FIG1B . For example, in FIG1B , the second screen can be further folded along the direction shown in 1c to obtain the folded state shown in FIG1C (hereinafter referred to as the folded state). FIG1C shows the second screen in the folded state. The first screen in the folded state can be exemplified in FIG1D .
[0111] For example, the first screen is the main screen of the electronic device, and the second screen is the secondary screen of the electronic device. If the electronic device is in a folded state, the first screen generally faces the user, so the second screen can also be called the back screen.
[0112] It is understood that the above-mentioned Figures 1A to 1D are merely examples and do not constitute a limitation on the embodiments of the present application. For example, in a specific implementation, in addition to the above-mentioned first and second screens, the electronic device may also include other display screens, and the embodiments of the present application do not limit this.
[0113] In the process of using an electronic device with an outward-folding folding screen, if you encounter a scenario where you need to present a QR code such as a payment code or a boarding code, you need to interrupt the currently ongoing task. Then open the corresponding application, and then open the QR code in the application. For example, the electronic device is displaying the content of an e-book in the display interface. If you need to present a QR code such as a payment code or a boarding code at this time, the electronic device will pause displaying the content of the e-book. Then, in response to the user's startup operation, the corresponding application (such as WeChat or Alipay) is started, and then the corresponding QR code is further displayed on the display interface in response to the user's related operations. This way of displaying QR codes, on the one hand, has many operating steps, resulting in low efficiency in displaying QR codes; on the other hand, it interrupts the currently ongoing task, affecting the user experience. In order to optimize the efficiency of displaying QR codes and improve the user experience, an embodiment of the present application provides a method for displaying QR codes and an electronic device that uses the method for displaying QR codes.
[0114] First, the electronic devices provided by the embodiments of the present application are exemplarily introduced. The electronic devices may include handheld devices (for example, mobile phones, tablet computers, PDAs, etc.), vehicle-mounted devices (for example, cars, electric cars, airplanes, ships, etc.), wearable devices (for example, smart watches (such as iWatch, etc.), smart bracelets, pedometers, etc.), smart home devices (for example, refrigerators, TVs, air conditioners, electric meters, etc.), intelligent robots, workshop equipment, and various forms of user equipment (UE), mobile stations (MS), terminal equipment (Terminal Equipment), etc. It will be understood that the introduction here is only an example, and the embodiments of the present application do not limit the specific form and implementation of the electronic device.
[0115] Please refer to FIG. 2 , which is a schematic diagram of the hardware structure of the electronic device 100 provided in an embodiment of the present application.
[0116] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0117] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0118] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (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). The different processing units may be independent devices or integrated into one or more processors.
[0119] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0120] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0121] Display screen 194 is used to display images, videos, and the like. Display screen 194 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 (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0122] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0123] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0124] The pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194 .
[0125] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
[0126] The magnetic sensor 180D includes a Hall sensor, and the electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
[0127] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when electronic device 100 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.
[0128] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0129] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.
[0130] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone mass in a human vocal part.
[0131] Based on the hardware structure diagram of the electronic device 100 according to the embodiment of the present application shown in FIG2 , the software structure block diagram of the electronic device 100 according to the embodiment of the present application is introduced below, as shown in FIG3 .
[0132] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0133] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers: from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, the hardware abstraction layer (HAL), and the kernel layer.
[0134] The application layer can include a series of application packages.
[0135] As shown in FIG3 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, short message and back screen service (TapTapService).
[0136] For example, the back screen service can be used to display a target QR code on the back screen of an electronic device. For a specific implementation, please refer to FIG. 7 and its possible implementations, which will not be described in detail here. For example, the target QR code can be a payment code, a boarding code, or any other identification code, etc., which is not limited in this embodiment of the application.
[0137] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0138] As shown in FIG3 , the application framework layer may include a window manager, a content provider, a phone manager, a resource manager, a notification manager, a view system, and a double-click control service (TapTapControlService), etc.
[0139] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0140] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0141] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).
[0142] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0143] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include displaying text messages in the status bar, emitting alert sounds, vibrating electronic devices, or flashing indicator lights.
[0144] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0145] For example, the double-click control service can be used to monitor the screen folding state and the screen on / off state, as well as query the screen unlock state. For specific implementation, please refer to Figure 5 and its possible implementations, which will not be described in detail here.
[0146] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
[0147] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0148] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0149] The system library can include multiple functional modules, such as the surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), and motion services modules.
[0150] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0151] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0152] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing and layer processing.
[0153] A 2D graphics engine is a drawing engine for 2D drawings.
[0154] For example, the gesture service module can be used to monitor target events through the device management service (hwExtDeviceManage). For specific implementation, please refer to the following FIG6 and its possible implementation, which will not be described in detail here.
[0155] The Hardware Abstraction Layer (HAL) is an abstract structure between the kernel layer and upper layers. It encapsulates kernel-layer drivers and provides a unified interface to upper layers. This shields upper-layer applications from the detailed operation of the underlying hardware, thus shielding them from the underlying implementation details.
[0156] The hardware abstraction layer (HAL) provides a standard interface that exposes device hardware capabilities to the higher-level application framework layer. The HAL contains multiple library modules, each of which implements an interface for a specific type of hardware component. These library modules may include audio, Bluetooth, camera, and sensors. Sensors may include, for example, accelerometers, magnetic field sensors, orientation sensors, gyroscopes, ambient light sensors, pressure sensors, temperature sensors, and proximity sensors. When the application framework layer requests access to device hardware, the system loads the corresponding library module for that hardware component. Manufacturers can define interfaces in the HAL.
[0157] For example, the acceleration sensor may be used to sense operations performed on the electronic device (eg, a double-click operation on the back screen).
[0158] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0159] Based on the electronic device exemplarily introduced above, an embodiment of the present application provides a method for displaying a QR code. This method can be applied in a scenario where an electronic device with an outward folding screen is in a folded state. For example, it can be applied in the scenario shown in Figure 4. In Figure 4, the electronic device is in a folded state, and the user holds the electronic device. The first screen of the electronic device faces the user, and the second screen of the electronic device faces away from the user. The second screen is referred to as the back screen below. For example, the first screen of the electronic device can display the user interface or desktop of a certain application (that is, the electronic device is in an unlocked and bright screen state).
[0160] Alternatively, in another possible implementation, if security factors such as the disclosure of user information are not considered, the electronic device can implement the method for displaying a QR code provided in the embodiment of the present application as long as it is in a folded state. For example, as long as the electronic device is in a folded state, the electronic device can implement the method for displaying a QR code when the screen is off but not locked, or when the electronic device is in a locked state. However, the following introduction mainly describes the method for displaying a QR code when the electronic device is in a folded state, the screen is not locked, and the screen is on. The bright screen refers to the first screen of the electronic device being on, and the same applies to the following description, so it will not be repeated.
[0161] The "screen off" mentioned above refers to the electronic device's display being off. This is in contrast to the "screen on" state, which refers to the state where the electronic device's display is illuminated. A "lock screen" is a protection state set to protect the data security of the electronic device. A lock screen also prevents accidental touches or presses. Once the electronic device's screen is locked, it can only be unlocked by entering a password or other user-defined unlocking method.
[0162] The following is an exemplary introduction to the method for displaying a QR code provided in an embodiment of the present application.
[0163] First, the user interface displayed on the display screen of the electronic device during the process of implementing the method for displaying a QR code is exemplarily introduced below with reference to FIG. 4A to FIG. 4K .
[0164] For example, in the scenario shown in FIG4 above, that is, when the electronic device is in a folded state, the screen is not locked, and the screen is on, the electronic device can detect the target operation. The target operation can be, for example, two consecutive taps by the user on the back screen of the electronic device, or a single tap by the user on the back screen of the electronic device, or a sliding operation after a single tap on the back screen of the electronic device, and so on. Alternatively, the target operation can be a tap, slide, or drag operation on the first screen of the electronic device, and any combination thereof, and so on. It is understandable that the target operation can be pre-set, and specifically can be any pre-set operation, and the embodiment of the present application does not limit this. For example, the electronic device can detect the target operation by an acceleration sensor. For example, the aforementioned two consecutive tap operations can be, for example, two tap operations within a preset time length. The preset time length can be 0.5 seconds, 1 second, or 2 seconds, and so on, and the embodiment of the present application does not limit this.
[0165] Exemplarily, when the electronic device is in a folded state, unlocked and with the screen on, the user interfaces of the first screen and the back screen can be seen in (a) and (b) of Figure 4A, respectively. As can be seen in (a) of Figure 4A, the user interface of the first screen can display an operable control 402A on the interface 401 originally displayed on the first screen. The operable control 402A is in a hidden state of the floating window 402B. The operable control 402A can call out the floating window 402B in response to the user's operation. For details, please refer to the following introduction, which will not be described in detail here. As can be seen in (b) of Figure 4A, the back screen is in a black screen, that is, the user interface of any application is not displayed.
[0166] In one possible implementation, the above-mentioned target operation is taken as an example of the first operation. The first operation may be an operation of tapping twice in a row on the back screen of the electronic device, etc. When the first screen and the back screen of the electronic device are as shown in Figure 4A, the electronic device may display a floating window 402B in the first screen in response to the first operation (for example, see Figure 4B (a)), and display the target QR code in the back screen (for example, see Figure 4B (b)). Figure 4B (a) and Figure 4B (b) are shown as an example in which the target QR code is the first QR code of the first application. The first application may be any application that can present QR codes such as payment codes and boarding codes, and the embodiments of the present application do not limit this.
[0167] FIG4B (a) shows a user interface diagram of the first screen displaying a floating window 402B. As can be seen in FIG4B (a), after the electronic device responds to the above-mentioned first operation, the floating window 402B can be displayed on the interface 401 originally displayed on the first screen. The floating window 402B can indicate that the first QR code of the first application is displayed on the back screen. The floating window 402B may include an icon 4021 of the first application, text 4022 indicating that a QR code is displayed on the back screen, the name 4023 of the first application, the type 4024 of the displayed QR code, and a drop-down control 4025.
[0168] The icon 4021 of the first application is only an example and does not constitute a limitation on the embodiments of the present application. The icons shown in the drawings of the embodiments of the present application are all examples and will not be described in detail below.
[0169] The above text 4022 is, for example, "back screen bright code", etc., which is not limited in the embodiment of the present application. In a specific implementation, the text 4022 can also be other text indicating that the back screen displays a QR code, which is not limited in the embodiment of the present application.
[0170] The above-mentioned QR code type 4024 may include payment code, receipt code, boarding code, identity identification code and various QR codes that may appear in the future, etc., and the embodiment of the present application does not limit this.
[0171] The above-mentioned drop-down control 4025 can display more selectable QR code types in the floating window 402B, and the selected QR code can be displayed on the back screen. For the application of the drop-down control 4025, please refer to the relevant introduction of Figures 4D and 4E below, which will not be described in detail here.
[0172] FIG4B(b) shows a user interface diagram for displaying the first QR code of the first application on the back screen. As can be seen in FIG4B(b), the background of the back screen is black, and the area 403 displaying the first QR code of the first application is white. Area 403 may include a payment barcode 4031, a payment QR code 4032, and text 4033 indicating the display of the first QR code number. This text 4033 may, for example, read "Click to view the first QR code number," etc. This embodiment of the application does not limit the specific content of this text. For example, the user interface for the first QR code of the first application may also include a description 404 of the first QR code. This description 404 may, for example, include the icon 4041 of the first application and the name 4042 of the displayed QR code. The name 4042 of the QR code may, for example, be "First Application First QR Code," etc. This embodiment of the application does not limit the textual description of the QR code name. For example, assuming that the first QR code is a boarding code, then the name 4042 of the QR code may be "First Application Boarding Code." For another example, assuming that the first QR code is a payment code, the name 4042 of the QR code may be “First Application Payment Code.” The names of the QR codes described below are similar and will not be repeated here.
[0173] In one possible implementation, as shown in (a) of FIG. 4B , the electronic device may expand a floating window 402B in response to a user clicking on the drop-down control 4025 to display more selectable QR code types. For example, the expanded floating window 402B may be shown in FIG. 4D . In FIG. 4D , the floating window 402B also includes an option for a second QR code of a second application and an option for a ride code of a third application. For example, the floating window 402B may include an icon 4027 for the second application and text 4028 indicating the selection of the second QR code of the second application. This text 4028 may, for example, read "Use "Second Application Second QR Code"." This embodiment of the present application does not limit this. The floating window 402B also includes an icon 4029 for the third application and text 40210 indicating the selection of the ride code of the third application. This text 40210 may, for example, read "Use "Third Application Ride Code"." This embodiment of the present application does not limit this.
[0174] In one possible implementation, in the expanded floating window 402B shown in FIG4D , the electronic device may display a second QR code of the second application on the back screen in response to a user click on the display area of the icon 4027 and / or text 4028. For example, see FIG4E , which illustrates a user interface diagram for displaying the second QR code of the second application on the back screen.
[0175] As can be seen in Figure 4E, the background of the back screen is black, and the background of the area 407 displaying the second QR code of the second application is white. The area 407 may include a payment barcode 4071, a payment QR code 4072, and text 4073 indicating the display of the second QR code number. The text 4073 may be, for example, "Touch to view the second QR code number", etc., and the embodiment of the present application does not limit the specific content of the text. Exemplarily, the user interface displaying the second QR code of the second application may also include an explanation 408 about the second two-dimensional. The explanation 408 may, for example, include an icon 4081 of the second application and the name 4082 of the displayed QR code. The name 4082 of the QR code may be, for example, "Second QR code of the second application", etc., and the embodiment of the present application does not limit the text description of the name of the QR code.
[0176] Regarding the implementation of selecting the boarding code of the third application in the expanded floating window 402B and displaying it on the back screen, you can refer to the relevant introduction of the second QR code of the second application mentioned above, which will not be repeated here.
[0177] In addition, as can be seen in FIG. 4D , the expanded floating window 402B also includes a pull-up control 4026. This pull-up control 4026 can collapse the expanded floating window 402B. For example, the electronic device can collapse the expanded floating window 402B in response to a user clicking on the pull-up control 4026. The collapsed floating window 402B can be exemplarily shown in FIG. 4B (a).
[0178] In another possible implementation, in the user interface shown in FIG4D , the electronic device can collapse the expanded floating window 402B in response to a user clicking anywhere outside the expanded floating window 402B. The collapsed floating window 402B can be exemplified as shown in FIG4B (a).
[0179] It is understood that the expanded floating window 402B shown in FIG4D is merely an example and does not constitute a limitation on the embodiments of the present application. In a specific implementation, the selectable QR code type included in the expanded floating window 402B can be a QR code of another application or other QR code type, and the embodiments of the present application do not impose any limitation on this.
[0180] In one possible implementation, after the QR code shown in (b) of FIG. 4B (or FIG. 4E ) is successfully scanned, the electronic device may display information such as “Scanning completed” or “Payment successful” in area 403 shown in (b) of FIG. 4B (or area 407 shown in FIG. 4E ). To indicate that the QR code has been successfully scanned, optionally, the successful scanning of the back of the QR code may also indicate the completion of the corresponding operation (such as a payment operation, etc., which is not limited in the embodiments of the present application). For example, see FIG. 4F and FIG. 4G . The successful scanning or scanning completion of the QR code means that the QR code has been successfully scanned by other devices.
[0181] Figure 4F shows the user interface displayed on the back screen after the QR code shown in Figure 4B (b) is successfully scanned. As can be seen, the user interface after the jump may include information such as the first application icon 4034, the words "Payment Successful" 4035, the payment amount (using 100 yuan as an example) 4036, the payment method 4037, and the payee 4038.
[0182] Figure 4G shows the user interface displayed on the back screen after the QR code shown in Figure 4E is successfully scanned. It can be seen that the user interface after the jump can display the message "Scanning completed".
[0183] It is understood that Figures 4F and 4G are merely examples and do not limit the embodiments of the present application. In a specific implementation, the interface that jumps to after the QR code is successfully scanned can be another user interface, and the embodiments of the present application do not limit this. Alternatively, the user interface after the jump can display other interface elements, and the embodiments of the present application do not limit this.
[0184] After the QR code shown in FIG4B(b) (or FIG4E) is successfully scanned and the interface is redirected (for example, after the user interface shown in FIG4F and FIG4G is displayed), the electronic device can turn off the back screen. Turning off the back screen can mean that the back screen is in a black screen state or the back screen displays a black background, for example, as shown in FIG4A(b). Alternatively, turning off the back screen can mean that the back screen is not displayed.
[0185] In another possible implementation, after the QR code shown in FIG. 4B (b) (or FIG. 4E ) is successfully scanned, the first screen of the electronic device may display a floating window indicating that the payment is complete or the code scanning is complete. For example, see FIG. 4H and FIG. 4I .
[0186] Figure 4H shows a schematic diagram of the user interface on the first screen after the QR code shown in Figure 4B (b) is successfully scanned. As can be seen, a floating window 402C is displayed in the user interface. This floating window 402C may include the first application icon 402C1, text 402C2 indicating that payment has been completed, the name of the first application 402C3, and the type of QR code displayed (e.g., payment code, ride code, etc.) 402C4. For example, the text 402C2 indicating that payment has been completed may also indicate that the payment amount is "x yuan," as shown in Figure 4H.
[0187] Figure 4I shows a schematic diagram of the user interface on the first screen after the QR code shown in Figure 4E is successfully scanned. As can be seen, a floating window 402D is displayed in the user interface. This floating window 402D may include an icon 402D1 for the second application, text 402D2 indicating that the code has been scanned, the name of the second application 402D3, and the type of QR code displayed (e.g., payment code, ride code, etc.) 402D4.
[0188] In a possible implementation, the floating window 402C or the floating window 402D is displayed for a preset time period and then disappears. The preset time period may be, for example, 3 seconds, 5 seconds, or 8 seconds, etc., and this embodiment of the present application does not impose any limitation on this.
[0189] It is understood that the floating windows shown in Figures 4H and 4I are merely examples and do not limit the embodiments of the present application. In a specific implementation, the floating window may display other interface elements or content, which is not limited in the embodiments of the present application.
[0190] In another possible implementation, after the QR code shown in FIG4B(b) (or FIG4E) is successfully scanned, the jump interface after the successful scan will not be displayed on the back screen (for example, the user interface of FIG4F and FIG4G will not be displayed). Instead, the screen will directly turn black, for example, as shown in FIG4A(b).
[0191] In another possible implementation, in the case shown in FIG. 4A above, the electronic device can also display a floating window 402B on the first screen (for example, see FIG. 4B (a)) and display a target QR code on the back screen (for example, see FIG. 4B (b)) in response to the user's second operation on the first screen. That is, the above-mentioned target operation is the second operation. The second operation may include a click operation (or a press and hold and then slide operation) on the operable control 402A in FIG. 4A (a) and a selection operation of the target QR code. The following is an exemplary introduction.
[0192] For example, see Figure 4J. In response to the user clicking on the operable control 402A, the electronic device may display a floating window 402B on the first screen, as shown in Figure 4C (a). At this time, the back screen is black and does not display the QR code, as shown in Figure 4C (b).
[0193] For example, see Figure 4K . In response to a user pressing and sliding on operable control 402A, the electronic device may display a floating window 402B on the first screen, as shown in Figure 4C (a). At this time, the back screen is black and does not display the QR code, as shown in Figure 4C (b). The sliding direction may be, for example, the direction shown in 406 in Figure 4K .
[0194] In the user interface shown in (a) of FIG4C above, the electronic device can display the first QR code of the first application on the back screen in response to the user's selection operation on the first QR code of the first application. The user interface for displaying the first QR code of the first application on the back screen can be exemplified by referring to (b) of FIG4B. For example, the selection operation can be, for example, a user clicking on the icon 4021, the name 4023 of the first application, or the type 4024 of the displayed QR code.
[0195] In another possible implementation, if the user wants to select other QR codes to be displayed on the back screen, then reference can be made to the aforementioned description of FIG. 4D and FIG. 4E , which will not be repeated here.
[0196] In another possible implementation, after the QR code displayed on the back screen is successfully scanned, the electronic device can turn off the back screen. For specific implementation, please refer to the above description of Figures 4F to 4I, which will not be repeated here.
[0197] In one possible implementation, in the user interface shown in (a) of FIG. 4B , (a) of FIG. 4C , or (b) of FIG. 4D , if the electronic device does not receive a user operation through the floating window 402B after a preset time, for example, the user does not click or touch any position of the floating window 402B within the preset time, then the electronic device may hide the floating window 402B. The user interface after hiding can be exemplarily shown in (a) of FIG. 4A . For example, the preset time can be, for example, 3 seconds, 5 seconds, or 8 seconds, etc., and the embodiments of the present application are not limited thereto.
[0198] In one possible implementation, if the electronic device is in an expanded state, or in a locked screen state, or in a screen-off state, the first screen will not display the above-mentioned operable control 402A, nor will it display the floating window 402B. Moreover, even if the electronic device receives the first operation from the user, it will not respond. That is, the target QR code will not be displayed on the second screen. In addition, since the first screen will not display the above-mentioned operable control 402A, nor will it display the floating window 402B, the electronic device cannot receive the above-mentioned second operation. That is, when the electronic device is in an expanded state, or in a locked screen state, or in a screen-off state, the display of the above-mentioned target QR code will not be triggered.
[0199] The following further describes the implementation process of the method for displaying a QR code provided by the embodiment of the present application. The following implementation process is mainly described by taking the above-mentioned target operation as the above-mentioned first operation as an example.
[0200] In a possible implementation, based on the previous introduction, it can be known that the electronic device will display the user interface introduced above only when it is in a folded state, unlocked and the screen is on. Therefore, the electronic device can register a listener in the system server to listen to the screen folding state, register a broadcast receiver to receive the screen on / off state, and can query the unlock state of the screen. After the electronic device obtains the above-mentioned specific screen folding state, the specific screen on / off state and the specific screen unlock state, it can determine whether to register a target event listener based on these states. The target event is the input event of the above-mentioned target operation. The target event listener can monitor the occurrence of the target event. Only after the target event occurs will the electronic device be triggered to execute the process of displaying the above-mentioned floating window and / or target QR code. The specific implementation process is exemplified below in conjunction with Figures 5 and 6. First, refer to the process shown in Figure 6. The process shown in Figure 6 may include but is not limited to the following steps.
[0201] 601. When the screen is in a folded state, unlocked, and on, the double-click control service registers a target event listener with the gesture service.
[0202] For example, the above-mentioned motion service is also a sub-service thread in the above-mentioned system service process. The gesture service can recognize gesture operations acting on the electronic device.
[0203] In a specific implementation, the double-click control service can obtain the specific screen folding state, specific screen on / off state, and specific screen unlock state of the electronic device. For example, this can be obtained through the process shown in Figure 5 below. For details, please refer to the relevant introduction of Figure 5 below, which will not be detailed here.
[0204] After the double-click control service obtains the specific screen folding state, it can determine whether the specific screen folding state is the folded state through comparison. After the double-click control service obtains the specific screen on / off state, it can determine whether the specific screen on / off state is the screen on state through comparison. After the double-click control service obtains the specific screen unlocking state, it can determine whether the specific screen unlocking state is the unlocked state, that is, whether it is the unlocked screen state through comparison.
[0205] In one possible implementation, when the screen is in the expanded state, locked state, or off state, the double-click control service will not register the target event listener with the gesture service. Alternatively, when the screen is in the expanded state, locked state, or off state, if a target event listener has already been registered, the double-click control service can request the gesture service to unregister the registered target event listener. For example, the double-click control service can unregister the registered target event listener by calling the unregisterDeviceListner() function.
[0206] In one possible implementation, when the screen is in a folded state, unlocked, and on, the double-click control service can register a target event listener with the gesture service. Exemplarily, the above-mentioned registration of the target event listener can be implemented by registering the device listener function registerDeviceListner(). Exemplarily, if the target event listener has already been registered when the screen is in a folded state, unlocked, and on, it will not be registered again. Exemplarily, it can be judged by querying whether the listener list in the gesture service includes the information of the target event listener. If included, it indicates that the target event listener has been registered. If not included, it indicates that the target event listener has not been registered.
[0207] For example, in a specific implementation, the target event listener may be registered or unregistered in a device management service (hwExtDeviceManage) in the gesture service. The device management service may obtain input events of gesture operations detected by sensors.
[0208] For example, if any one of the above-mentioned screen folded state, screen on / off state, and screen unlocked state changes, the double-click control service will be triggered to determine whether the screen meets the conditions of folded state, unlocked screen, and screen on, and then determine whether to register or unregister the above-mentioned target event listener.
[0209] 602. The acceleration sensor driver sends a target event to the gesture service.
[0210] After the double-click control service registers the target event listener with the gesture service, if the above-mentioned target operation occurs, the accelerometer of the electronic device can detect the input event of the target operation. For example, in a specific implementation, the system calls the sensor driver so that the hardware accelerometer first receives the input event of the target operation, and then the system calls the accelerometer interface of the hardware abstraction layer to identify the input event as a target event through a preset algorithm. The preset algorithm can be, for example, a back-screen tap (TapTap) algorithm, etc., and the embodiments of the present application do not limit this.
[0211] The accelerometer interface of the hardware abstraction layer recognizes the target event and can send the target event to the gesture service. For example, in a specific implementation, the accelerometer interface of the hardware abstraction layer sends the target event to the device management service in the gesture service.
[0212] 603. The gesture service calls the target event listener to return the target event to the double-click control service.
[0213] After receiving the target event, the gesture service may call the target event listener through the device management service, so that the method in the called target event listener is executed and the target event is returned to the double-click control service.
[0214] 604. The double-click control service starts the back screen service based on the target event.
[0215] After receiving the target event, the double-click control service can start the back screen service. The back screen service is an application provided by an embodiment of the present application to realize the display of the target QR code on the back screen.
[0216] 605. After the back screen service is started, launch the target application.
[0217] After launching the target application, the corresponding QR code can be displayed on the back screen. The implementation process can be exemplified by referring to the relevant description of Figure 7 or Figure 8 below, which will not be described in detail here.
[0218] For example, the target application may be a pre-set application corresponding to the QR code displayed on the back screen by default. Alternatively, in another possible implementation, the target application may be an application corresponding to the QR code selected by the user in the floating window to be displayed on the back screen.
[0219] For example, the following describes the process of the double-click control service obtaining the specific screen folding state, specific screen on / off state, and specific screen unlock state of the electronic device in conjunction with Figure 5. Please refer to the flowchart shown in Figure 5. The process shown in Figure 5 may include but is not limited to the following steps.
[0220] 501. Double-click the control service to register the screen folding status listener with the folding screen management service.
[0221] Exemplarily, the double-click control service is a sub-service thread newly added to the system service process in an embodiment of the present application. The double-click control service can register a screen folding state listener and a screen on / off state listener to obtain the state data monitored by the listener, and / or can query the unlock state of the screen. Among them, the screen folding state listener can monitor whether the screen is in a folded state or an unfolded state. The screen on / off state listener can monitor whether the screen is in a light state or a dark state.
[0222] Registration is to register the listener information with the event source object, so that when the monitored event occurs, the event source object can find the listener in the list of registered listeners and call its method to handle it accordingly.
[0223] The folding screen manager service is also a sub-service thread in the system service process. The folding screen manager service can manage the folding state or the unfolding state of the display screen of the electronic device.
[0224] In a specific implementation, when the electronic device is powered on, the system service process will execute the startOtherServices thread to start various other system sub-services. In an embodiment of the present application, the startOtherServices thread can pull up and start the above-mentioned double-click control service. After the double-click control service is started, the screen folding state listener can be registered with the folding screen management service. So that when the screen of the electronic device is switched from a folded state to an expanded state, and / or when the screen of the electronic device is switched from an expanded state to a folded state, specific status information can be returned to the double-click control service.
[0225] Exemplarily, the double-click control service may register a screen folding state listener with the folding screen management service by registering a folding state function registerfoldablestate().
[0226] 502. The double-click control service registers a broadcast receiver for the screen on / off status with the application activity management service.
[0227] For example, the application activity management service (AMS) is mainly responsible for managing the activity tasks and life cycle of all applications. When an application is opened, the AMS starts the application process and allocates processor resources and memory to the application.
[0228] In an embodiment of the present application, after the double-click control service is started, a broadcast receiver of the screen on / off status can be registered with the AMS. This allows specific screen on / off status information to be returned to the double-click control service when the screen of the electronic device switches from the screen on state to the screen off state, and / or when the screen of the electronic device switches from the screen off state to the screen on state.
[0229] Exemplarily, the broadcast receiver of the screen-off state may be implemented as a screen change receiver (Screenchangereceiver) or the like.
[0230] 503. The double-click control service registers a broadcast receiver of the unlock state with the application activity management service.
[0231] In a specific implementation, the screen unlock status can be broadcast by the system user interface (systemUI) service. For example, the system user interface (systemUI) service is also a sub-service thread within the system service process. The system UI service can implement notification message prompt sounds, system status bar display, navigation bar display, display system or application notification content, lock the screen, control and manage split-screen dividers, and provide management of picture-in-picture mode, etc.
[0232] The App Activity Management Service can receive the unlocked status broadcast. Therefore, after the Double-Tap Control Service is started, it can register a broadcast receiver for the unlocked status with the App Activity Management Service. For example, this broadcast receiver can be called after the App Activity Management Service receives a broadcast from the System User Interface Service to return the unlocked status of the screen to the Double-Tap Control Service.
[0233] 504. The folding screen management service calls the folding status listener to return the screen folding status to the double-click control service.
[0234] In the specific implementation, after the double-click control service registers the screen folding status listener with the folding screen management service, if the screen of the electronic device switches from a folded state to an unfolded state, and / or the screen of the electronic device switches from an unfolded state to a folded state, the folding screen management service calls the folding status listener to return the specific screen folding state to the double-click control service.
[0235] 505. The power management service broadcasts the screen on / off status.
[0236] For example, the power management service (PMS) is also a sub-service thread in the system service process. The PMS is responsible for the power management of the system, such as turning on or off the screen or entering the screen saver.
[0237] In a specific implementation, a service that has registered a receiver for the screen on / off status broadcast by the power management service can receive the broadcasted screen on / off status. The aforementioned application activity management service has registered a receiver for the screen on / off status broadcast, so the application activity management service can receive the broadcasted screen on / off status.
[0238] 506. The application activity management service returns the screen on / off status to the double-click control service.
[0239] In a specific implementation, since the broadcast receiver of the screen on / off status is registered by the double-click control service with the application activity management service, upon receiving the screen on / off status broadcast from the power management service, the application activity management service can transmit the screen on / off status to the broadcast receiver. The broadcast receiver then transmits the specific screen on / off status to the double-click control service.
[0240] 507. The system user interface service broadcasts the screen unlock status.
[0241] 508. The application activity management service returns the screen unlock status to the double-click control service.
[0242] In a specific implementation, the system user interface service can broadcast a specific screen unlock status. After receiving the broadcasted screen unlock status, the AMS can pass the unlock status to the unlock status broadcast receiver. The broadcast receiver can then send the specific screen unlock status to the double-click control service.
[0243] It is understood that there is no restriction on the order in which steps 501 to 503 are executed, and there is no restriction on the order in which steps 504 to 508 are executed. Furthermore, the description of the double-click control service obtaining the screen folding state, screen on / off state, and screen unlocking state is merely an example. In a specific implementation, the double-click control service may also obtain this status information through a callback function or other means, which is not limited in this embodiment of the present application.
[0244] Exemplarily, the process of pulling up the target application to display the corresponding QR code on the back screen is described below with reference to FIG. 7 and FIG. 8 .
[0245] In one possible implementation, the target application can be launched to display the corresponding QR code on the back screen through the process shown in Figure 7. The process shown in Figure 7 includes but is not limited to the following steps.
[0246] 701. The back screen service sends a message to the application activity management service to pull up the target QR code by calling the startActivity function.
[0247] For example, the target QR code is the QR code displayed on the back screen by default or the QR code selected by the user to be displayed on the back screen. The user interface of the target QR code can be displayed by starting an application activity.
[0248] The message sent to AMS can be carried in an Intent parameter. The Intent parameter specifies the activity to be launched (referred to as the target activity). The Intent parameter includes a data description of the target activity. AMS can parse this Intent parameter to create a corresponding application activity record (ActivityRecord), and then continue the subsequent process of launching the activity.
[0249] In addition, exemplarily, in an embodiment of the present application, the above-mentioned target QR code is required to be displayed on the back screen of the electronic device. The message sent by the above-mentioned back screen service to the AMS also carries the identification information of the sender, that is, the back screen service (such as the application name or a preset unique number, etc.). Therefore, after the above-mentioned AMS receives the above-mentioned message, it can determine whether it is a message sent by the back screen service based on the identification information of the sender in the message. If so, the display area associated with the above-mentioned target Activity is adjusted, and the display area of the target Activity is set to the back screen. Thereby, when a window is subsequently created based on the target Activity to display the above-mentioned target QR code, the display area of the window is the back screen.
[0250] 702. The application activity management service sends a notification to the target application to start the target Activity based on the message. The target Activity can display the target QR code.
[0251] After the AMS creates an ActivityRecord based on the received message, it can first determine whether the application process indicated by the ActivityRecord (i.e., the target application process) exists. If not, it can first start the target application process and then send a notification to the target application to start the target Activity. If the target application process exists, it directly sends a notification to the target application to start the target Activity.
[0252] 703. The target application starts the target Activity based on the notification.
[0253] After receiving the notification from the AMS, the target application creates a corresponding application activity thread (ActivityThread), thereby starting the target Activity.
[0254] Exemplarily, the application activity thread may start the target Activity by calling functions such as onCreate() and onResume().
[0255] 704. The target application creates a view tree of the first window through the target Activity and adds it to the window management service.
[0256] For example, the window management service (WMS) is also a sub-service thread in the above system service process. The WMS can at least implement functions such as window management, window animation, or assist the input system in receiving input events.
[0257] After the target Activity is started, the view tree of the first window can be created through the target Activity and the view tree can be added to the WMS. The first window can display the target QR code. For example, the first window displays the user interface of the target application, which includes the target QR code. For example, if the target QR code is a payment code of an application, then the first window displays the payment code interface of the application. For another example, if the target QR code is a boarding code of an application, then the first window displays the boarding code interface of the application. It can be understood that this is only an example and does not constitute a limitation to the embodiments of the present application.
[0258] Exemplarily, adding the view tree of the first window to the window management service can be achieved by calling the setview() function. Exemplarily, the setview() function can call the addwindow() function to add the view tree of the first window to the window management service. In addition, the setview() function can also call the requestlayout() function to layout the first window.
[0259] 705. The window management service requests a vertical synchronization Vsync signal from the interface mapping service.
[0260] For example, the surface mapping service (Surfaceflinger) is also a system service that can assist and cooperate with WMS to implement window management.
[0261] After adding the view tree to the WMS, the WMS can request a vertical synchronization (Vsync) signal from the interface mapping service to refresh the screen. The VSync signal synchronizes the frames per second (FPS) and the screen refresh rate to avoid screen tearing. Without the VSync signal, when rendering frame data quickly, the screen refresh rate cannot keep up, and a frame may be displayed while another frame is being triggered, resulting in screen tearing.
[0262] 706. The interface mapping service returns a notification of a Vsync signal to the target application.
[0263] When the next VSync signal arrives, the interface mapping service returns a notification of the Vsync signal to the target application.
[0264] 707 . The target application calls a rendering module to draw a first window in response to the Vsync signal.
[0265] After receiving the notification, the target application can call the rendering module, for example, call ViewRootlmpl#performTraversals() function to draw the first window. Exemplarily, the performTraversals() function can call functions such as performdraw() to draw the first window.
[0266] 708. The target application sends the drawn first window to the interface mapping service.
[0267] After obtaining the drawn first window, the target application may send the first window to the interface mapping service.
[0268] 709. The interface mapping service synthesizes the content of the first window into a graphic.
[0269] After receiving the drawn first window, the interface mapping service may synthesize the first window into a graphic, wherein the synthesized graphic includes the target QR code.
[0270] 7010. The interface mapping service sends the synthesized graphics to the display management service.
[0271] For example, the DisplayManager service is also a system service that can manage the life cycle of window displays.
[0272] 7011. The display management service displays the synthesized graphics on the back screen.
[0273] In step 701, the target activity's display area has been set to the back screen. The first window is the target activity's window, so the display management service displays the graphic synthesized based on the first window on the back screen. This allows the target QR code to be displayed on the back screen.
[0274] In another possible implementation, the target application can be launched to display the corresponding QR code on the back screen through the process shown in Figure 8. The process shown in Figure 8 includes but is not limited to the following steps.
[0275] 801. The back screen service sends a message to the target application to pull up the target QR code by calling the SDK of the target application.
[0276] For example, a software development kit (SDK) is a collection of development tools for creating application software for software packages, software frameworks, hardware platforms, or operating systems. SDK can be used by applications. SDK facilitates the creation of applications through compilers, debuggers, or software frameworks. Alternatively, SDK can provide some files of application program interfaces for a certain programming language, or it may also include complex hardware that can communicate with a certain embedded system. In an embodiment of the present application, the above-mentioned target QR code can be pulled up by calling the SDK of the above-mentioned target application.
[0277] Exemplarily, the back screen service may call the SDK of the target application, and then send a message to pull up the target QR code to the target application through the SDK interface.
[0278] 802. The target application sends a message to AMS to pull up the target QR code by calling the startActivity function.
[0279] After receiving the message from the back screen service, the target application can call the startActivity function in response to the message to send a message to the AMS to pull up the target QR code. The specific implementation can refer to the introduction of step 701 in Figure 7 above, which will not be repeated here.
[0280] 803. The AMS sends a notification to the target application to start the target activity based on the message.
[0281] The target activity can display the target QR code.
[0282] The implementation of this step can refer to the introduction of step 702 in Figure 7 above, and will not be repeated here.
[0283] 804. Display the first window based on the notification by interacting with related threads and modules.
[0284] The implementation of this step can refer to the introduction of steps 703 to 7011 in Figure 7 above, which will not be repeated here.
[0285] It can be understood that the implementation process of pulling up the target application to display the corresponding QR code on the back screen shown in Figures 7 and 8 above is only an example and does not constitute a limitation to the embodiments of the present application.
[0286] In another possible implementation, if the electronic device changes the QR code displayed on the back screen in response to a user's selection, as described in the description of FIG. 4D and FIG. 4E above, the application of the selected QR code can also be launched by referring to the process of FIG. 7 or FIG. 8 above to display the QR code, which will not be described in detail here.
[0287] In another possible implementation, the electronic device does not need to monitor the above-mentioned target events. As long as it determines that the electronic device is in a folded state, the screen is not locked, and the screen is on, the above-mentioned floating window is displayed on the first screen and the above-mentioned target QR code is displayed on the back screen. In this implementation method, after the electronic device executes the process shown in Figure 5 above, the above-mentioned double-click control service can obtain the above-mentioned specific screen folding state, specific screen on and off state, and specific screen unlocking state. Then, if it is determined based on these states that the electronic device is in a folded state, the screen is not locked, and the screen is on, then the above-mentioned floating window can be displayed on the first screen. In addition, the double-click control service will start the back screen service, so that the back screen service pulls up the above-mentioned target application to display the corresponding QR code on the back screen. For details, please refer to step 605 in Figure 6 above, and refer to the relevant introduction of Figure 7 or Figure 8 above, which will not be repeated here.
[0288] In one possible implementation, when the electronic device displays the target QR code on the back screen, the background of the back screen is black. The implementation process of displaying the background of the back screen in black can be referred to Figure 9. The process shown in Figure 9 may include but is not limited to the following steps.
[0289] 901. The back screen service creates a view tree for the second window and adds it to the WMS.
[0290] In a specific implementation, the view tree of the second window can be created through the back screen service and added to the WMS. The second window is displayed on the back screen with a black background.
[0291] Exemplarily, the second window can be a pop-up window (Dialog). When the back screen service creates the second window, the default display area is the back screen. Then, the background of the second window can be set to black through the background setting function. When the second window with a black background is displayed on the back screen, the background of the back screen is also black. Exemplarily, the background setting function can be, for example, a setBackgroundDrawable() function or a setBackground(Drawable background) function, etc., and the embodiments of the present application do not limit this.
[0292] 902. The back screen service requests a vertical synchronous Vsync signal from the interface mapping service.
[0293] After the view tree of the second window is added to the WMS, the WMS can apply to the interface mapping service for a Vsync signal for screen refresh.
[0294] 903. The interface mapping service returns a notification of a Vsync signal to the back screen service.
[0295] When the next VSync signal arrives, the interface mapping service returns a notification of the Vsync signal to the back screen service.
[0296] 904. The back screen service calls the rendering module to draw the second window in response to the Vsync signal.
[0297] After receiving the notification, the back screen service can call the rendering module, for example, call the ViewRootlmpl#performTraversals() method to draw the second window.
[0298] 905. The back screen service sends the drawn second window to the interface mapping service.
[0299] After obtaining the drawn second window, the back screen service may send the second window to the interface mapping service.
[0300] 906. The interface mapping service synthesizes the content of the second window into a graphic.
[0301] After receiving the drawn second window, the interface mapping service may perform graphic synthesis on it.
[0302] 907. The interface mapping service sends the synthesized graphics to the display management service.
[0303] The interface mapping service synthesizes the graphics of the second window and sends the graphics to the display management service for display.
[0304] 908. The display management service displays the synthesized graphics on the back screen.
[0305] The display management service displays the graphics synthesized based on the second window on the back screen, so that the background of the back screen appears black.
[0306] In one possible implementation, if a user interface such as that shown in FIG. 4B (b) or FIG. 4E is to be presented on the back screen, the preset area of the second window can be set to a transparent area (e.g., area 403 shown in FIG. 4B (b) or area 407 shown in FIG. 4E ). The target QR code is displayed in the transparent area. In addition, the corresponding application icon (e.g., the icon 4041 of the first application shown in FIG. 4B (b) or the icon 4081 of the second application shown in FIG. 4E ) and the name of the target QR code (e.g., the name 4042 of the QR code shown in FIG. 4B (b) or the name 4082 of the QR code shown in FIG. 4E ) can also be set at a specified position in the second window.
[0307] Exemplarily, the position and size of the preset area of the second window, as well as the specified position and size of the name of the application icon and QR code displayed in the second window are all pre-set. Exemplarily, it can be set by means of an extensible markup language (XML) layout file or the like, and the embodiments of the present application are not limited to this. Alternatively, in another possible implementation, the position and size of the preset area of the second window may not be pre-set. The display area of the QR code can be dynamically determined based on the position and size of the target QR code to be displayed, and the position and size of the transparent preset area can be determined based on the display area.
[0308] Exemplarily, in a specific implementation, the electronic device may first draw the second window with the black background normally, and then set the preset area to a transparent area by calling a function for setting a transparent area (e.g., srcPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OUT) function, etc.). In addition, the layout file describes the application icon and QR code name displayed at the specified location. Therefore, the application icon and QR code name can be displayed at the specified location based on the layout file.
[0309] Exemplarily, in a specific implementation, the above-mentioned first window displayed on the back screen through Figure 7, Figure 8 or other possible implementation methods is covered by the above-mentioned second window. Since the preset area of the second window is a transparent area and the background is opaque black, and the transparent area happens to be the display area of the target QR code in the first window. In addition, the application icon and the name of the QR code are laid out at the specified position in the second window. Then the user interface seen on the back screen is, for example, the user interface shown in (b) of Figure 4B or Figure 4E above. Exemplarily, the layer setting can be used to make the layer of the first window below the layer of the second window, thereby presenting a display effect in which the first window is covered by the second window.
[0310] In another possible implementation, if a user interface such as that shown in FIG. 4B(b) or FIG. 4E is to be displayed on the back screen, a screenshot of the target QR code in the first window can be taken and the screenshot target QR code can be placed in the preset area of the second window for display. In this implementation, the preset area does not need to be set as a transparent area.
[0311] It will be understood that the above-mentioned implementation method of presenting a user interface such as that shown in (b) of FIG. 4B or FIG. 4E on the back screen is merely an example and does not constitute a limitation to the embodiments of the present application.
[0312] In one possible implementation, if the target QR code displayed on the back screen has been successfully scanned to complete a corresponding payment operation, the electronic device can close the back screen. For example, the electronic device can exit the user interface displaying the target QR code on the back screen and turn it black, or the back screen can display no interface. The following illustrates an exemplary interaction process for closing the back screen with reference to FIG10 . The process shown in FIG10 may include, but is not limited to, the following steps.
[0313] 1001. After the code scanning is completed, the back-screen service displays a floating window on the first screen to prompt the user.
[0314] In one possible implementation, after the target QR code displayed on the back screen is scanned and the corresponding operation is completed, the interface displayed in the first window will jump. After the jump, the preset area of the second window on the back screen no longer displays the target QR code (for example, see the user interfaces of Figures 4F and 4G above). The back screen service can detect this change, thereby notifying that the code has been scanned and the corresponding payment operation has been completed, thereby triggering the closing of the back screen.
[0315] Exemplarily, the back screen service can capture a picture of the user interface displayed on the back screen and then identify the picture. If no QR code is identified in the picture, it is determined that the code scanning is completed. Alternatively, exemplarily, the back screen service can detect elements such as text displayed in the preset area of the back screen. If text such as "Payment successful" or "Scan completed" is detected, it can be determined that the code scanning is completed. Alternatively, exemplarily, the back screen service can call on the existing intelligent capabilities in the system (such as the Android accessibility framework function, etc.) to identify the user interface where the code scanning is completed, and then determine that the code scanning is completed.
[0316] In another possible implementation, the back screen service can pre-set the duration for which the target QR code is displayed on the back screen. If the target QR code is displayed on the back screen for a predetermined duration, it can be determined that the code has been scanned and the corresponding payment operation has been completed, thereby triggering the back screen to close. For example, the predetermined duration can be 10 seconds or 20 seconds, etc., and this embodiment of the application does not limit this.
[0317] In another possible implementation, the back screen service and the target application can be interactively communicated through a bundled service. The target application can sense when the target QR code displayed on the back screen has been scanned and the corresponding operation has been completed. The target application can then notify the back screen service of the scan completion information, triggering the back screen service to turn off the back screen.
[0318] After the back-screen service learns that the code scanning is completed, a floating window can be displayed on the main screen to indicate that the code scanning is completed. For example, the floating window can refer to the floating window 402C shown in Figure 4H or the floating window 402D shown in Figure 4I. For example, the back-screen service can call the window management service WMS to realize the display of the floating window. The implementation process of the back-screen service displaying the floating window on the first screen can refer to the implementation process of the target application displaying the first window on the back screen. The difference is the setting of attributes such as the display area, display position, and interface elements in the window, which will not be described in detail in the embodiments of the present application.
[0319] 1002. The back screen service sets the preset area of the second window displayed on the back screen to black.
[0320] Based on the previous introduction, it can be seen that the second window is a Dialog on the upper layer of the first window displaying the target QR code. In order to display the target QR code on the lower layer, the preset area of the second window is set to a transparent area. After the back screen service is notified that the code scanning is completed, it indicates that there is no need to continue to display the first window on the lower layer. Therefore, the background of the second window on the upper layer can be set to black. That is, the background of the preset area is also set to black. In this way, the first window is completely covered, and the back screen seen by the user is black, as shown in (b) of Figure 4A above.
[0321] 1003. The back screen service calls the window management service to remove the task displayed on the back screen.
[0322] For example, after the back screen service sets the background of the second window to black, optionally, after the floating window indicating the completion of the code scanning displayed on the main screen disappears (based on the previous introduction, it will automatically disappear after a preset time). The back screen service can call the window management service to remove the task displayed on the back screen. That is, remove the window displayed on the back screen.
[0323] For example, the back screen service can call the removeAllTaskForDisplay() function, which in turn calls the window management service to remove the tasks displayed on the back screen. The input parameter of the removeAllTaskForDisplay() function is the identifier of the back screen (displayID). That is, the displayID indicates that the tasks displayed on the back screen are to be removed.
[0324] 1004. The window management service removes the task displayed on the back screen.
[0325] In the specific implementation, the window management service responds to the call and finds the displayContent object instance for the back screen based on the displayID. It then iterates through all tasks within displayContent. During the traversal, it calls the removeImmediately() function to remove the tasks it has traversed. Once the traversal is complete, the tasks displayed on the back screen are also removed.
[0326] 1005. The window management service returns a successful removal result to the back screen service.
[0327] After completing the removal of the task displayed on the back screen, the window management service may return a result of successful removal to the back screen service.
[0328] 1006. The back screen service closes the second window.
[0329] In a specific implementation, since all the tasks or windows displayed on the back screen are removed, the second window covering the upper layer can be closed. For example, the presentation.dismiss() function can be called to close the second window.
[0330] Since all the tasks displayed on the back screen have been removed, after closing the second window, there is no window displayed on the back screen and it is in a black screen state.
[0331] 1007. The back screen service sends a message to the double-click control service to close the back screen.
[0332] After the back screen service closes the second window, it can send a message to the double-click control service to close the back screen, informing the double-click control service that it no longer needs to display the back screen.
[0333] 1008. Double-click the control service to unbind it from the back screen service.
[0334] The double-click control service can respond to the above message of closing the back screen and release the binding relationship with the back screen service. Exemplarily, the double-click control service can release the binding relationship with the back screen service through the ubindservice() function.
[0335] It will be understood that the process shown in FIG10 is merely an example and does not constitute a limitation to the embodiments of the present application.
[0336] To sum up, compared with the existing technology, the method for displaying QR codes provided in the embodiment of the present application can quickly pull up the QR code needed on the back screen for display without interrupting the task currently being performed on the first screen of the electronic device, thereby reducing the operation steps for displaying the corresponding QR code and improving the efficiency of displaying the QR code and user experience.
[0337] An embodiment of the present application also provides an electronic device, which includes one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the method described in the above embodiment.
[0338] An embodiment of the present application also provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, which are used to call computer instructions to enable the electronic device to execute the method described in the above embodiment.
[0339] The embodiments of the present application also provide a computer program product containing instructions. When the computer program product is run on an electronic device, the electronic device executes the method described in the above embodiments.
[0340] An embodiment of the present application further provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute the method described in the above embodiment.
[0341] It is understandable that the various embodiments of the present application can be combined arbitrarily to achieve different technical effects.
[0342] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented 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, all or part of the processes or functions described herein are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may 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 integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive).
[0343] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
[0344] In short, the above description is only an embodiment of the technical solution of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made based on the disclosure of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for displaying a two-dimensional code, characterized in that: Applied to an electronic device, the electronic device comprises a display screen, the display screen comprises a first screen and a second screen, when the display screen is in a folded state, the display directions of the first screen and the second screen are opposite to each other, when the display screen is in an unfolded state, the display directions of the first screen and the second screen are the same, and the first screen and the second screen are two different display areas of the display screen; The display screen is in a folded state, and a first user interface is displayed on the first screen, wherein the first user interface includes an interface of a first application; receiving a first operation of a user at a first time point, and displaying a first QR code of a second application on the second screen in response to the first operation; During the process of displaying the first two-dimensional code on the second screen, displaying the first user interface on the first screen; After the first QR code is scanned, closing the second screen; The display screen is in an expanded state, and a second user interface of the first application is displayed on the display screen, where the second user interface is an interface of the first user interface adapted to the expanded state; At a second time point, a first operation of the user is received, and the first QR code of the second application is not displayed on the second screen.
2. The method according to claim 1, characterized in that The display screen is in a folded state, and the first screen is in a locked state or an off state; At a third time point, a first operation of the user is received, and based on the fact that the first screen is in a locked state or an off-screen state, the first QR code of the second application is not displayed.
3. The method according to claim 1 or 2, characterized in that: The first operation includes an operation of tapping twice on the back side of the first screen.
4. The method according to any one of claims 1 to 3, characterized in that: Before the first screen displays the first user interface, the method further includes: The electronic device is in an unfolded state, and the electronic device displays the second user interface, which does not include the first floating window; The first screen displays a first user interface, including: After the electronic device changes from the unfolded state to the folded state, the electronic device displays the first user interface on a first screen, where the first user interface includes the first floating window, and the first floating window includes a first interface element of the first QR code.
5. The method according to claim 4, characterized in that The method further comprises: When the display screen is in a folded state, the first user interface receives a second operation of the user on the first interface element; In response to the second operation, the first two-dimensional code is displayed on the second screen.
6. The method according to claim 4 or 5, characterized in that: The first interface element includes at least one of an icon and a name of the second application and a type of the first QR code.
7. The method according to claim 3 or 4, characterized in that: The method further comprises: In response to an operation on a pull-down control of the first floating window, the first floating window is expanded and a second interface element of a second QR code of a third application is displayed; A third operation of the user on the second interface element is received, and the second QR code is displayed on the second screen in response to the third operation.
8. The method according to any one of claims 1 to 7, characterized in that: After the first two-dimensional code is scanned, the method further includes: A second floating window is displayed on the first screen, and the second floating window includes indication information that the first two-dimensional code has been scanned.
9. The method according to any one of claims 1 to 8, characterized in that: The receiving a first operation of the user, before displaying a first QR code of the second application on the second screen in response to the first operation, further includes: Acquire first status information of the display screen; When the first state information indicates that the display screen is in a folded state, is not locked, and is on, an input event of the first operation is monitored.
10. The method according to any one of claims 1 to 8, characterized in that: The receiving of the first operation of the user, before the display screen displays the first QR code, further includes: Acquire second state information of the display screen; When the second state information indicates that the display screen is in a target state, canceling the monitoring of the input event of the first operation; the target state includes that the display screen is in an expanded state, a locked state, or an off state.
11. The method according to any one of claims 1 to 10, characterized in that: The displaying a first QR code of a second application on the second screen in response to the first operation includes: In response to the first operation, a target window and a third user interface are displayed on the second screen; the third user interface is a user interface in the second application that includes the first QR code, the target window includes a first area and a second area, the first area is a transparent area, and the second area is a black area, the target window covers the third user interface, and the first QR code and the first area correspond in position.
12. The method according to claim 11, characterized in that The closing of the second screen includes: Setting the first area to black; removing a task window displayed on the second screen, wherein the task window includes the third user interface; Closes the target window.
13. A method for displaying a QR code, characterized in that: Applied to an electronic device, the electronic device comprises a display screen, the display screen comprises a first screen and a second screen, when the display screen is in a folded state, the display directions of the first screen and the second screen are opposite to each other, when the display screen is in an unfolded state, the display directions of the first screen and the second screen are the same, and the first screen and the second screen are two different display areas of the display screen; The display screen is in a folded state, and a user interface and a first floating window of a first application are displayed on the first screen, wherein the first floating window includes a first interface element of a first QR code of a second application; receiving a selection operation of the first interface element by a user at a first time point, and displaying the first QR code on the second screen in response to the selection operation; During the process of displaying the first two-dimensional code on the second screen, displaying the user interface of the first application on the first screen; after the first two-dimensional code is scanned, closing the second screen; When the display screen is in a target state, the display screen does not display the first floating window, and the target state includes the display screen being in an expanded state, a locked state, or an off state.
14. An electronic device, characterized in that: include: A display screen, one or more processors, and one or more memories; the one or more processors are coupled to the display screen and the one or more memories; the one or more memories are used to store computer program code, the computer program code includes computer instructions, when the one or more processors execute the computer instructions, the electronic device executes the method as described in any one of claims 1-12; or, the electronic device executes the method as described in claim 13.
15. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 12; or, when the instruction is executed on an electronic device, the electronic device executes the method as claimed in claim 13.
16. A computer program product comprising instructions, characterized in that When the computer program product runs on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 12; or, when the computer program product runs on an electronic device, the electronic device executes the method as claimed in claim 13.
Citation Information
Patent Citations
Method for displaying two-dimensional code and related electronic equipment
CN119493500A
Display method and related device
CN109889630A
Multi-screen control method and terminal
CN110045939A
Terminal control method and device, terminal and storage medium
CN112019685A
Display control method and electronic equipment
CN117615055A