Method for simulating foldable-screen device and electronic device
By introducing virtual hardware into electronic devices to simulate the form and display effect of foldable screen devices, the problem of inaccurate simulation by existing tools is solved, development costs are reduced and development efficiency is improved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2026-01-26
- Publication Date
- 2026-07-30
AI Technical Summary
Existing developer tools cannot accurately simulate the display effects of foldable screen devices in different forms, making debugging difficult and costly for developers.
By introducing virtual hardware, including virtual sensors and virtual displays, into electronic devices, different forms and display effects of foldable screen devices are simulated. The simulated interface is generated and displayed by utilizing the interaction between the first operating system and the second operating system.
It achieves accurate simulation of the display effect of foldable screen devices without the need for physical foldable screen devices, reducing development costs and improving development efficiency.
Smart Images

Figure CN2026074885_30072026_PF_FP_ABST
Abstract
Description
A method for simulating a foldable screen device and an electronic device
[0001] This application claims priority to Chinese Patent Application No. 202510125108.1, filed on January 26, 2025, entitled "A Method and Electronic Device for Simulating a Foldable Screen Device", and to International Patent Application No. PCT / CN2026 / 072170, filed on January 13, 2026, entitled "A Method and Electronic Device for Simulating a Foldable Screen Device", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of electronic devices, and more specifically, to a method for simulating a foldable screen device and an electronic device. Background Technology
[0003] With the rapid development of the application ecosystem and developer business, developer tools with multi-category device simulation capabilities are becoming increasingly important for developers. Developing once and deploying across multiple platforms also facilitates debugging. In the consumer market, foldable screen devices occupy a significant share. To achieve this, developer software needs to simulate the display of foldable screen devices in different states (such as unfolded, folded, and semi-folded). However, current developer tools offer poor simulation of foldable devices, hindering developers' work. Therefore, how to simulate the display effects of foldable screen devices has become a pressing technical problem. Summary of the Invention
[0004] This application provides a method and electronic device for simulating foldable screen devices, which can realistically simulate the display effects of foldable screen devices in different forms, thus helping developers and improving development efficiency.
[0005] In a first aspect, a method for simulating a foldable screen device is provided. This method is applied to an electronic device including a first operating system and a second operating system. The first operating system runs the second operating system via developer tools and registers virtual hardware within the second operating system. The virtual hardware includes a virtual sensor used to simulate a sensor in the foldable screen device for detecting form. The method includes: the first operating system, in response to a first operation by a user, setting parameters of the virtual sensor to a first parameter, wherein the first parameter corresponds to a first form of the foldable screen device; the second operating system generating a first frame of data based on the first parameter; the second operating system sending the first frame of data to the first operating system; and the first operating system displaying a first simulated interface based on the first frame of data, the first simulated interface used to simulate the interface of the foldable screen device in the first form.
[0006] In this embodiment, the first operating system of the electronic device can register virtual sensors with the second operating system, and by changing the parameters of the virtual sensors, the second operating system can generate frame data based on the parameters of the virtual sensors. The first operating system of the electronic device displays a simulated interface based on the frame data generated by the second operating system. Since the simulated interface is generated based on the frame data of the second operating system, it can effectively simulate the display effect of foldable screen devices in different forms, which is helpful for developers, improves development efficiency, and eliminates the need for developers to use physical foldable screen devices, thus reducing development costs.
[0007] It is understood that the technical solutions provided in this application can generally be applied to scenarios where developers test the display effect of applications in different forms of foldable screen devices when there is no physical foldable screen device. In this case, developers can accurately simulate the interface displayed by the foldable screen device in different states through developer tools.
[0008] It can also be understood that the technical solutions provided in this application embodiment can also be applied to scenarios where developers test the display effect of applications in different forms of foldable screen devices when there is a physical foldable screen device. In this case, developers can connect the physical foldable screen device to a computer and accurately simulate the interface displayed by the foldable screen device in different states through developer tools. In the above process, developers do not need to adjust the form of the physical foldable screen device.
[0009] In conjunction with the first aspect, in some implementations of the first aspect, the virtual hardware further includes a first virtual display screen and a second virtual display screen, wherein the first virtual display screen is used to simulate the outer display screen of the foldable screen device, and the second virtual display screen is used to simulate the inner display screen of the foldable screen device, the foldable screen device being an inwardly foldable screen device. The method further includes: the second operating system controlling the first virtual display screen to be in a first state and controlling the second virtual display screen to be in a second state according to the first parameter; the second operating system sending first instruction information to the first operating system, the first instruction information being used to indicate that the first virtual display screen is in the first state and the second virtual display screen is in the second state; the first operating system displaying a first simulated interface according to the first frame data, including: the first operating system drawing the first frame data on a first drawing display screen according to the first instruction information to display the first simulated interface.
[0010] In conjunction with the first aspect, in some implementations of the first aspect, when the first form is an unfolded state, the first state is a powered-off state and the second state is a powered-on state; when the first form is a folded state, the first state is the powered-on state and the second state is the powered-off state; when the first form is a semi-folded state, the first state is the powered-off state and the second state is the powered-on state.
[0011] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the first operating system, in response to a second operation by a user, setting the parameters of the virtual sensor to a second parameter, the second parameter corresponding to a second form of the foldable screen device; the second operating system generating second frame data based on the second parameter, and controlling the first virtual display screen to be in the second state and controlling the second virtual display screen to be in the first state; the second operating system sending the second frame data and second indication information to the first operating system, the second indication information indicating that the first virtual display screen is in the second state and the second virtual display screen is in the first state; the first operating system destroying the first drawing display screen and creating a second drawing display screen based on the second indication information; and the first operating system drawing the second frame data on the second drawing display screen to display a second simulated interface, the second simulated interface simulating the interface of the foldable screen device in the second form.
[0012] In this embodiment of the application, when the first operating system switches from simulating the first form to simulating the second form, the first operating system can switch between different drawing displays, so that the developer can perceive the change in form and the simulation effect is more realistic.
[0013] In this embodiment, since the first and second simulated interfaces are generated by the second operating system based on the parameters of the virtual sensors, and the first and second simulated interfaces are the same as the display interface of the real foldable screen device, the switching transition is natural and does not appear abrupt.
[0014] In conjunction with the first aspect, in some implementations of the first aspect, the first form is an unfolded state and the second form is a folded state; or the first form is the folded state and the second form is an unfolded state; or the first form is the folded state and the second form is a semi-folded state; or the first form is the semi-folded state and the second form is the folded state.
[0015] In conjunction with the first aspect, in some implementations of the first aspect, the first form is the folded state, the second form is the unfolded state, and the orientation of the second drawing display screen is the portrait orientation. The method further includes: the first operating system responding to a third operation by the user to set the parameters of the virtual sensor to a third parameter, wherein the third parameter corresponds to the third form of the foldable screen device, which is the semi-folded state; the second operating system generating third frame data according to the third parameter; the second operating system sending the third frame data to the first operating system; the first operating system adjusting the orientation of the second drawing display screen to the landscape orientation; and the first operating system drawing the third frame data on the second drawing display screen to display a third simulated interface, wherein the third simulated interface is used to simulate the interface of the foldable screen device in the third form.
[0016] In this embodiment of the application, when the first operating system switches from the simulated unfolded state to the simulated semi-folded state, the first operating system can change the display direction of the drawing display screen, so that the developer can perceive the change in direction and the simulation effect is more realistic.
[0017] In conjunction with the first aspect, in some implementations of the first aspect, the first form is the folded state, the second form is the semi-folded state, and the display direction of the second drawing display screen is the landscape direction. The method further includes: the first operating system responding to a third operation by the user to set the parameters of the virtual sensor to a third parameter, wherein the third parameter corresponds to the third form of the foldable screen device, which is the unfolded state; the second operating system generating a third frame of data based on the third parameter; the second operating system sending the third frame of data to the first operating system; the first operating system adjusting the orientation of the second drawing display screen to the portrait direction; and the first operating system drawing the third frame of data on the second drawing display screen to display a third simulated interface, wherein the third simulated interface is used to simulate the interface of the foldable screen device in the third form.
[0018] In this embodiment of the application, when the first operating system switches from a simulated semi-folded state to a simulated unfolded state, the first operating system can change the display orientation of the drawing display screen, so that the developer can perceive the change in orientation and the simulation effect is more realistic.
[0019] In conjunction with the first aspect, in some implementations of the first aspect, the virtual hardware further includes a first virtual display screen, wherein the first virtual display screen corresponds to the foldable display screen of the foldable screen device, the foldable screen device being an outward foldable screen device, and the first operating system displays a first simulated interface based on the first frame data, including: the first operating system drawing the first frame data on a first drawing display screen to display the first simulated interface.
[0020] In conjunction with the first aspect, in some implementations of the first aspect, the virtual hardware further includes a first virtual display screen, wherein the first virtual display screen is used to simulate the foldable display screen of a tri-fold screen device, and the first operating system displays the first simulated interface based on the first frame data, including: the first operating system draws the first frame data on a first drawing display screen to display the first simulated interface.
[0021] In conjunction with the first aspect, in some implementations of the first aspect, when the first operating system displays the first simulated interface, the size of the first drawing display screen is a first size. The method further includes: the first operating system, in response to a second operation by the user, setting the parameters of the virtual sensor to second parameters, wherein the second parameters correspond to a second form of the foldable screen device; the second operating system generating second frame data based on the second parameters; the second operating system sending the second frame data to the first operating system; the first operating system determining the size of the first drawing display screen to be the second size; and the first operating system drawing the second frame data on the first drawing display screen to display the second simulated interface, the second simulated interface being used to simulate the interface of the foldable screen device in the second form.
[0022] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: the first operating system responding to a second operation by the user to set the parameters of the virtual sensor to a second parameter, wherein the second parameter corresponds to a second form of the foldable screen device; the second operating system generating second frame data based on the second parameter; the second operating system sending the second frame data to the first operating system; the first operating system destroying the first drawing display screen and creating a second drawing display screen; the first operating system drawing the second frame data on the second drawing display screen to display a second simulated interface, the second simulated interface being used to simulate the interface of the foldable screen device in the second form.
[0023] In conjunction with the first aspect, in some implementations of the first aspect, the first virtual display screen includes a first virtual sub-display screen, a second virtual sub-display screen, and a third virtual sub-display screen. The method further includes: displaying a folding avoidance area on the first simulation interface when the first form is that the first virtual sub-display screen and the second virtual sub-display screen are in a semi-folded state and the second virtual sub-display screen and the third virtual sub-display screen are in an unfolded state; or, displaying the folding avoidance area on the first simulation interface when the first form is that the first virtual sub-display screen and the second virtual sub-display screen are in the unfolded state and the second virtual sub-display screen and the third virtual sub-display screen are in the semi-folded state; or, displaying the folding avoidance area on the first simulation interface when the first form is that the first virtual sub-display screen and the second virtual sub-display screen are in the semi-folded state and the second virtual sub-display screen and the third virtual sub-display screen are in the semi-folded state.
[0024] In conjunction with the first aspect, in some implementations of the first aspect, the first virtual display screen includes a first virtual sub-display screen, a second virtual sub-display screen, and a third virtual sub-display screen. The method further includes: displaying a cutout area on the first simulation interface when the first form is that the first virtual sub-display screen and the second virtual sub-display screen are in an unfolded state and the second virtual sub-display screen and the third virtual sub-display screen are in the unfolded state; or, displaying the cutout area on the first simulation interface when the first form is that the first virtual sub-display screen and the second virtual sub-display screen are in a folded state and the second virtual sub-display screen and the third virtual sub-display screen are in the folded state; or, displaying the cutout area on the first simulation interface when the first form is that the first virtual sub-display screen and the second virtual sub-display screen are in a semi-folded state and the second virtual sub-display screen and the third virtual sub-display screen are in the unfold ... the unfolded state. When the virtual sub-display and the second virtual sub-display are in the unfolded state and the second virtual sub-display and the third virtual sub-display are in the semi-folded state, the cutout area is displayed on the first simulation interface; or, when the first form is that the first virtual sub-display and the second virtual sub-display are in the semi-folded state and the second virtual sub-display and the third virtual sub-display are in the semi-folded state, the cutout area is displayed on the first simulation interface; or, when the first form is that the first virtual sub-display and the second virtual sub-display are in the semi-folded state and the second virtual sub-display and the third virtual sub-display are in the folded state, the cutout area is displayed on the first simulation interface.
[0025] In conjunction with the first aspect, in some implementations of the first aspect, when the first form is a semi-folded state, the method further includes: the first operating system displaying a folded avoidance area on the first simulation interface.
[0026] In this embodiment of the application, when simulating the semi-folded state of a foldable screen device, a folding avoidance area can also be displayed, so that developers can avoid setting interface elements in the folding avoidance area when developing applications, ensuring that the application can adapt to different forms of foldable screen devices.
[0027] In conjunction with the first aspect, in some implementations of the first aspect, the virtual hardware further includes a first virtual display screen and a second virtual display screen, wherein the first virtual display screen is used to simulate the outer display screen of the foldable screen device, and the second virtual display screen is used to simulate the inner display screen of the foldable screen device, the foldable screen device is an inwardly foldable screen device, and the first form is an unfolded state or a semi-folded state. The method further includes: the second operating system controlling the first virtual display screen and the second virtual display screen to be in a power-on state according to the first parameter; the second operating system sending third instruction information to the first operating system, the third instruction information being used to indicate that the first virtual display screen and the second virtual display screen are in the power-on state; the first operating system displaying a first simulated interface according to the first frame data, including: the first operating system drawing the first frame data on the first drawing display screen and the second drawing display screen according to the third instruction information to display the first simulated interface, the first simulated interface including a first simulated sub-interface drawn on the first drawing display screen and a second simulated sub-interface drawn on the second drawing display screen.
[0028] In conjunction with the first aspect, in some implementations of the first aspect, the virtual sensor is used to simulate a rotating shaft sensor and / or to simulate a magnetic attraction sensor.
[0029] In conjunction with the first aspect, in some implementations of the first aspect, the first operating system displays a first interface, which is a developer tool interface. The first interface includes a first control, which is associated with the first form, and the first operation is an operation performed on the first control.
[0030] In conjunction with the first aspect, in some implementations of the first aspect, the first operating system, in response to a user's first operation, sets the parameters of the virtual sensor to a first parameter, wherein the first parameter corresponds to a first form of the foldable screen device, including: the first operating system, in response to the first operation, retrieves the first parameter corresponding to the first form from a database; and the first operating system sends the first parameter to the second operating system to configure the parameters of the virtual sensor as the first parameter.
[0031] In a second aspect, an electronic device is provided, comprising one or more processors; one or more memories; the one or more memories storing one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the foregoing aspects or any possible implementation thereof to be performed.
[0032] Thirdly, a computer-readable storage medium is provided, comprising a computer program or instructions that, when executed on a computer, cause the first aspect and any possible implementation of the method of the first aspect to be performed.
[0033] Fourthly, a computer program product is provided, comprising a computer program or instructions that, when executed on a computer, cause the first aspect and any possible implementation of the method of the first aspect to be performed.
[0034] Fifthly, a computer program is provided that, when run on a computer, causes the methods described in the first aspect and any possible implementation thereof to be executed.
[0035] Sixthly, an electronic device according to an embodiment of this application includes modules / units for performing the above aspects or any possible design of the above aspects; these modules / units can be implemented in hardware or implemented by hardware executing corresponding software.
[0036] For the beneficial effects of aspects two through six, please refer to the beneficial effects of aspect one, which will not be repeated here. Attached Figure Description
[0037] Figure 1 is a schematic diagram of the structure of the electronic device provided in an embodiment of this application.
[0038] Figure 2 is a set of GUIs provided in an embodiment of this application.
[0039] Figure 3 is a schematic diagram of the operating system of the electronic device provided in the embodiment of this application.
[0040] Figure 4 is a schematic diagram of the system architecture provided in an embodiment of this application.
[0041] Figure 5 shows a set of GUIs provided in an embodiment of this application.
[0042] Figure 6 shows a set of GUIs provided in an embodiment of this application.
[0043] Figure 7 shows a set of GUIs provided in an embodiment of this application.
[0044] Figure 8 is a schematic diagram of the form of the tri-fold screen device provided in the embodiment of this application.
[0045] Figures 9-10 show a set of GUIs provided in the embodiments of this application.
[0046] Figure 11 is a schematic flowchart of a method for simulating a foldable screen device provided in an embodiment of this application.
[0047] Figure 12 is a schematic diagram of the software architecture provided in an embodiment of this application. Detailed Implementation
[0048] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0049] The terminology used in the following embodiments is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to also include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, “at least one” and “one or more” refer to one, two, or more than two. The term “and / or” is used to describe the relationship between related objects, indicating that three relationships may exist; for example, A and / or B can indicate: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character “ / ” generally indicates that the preceding and following related objects are in an “or” relationship.
[0050] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0051] The following describes an electronic device, a user interface for such an electronic device, and embodiments for using such an electronic device. In some embodiments, the electronic device may be a portable electronic device, such as a laptop computer. In other embodiments, the electronic device may also be a desktop computer.
[0052] For example, Figure 1 shows a schematic diagram of the structure of an electronic device 100. 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, a sensor module 170, a button 180, and a display screen 190, wherein the sensor module 170 includes a touch sensor 170A, etc.
[0053] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0054] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0055] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0056] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0057] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0058] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0059] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0060] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0061] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs a sound signal through an audio device or displays an image or video through the display screen 190. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0062] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0063] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-CDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0064] Electronic device 100 implements display functions through a GPU, a display screen 190, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 190 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0065] Display screen 190 is used to display images, videos, etc. Display screen 190 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, a quantum dot light-emitting diode (QLED), etc.
[0066] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0067] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0068] Touch sensor 170A, also known as a "touch panel," can be located on display screen 190. The touch sensor 170A and display screen 190 together form a touchscreen, also known as a "touch screen." Touch sensor 170A detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 190. In other embodiments, touch sensor 170A may also be located on the surface of electronic device 100, in a different position than display screen 190.
[0069] With the rapid development of the application ecosystem and developer business, developer tools with multi-category device simulation capabilities are becoming increasingly important for developers. Developing once and deploying across multiple platforms also facilitates debugging. In the consumer market, foldable screen devices occupy a significant market share. To achieve this, developer software needs the ability to simulate the display effects of different foldable screen device states (such as unfolded, folded, and semi-folded). In reality, the display effect of the same interface on a foldable screen device may differ in different states. However, current developer tools simulate foldable screen devices poorly, failing to accurately reproduce the display effects of foldable screen devices in different states. This will be explained below with reference to Figure 2.
[0070] Figure 2 shows a set of graphical user interfaces (GUIs).
[0071] As shown in Figure 2(a), the electronic device displays a simulated interface 201 and a status bar 202. The simulated interface 201 is the interface of the foldable screen device simulated by the developer tools, and can also be considered part of the developer tools' interface. The electronic device can display controls 203 and 204 in the status bar, where control 203 corresponds to the unfolded state of the foldable screen device, and control 204 corresponds to the folded state. The electronic device can respond to the user's click on control 203 to simulate the interface displayed when the foldable screen device is in the unfolded state. The electronic device can respond to the user's click on control 204 to simulate the interface displayed when the foldable screen device is in the folded state.
[0072] It should be noted that the GUI shown in Figure 2 can be a simulated debugging scenario for developers. In this scenario, developers can simulate the display interface of a foldable screen device through developer tools without a physical foldable screen device.
[0073] Referring again to Figure 2(a), the electronic device can simulate the desktop display effect when the foldable screen device is in the unfolded state using developer tools. The desktop includes icons 205, 206, 207, 208, 209, and a search bar 210. When the electronic device detects a user click on control 204, it can display the GUI shown in Figure 2(b) in response to that click.
[0074] As shown in Figure 2(b), the electronic device, responding to the user's click on control 204, can simulate the desktop display effect when the foldable screen device is in a folded state. It is clear from the figure that when the electronic device switches from simulating the desktop display effect when the foldable screen is in an unfolded state to simulating the desktop display effect when the foldable screen device is in a folded state, the desktop icons only include icons 205, 206, and 207, while icons 208 and 209 are not present, and the search bar 210 is not fully displayed. However, in reality, when the foldable screen device switches from an unfolded state to a folded state, the number of icons, search bar, and other interface elements on the desktop does not change, and they are all fully displayed. In other words, the electronic device fails to truly simulate the display effect of a foldable screen device switching from an unfolded state to a folded state.
[0075] Similarly, when simulating a foldable screen device switching from a folded state to an unfolded state, the electronic device only stretches the interface and its elements horizontally, which is also inconsistent with reality.
[0076] Furthermore, since both the simulated switch from folded to unfolded state and the simulated switch from unfolded to folded state only involve a change in resolution, the switching process is very abrupt and does not match the actual switching process of foldable screen devices.
[0077] Currently, developers can connect physical foldable screen devices to computers via wired or wireless means. In this case, if the developer changes the form factor of the physical foldable screen device, the computer can display an interface in the corresponding form. However, this method requires developers to purchase foldable screen devices, which are often quite expensive. This raises the barrier for developers to create applications adapted for foldable screen devices, hindering the expansion of the foldable screen device application ecosystem.
[0078] In conclusion, if electronic devices are only simulated using developer tools, the simulation results are poor and do not match reality, which is detrimental to developers' work. On the other hand, if developers use physical foldable devices for development, it increases their financial burden.
[0079] Based on this, the embodiments of this application provide a method for simulating a foldable screen device, which can more realistically simulate a foldable screen device, facilitates development work, and does not require the use of a physical foldable screen device.
[0080] In this embodiment, the electronic device includes a first operating system (or a native operating system) and a second operating system. Based on these two operating systems, the electronic device can include two operating environments: a host and a guest, as shown in Figure 3. The first operating system is the operating system installed on the electronic device, and the second operating system is the operating system installed on a virtual machine or running in a container. The host can provide related services to users based on the hardware of the electronic device and the first operating system. The guest can provide related services to users based on the hardware of the electronic device, virtual hardware, and the second operating system. The virtual hardware can be registered by the first operating system through developer tools. The second operating system is understood as the operating system mounted on the foldable screen device.
[0081] In some embodiments, the first operating system may be a desktop operating system, and the second operating system may be a mobile operating system.
[0082] In this application embodiment, the first operating system and the second operating system are not specifically limited. For example, the first operating system includes, but is not limited to, Windows operating system, macOS, etc., and the second operating system includes, but is not limited to, Android operating system, HarmonyOS operating system, etc.
[0083] In some embodiments, the first operating system and the second operating system may be the same or the same type of operating system. For example, the first operating system and the second operating system may be HarmonyOS. The first operating system may be HarmonyOS for computers (such as desktop computers and laptop computers), and the second operating system may be HarmonyOS for mobile devices (such as mobile phones).
[0084] In this embodiment of the application, the developer tool may be an application in a first operating system, and the developer tool is used to run a second operating system.
[0085] Figure 4 shows a schematic diagram of the system architecture provided in the embodiment of this application. As shown in Figure 4, the system architecture includes an interface triggering layer, a virtual sensor layer, a virtual display screen layer, and a drawing layer.
[0086] The interface trigger layer is located on the first operating system side and is used to provide developers with multiple interactive controls in the developer tools to switch between different forms of foldable screen devices.
[0087] For example, the developer tools include controls #1, #2, and #3, corresponding to the folded, unfolded, and semi-folded states of the foldable screen device, respectively. The electronic device can respond to user clicks on these controls, simulating different forms of the foldable screen device through the developer tools. When simulating different forms of the foldable screen device, the electronic device can not only simulate the changes in display size under different forms, but also the display effects under different forms.
[0088] For example, the developer tools include controls #1 through #9, each corresponding to one of the nine forms of a tri-fold screen device. Electronic devices can respond to user clicks on these controls, simulating different forms of the foldable screen device through the developer tools. When simulating different forms of a tri-fold screen device, the electronic device can not only simulate the changes in screen size under different forms, but also the display effects under different forms.
[0089] The virtual sensor layer is located on the second operating system side. This layer includes one or more virtual sensors, which can correspond to the real sensors in the foldable screen device. The electronic device can simulate the real sensors of the foldable screen device using these virtual sensors; that is, the electronic device can change the parameters of these virtual sensors to simulate the parameters of the real sensors in different configurations of the foldable screen device. This allows the second operating system to generate corresponding frame data based on the parameters of the virtual sensors.
[0090] It is understandable that, for the same form factor of a foldable screen device, the parameters of the virtual sensor and its corresponding real sensor can be the same.
[0091] For example, a foldable screen device can determine its shape by detecting the folding angle using a real hinge sensor. If the folding angle detected by the real hinge sensor is between 30° and 130°, and the folding angle is 90°, the foldable screen device can determine that it is in a semi-folded state. In this embodiment, a virtual hinge sensor can be added. When the electronic device sets the folding angle detected by this virtual hinge sensor to 90°, the second operating system can determine that the foldable screen device is in a semi-folded state and generate corresponding frame data based on the folding angle.
[0092] For example, a foldable screen device can detect whether it is in a folded state using a magnetic sensor. When the foldable screen device is in a folded state, the parameter detected by the magnetic sensor is parameter #1. In this embodiment, a virtual magnetic sensor can be added. When the electronic device sets the parameter detected by this virtual magnetic sensor to parameter #1, the second operating system can determine that the foldable screen device is in a folded state.
[0093] It is understood that, in this embodiment of the application, by registering a virtual sensor corresponding to the real sensor in the second operating system, the second operating system can detect the parameters of the virtual sensor. When the parameters of the virtual sensor change, the second operating system can generate corresponding frame data based on the parameters of the virtual sensor.
[0094] The virtual display layer is located on the second operating system side, and the virtual display layer can include one or more virtual displays to simulate the real display of the foldable screen device.
[0095] For example, a real foldable screen electronic device includes an inner screen and an outer screen. The inner screen is a foldable screen. When the foldable screen device is in a folded state, the inner screen is powered off and the outer screen is powered on. When the foldable screen device is in an unfolded state, the inner screen is powered on and the outer screen is powered off. In this embodiment, virtual display screen #1 and virtual display screen #2 can be added to simulate the outer screen and inner screen, respectively. When the second operating system determines that the device is in a folded state, it controls virtual display screen #1 to power on and virtual display screen #2 to power off. When the second operating system determines that the device is in an unfolded state, it controls virtual display screen #1 to power off and virtual display screen #2 to power on.
[0096] The rendering layer, located on the first operating system side, is used to render and display the virtual interface based on frame data generated by the second operating system. This simulated interface can be understood as the interface displayed on a real foldable screen device.
[0097] The system architecture provided by the embodiments of this application has been described above. The method for simulating a foldable screen device provided by the embodiments of this application will be described below.
[0098] Figure 5 illustrates a set of GUIs provided in an embodiment of this application.
[0099] As shown in Figure 5(a), the electronic device displays a simulated interface 501 and a status bar 502. The simulated interface 501 corresponds to the interface displayed when the foldable screen device is in the unfolded state. When the electronic device displays the simulated interface 501, the parameters corresponding to the virtual sensors are recorded as the first parameter.
[0100] In some embodiments, the first operating system of the electronic device can register the virtual sensor with the second operating system through developer tools. The first operating system of the electronic device can set the parameters of the virtual sensor as a first parameter when the developer tools are first launched, thereby displaying the GUI shown in Figure 5(a).
[0101] In some embodiments, the developer tools include a settings interface in which the developer can set the unfolded state of the simulated foldable screen device, so that the first operating system of the electronic device can set the parameters of the virtual sensor as a first parameter to display the GUI as shown in 5(a).
[0102] Referring again to Figure 5(a), since the simulated interface 501 corresponds to the interface displayed when the foldable screen device is in the unfolded state, the electronic device can also display control 503 in the status bar 502. Control 503 corresponds to the unfolded state of the foldable screen device, and its shape is similar to that of the unfolded foldable screen device. When the electronic device detects a user clicking on control 503, it can display the GUI shown in Figure 5(b).
[0103] As shown in Figure 5(b), in response to a user clicking control 503, the electronic device can display a status bar 504, which displays controls 503, 505, and 506. Control 505 corresponds to the folded state of the foldable screen device, and control 506 corresponds to the half-folded state of the foldable screen device. The shape of control 505 is similar to the folded shape of the foldable screen device, and the shape of control 506 is similar to the half-folded shape of the foldable screen device. When the first operating system of the electronic device detects the user clicking control 505, it can display the GUI shown in Figure 5(c) in response to this operation.
[0104] The first operating system of the electronic device responds to the developer's click on control 505 and can modify the parameters of the virtual sensor to the second parameters. This allows the second operating system to generate and send frame data corresponding to the folded state to the first operating system based on the second parameters. The first operating system can then draw based on the frame data generated by the second operating system to display the GUI shown in Figure 5(c).
[0105] As shown in Figure 5(c), in response to the user's click on the control 505, the electronic device can display a simulated interface 507, which corresponds to the interface displayed when the foldable screen device is in a folded state.
[0106] Referring again to Figure 5(c), the electronic device can also display control 505 in the status bar 502.
[0107] It is understandable that when the foldable screen device is an inward-folding screen device and is in a folded state, the simulated interface 507 can correspond to the interface displayed on the outer display screen of the inward-folding screen device. When the foldable screen device is an outward-folding screen device and is in a folded state, the sub-display screen #1 of the foldable display screen of the outward-folding screen device is used to display the interface, and the simulated interface 507 can correspond to the interface displayed on the sub-display screen #1 of the foldable display screen of the outward-folding screen device.
[0108] When the electronic device detects that the user clicks on control 506, it can display the GUI shown in Figure 5(d) in response to the operation.
[0109] The first operating system of the electronic device responds to the developer's click on control 506 and can modify the parameters of the virtual sensor to the third parameter. This allows the second operating system to generate and send the frame data corresponding to the half-folded state to the first operating system based on the third parameter. The first operating system can then draw based on the frame data generated by the second operating system to display the GUI shown in Figure 5(d).
[0110] As shown in Figure 5(d), the electronic device can display a simulated interface 508 in response to the user's click on the control 506. The simulated interface 508 corresponds to the interface displayed when the foldable screen device is in a semi-folded state.
[0111] Referring again to (d) in Figure 5, when the electronic device displays the simulation interface 508, the folding avoidance area 509 can be displayed on the simulation interface 508.
[0112] Referring again to (d) in Figure 5, the electronic device can also display control 506 in the status bar 502.
[0113] Understandably, in real-world scenarios, when a foldable screen device is in a semi-folded state, the foldable area of the display is bent, making user operation inconvenient and the display effect of interface elements in that area less than ideal. Therefore, when a foldable screen device is in a semi-folded state, controls and other interface elements should not be placed in the foldable area. In this embodiment, by adding a folding avoidance area 508 to the simulated interface 507, developers can avoid placing interface elements in the folding avoidance area 508 when developing applications, ensuring that the application can adapt to different forms of foldable screen devices.
[0114] Comparing Figures 5(a)-(d), we can see that the orientation of simulation interfaces 501 and 507 is portrait orientation, while the orientation of simulation interface 508 is landscape orientation.
[0115] When using a foldable screen device, it may be in landscape or portrait mode. Landscape mode refers to the device's orientation when displayed horizontally. Portrait mode refers to the device's orientation when displayed vertically. In landscape mode, the foldable screen displays horizontal bars, while in portrait mode, the display displays vertical bars.
[0116] Because foldable screen devices come in both landscape and portrait orientations, their display directions are also either horizontal or vertical. In a landscape orientation, the width of the screen is greater than its height. In other words, when the width of the screen is greater than its height, the display direction is called landscape, and the screen appears as horizontal bars. Conversely, in a portrait orientation, the width of the screen is less than its height. In other words, when the width of the screen is less than its height, the display direction is called portrait, and the screen appears as vertical bars.
[0117] In this embodiment, the first operating system of the electronic device can register virtual sensors with the second operating system, and by changing the parameters of the virtual sensors, the second operating system can generate different frame data based on different parameters of the virtual sensors. The first operating system of the electronic device displays a simulated interface based on the frame data generated by the second operating system. Since the simulated interface is generated based on the frame data of the second operating system, it can effectively simulate the display effects of foldable screen devices in different forms, which is helpful for developers and improves development efficiency.
[0118] In the GUI shown in Figure 5, taking the simulated desktop as an example, in some other embodiments of this application, the simulated interface displayed by the electronic device can be the interface of an application running on the foldable screen device, which will be described below with reference to Figure 6.
[0119] Figure 6 illustrates a set of GUIs provided in an embodiment of this application.
[0120] As shown in Figure 6(a), the electronic device displays a simulated interface 601 and a status bar 602. The simulated interface 601 corresponds to the video playback interface displayed when the foldable screen device is in the folded state. When the electronic device displays the simulated interface 601, the parameters corresponding to the virtual sensors are recorded as the first parameter. The electronic device can also display a control 603 in the status bar 602, where the control 603 corresponds to the unfolded state of the foldable screen device.
[0121] When the electronic device’s first operating system detects that the developer has switched to the simulated unfolded state, it can display the GUI shown in Figure 6(b) in response to the operation.
[0122] As shown in Figure 6(b), in response to the developer's operation of switching to the simulated unfolded state, the electronic device can display a simulated interface 604, which corresponds to the video playback interface displayed when the foldable screen device is in the unfolded state, i.e., the video is played in full screen on the simulated interface 604. The electronic device can also display a control 605 in the status bar 602, which corresponds to the unfolded state of the foldable screen device.
[0123] It should be noted that the description of the developer's operation to switch to the simulated unfolded state can be found in the description of Figure 5, and will not be repeated here for the sake of brevity.
[0124] When the electronic device’s first operating system detects that the developer has switched to a simulated semi-folded state, it can display the GUI shown in Figure 6(c) in response to the operation.
[0125] As shown in Figure 6(c), in response to the developer's operation of switching to a simulated half-folded state, the electronic device can display a simulated interface 606, which corresponds to the video playback interface displayed when the foldable screen device is in a half-folded state. The electronic device can also display a control 607 in the status bar 602, which corresponds to the half-folded state of the foldable screen device.
[0126] It should be noted that the description of the developer's operation of switching to the simulated semi-folded state can be found in the description of Figure 5, and will not be repeated here for the sake of brevity.
[0127] Referring again to Figure 6(c), when the electronic device displays the simulated interface 606, this simulated interface 606 may include simulated sub-interfaces 606-1 and 606-2. When the foldable screen device is in a semi-folded state, the foldable display screen may include sub-display screen #1 and sub-display screen #2. Simulated sub-interface 606-1 corresponds to the interface displayed on sub-display screen #1 when the foldable screen device is displaying a video playback interface, and simulated sub-interface 606-2 corresponds to the interface displayed on sub-display screen #2 when the foldable screen device is displaying a video playback interface. Compared to the electronic device in Figure 6(b) playing video in full-screen mode on interface 604, when the electronic device simulates the semi-folded state of the foldable screen device, it can change the interface layout when playing video. That is, the video is played on simulated sub-interface 606-1, and interface elements such as a progress bar, return control, and pause control are displayed on simulated sub-interface 606-2. The interface for playing video when the simulated foldable screen device is in the unfolded, folded, and semi-folded states is the same as the interface displayed on the actual foldable screen device.
[0128] Referring again to Figure 6(c), when the electronic device displays the simulation interface 607, the folding avoidance area 608 can be displayed on the interface 607.
[0129] In Figures 5 and 6 above, the electronic device displays a single simulated interface when simulating different forms of a foldable screen device. However, this application does not impose specific limitations on this. In other embodiments of this application, the electronic device may display two simulated interfaces when simulating the unfolded or semi-folded state of an inward-folding screen device. One simulated interface simulates the outer screen display of the inward-folding screen device, and the other simulates the inner screen display. For example, when a user takes a photo using the rear camera of the foldable screen device, if the foldable screen device is in the unfolded state, a preview interface can be displayed on the outer screen so that the subject can see the preview image, and a shooting interface can be displayed on the inner screen so that the user can take the photo.
[0130] Figure 7 illustrates another set of GUIs provided in the embodiments of this application.
[0131] As shown in Figure 7, the electronic device displays a simulated interface 701, a simulated interface 702, and a status bar 703. Simulated interface 701 corresponds to the interface displayed on the outer screen when the rear camera is activated in the unfolded state of the inward-folding screen device; that is, the electronic device can display a preview image on simulated interface 701. Simulated interface 702 corresponds to the interface displayed on the inner screen when the rear camera is activated in the unfolded state of the inward-folding screen device; that is, the electronic device can display preview images, shooting controls, and other interface elements on the simulated interface.
[0132] The electronic device can also display control 704 in the status bar 703, which corresponds to the expanded state.
[0133] It should be noted that in the example shown in Figure 7, the people in interfaces 701 and 702 may not be actual photos, but rather preset by the developer tools to facilitate the developer's adjustment of camera functions.
[0134] It should also be noted that Figure 7 only shows two simulated interfaces when the electronic device simulates the unfolded state of the foldable screen device. In other embodiments of this application, the electronic device can also display two simulated interfaces when simulating the semi-folded state of the foldable screen device.
[0135] The preceding text, with reference to Figures 5-7, describes an electronic device simulating a dual-folding screen device. However, this application does not specifically limit the embodiments in this way. In other possible embodiments of this application, the electronic device can also simulate a tri-folding screen device, a quadruple-folding screen device, etc. The following text uses an electronic device simulating a tri-folding screen device as an example. A dual-folding screen device refers to an electronic device with one rotating hinge, and a tri-folding screen device refers to an electronic device with two rotating hinges.
[0136] Figure 8 shows a schematic diagram of the form of the tri-fold screen device provided in an embodiment of this application.
[0137] A tri-fold screen device can divide one display screen into three sub-display screens. Two adjacent sub-display screens can be divided into folded, unfolded, and semi-folded states according to the size of the folding angle. Therefore, a tri-fold screen device has a total of nine forms.
[0138] The tri-fold screen device includes sub-display screen 801, sub-display screen 802 and sub-display screen 803. Sub-display screen 801 can also be called the left sub-display screen, sub-display screen 802 can also be called the middle sub-display screen, and sub-display screen 803 can also be called the right sub-display screen.
[0139] When sub-displays 801 and 802 are in the unfolded state, and sub-displays 802 and 803 are in the unfolded state, the configuration of the three-fold screen device can be as shown in Figure 8(a). Here, the unfolded state between two sub-displays can be understood as the angle between the two sub-displays being greater than a threshold value of 1. The configuration of the three-fold screen device shown in Figure 8(a) is referred to as configuration 1 in this embodiment.
[0140] When sub-displays 801 and 802 are in a folded state, and sub-displays 802 and 803 are in an unfolded state, the configuration of the three-fold screen device can be shown in Figure 8(b). Here, the folded state between two sub-displays can be understood as the angle between the two sub-displays being less than threshold 2. It can be understood that when the angle between the two sub-displays is greater than threshold 1 and less than threshold 2, the two sub-displays are in a semi-folded state. The configuration of the three-fold screen device shown in Figure 8(b) is referred to as configuration 2 in this embodiment.
[0141] When sub-displays 801 and 802 are in a folded state, and sub-displays 802 and 803 are in a folded state, the configuration of the triple-fold screen device can be as shown in Figure 8(c). The configuration of the triple-fold screen device shown in Figure 8(c) is referred to as configuration 3 in this embodiment.
[0142] When sub-displays 801 and 802 are in a semi-folded state, and sub-displays 802 and 803 are in an unfolded state, the configuration of the three-fold screen device can be as shown in Figure 8(d). The configuration of the three-fold screen device shown in Figure 8(d) is referred to as configuration 4 in this embodiment.
[0143] When sub-displays 801 and 802 are in the unfolded state, and sub-displays 802 and 803 are in the semi-folded state, the configuration of the three-fold screen device can be as shown in Figure 8(e). The configuration of the three-fold screen device shown in Figure 8(e) is referred to as configuration 5 in this embodiment.
[0144] When sub-displays 801 and 802 are in a semi-folded state, and sub-displays 802 and 803 are in a semi-folded state, the configuration of the three-fold screen device can be as shown in Figure 8(f). The configuration of the three-fold screen device shown in Figure 8(f) is referred to as configuration 6 in this embodiment.
[0145] When sub-displays 801 and 802 are in a folded state, and sub-displays 802 and 803 are in a semi-folded state, the configuration of the triple-fold screen device can be as shown in Figure 8(g). The back area marked in Figure 8(g) is the back region corresponding to sub-display 803. The configuration of the triple-fold screen device shown in Figure 8(g) is referred to as configuration 7 in this embodiment.
[0146] When sub-displays 801 and 802 are in a semi-folded state, and sub-displays 802 and 803 are in a folded state, the configuration of the three-fold screen device can be as shown in Figure 8(h). The configuration of the three-fold screen device shown in Figure 8(h) is referred to as configuration 8 in this embodiment.
[0147] When sub-displays 801 and 802 are in the unfolded state, and sub-displays 802 and 803 are in the folded state, the form of the triple-fold screen device can be as shown in Figure 8(i). The form of the triple-fold screen device shown in Figure 8(i) is referred to as form 9 in this embodiment. The back area marked in Figure 8(i) is the back region corresponding to sub-display 803.
[0148] The method for simulating a foldable screen device provided in this application embodiment can simulate the nine forms of the aforementioned triple-foldable screen device.
[0149] Figures 9 and 10 illustrate a set of GUIs provided in embodiments of this application.
[0150] As shown in Figure 9(a), the electronic device displays a simulated interface 901 and a status bar 902. The simulated interface 901 is used to simulate the form 1 of a tri-fold screen device. When the electronic device displays the simulated interface 901, the parameters corresponding to the virtual sensors are recorded as parameter 1. These virtual sensors include, but are not limited to, hinge sensors and magnetic sensors.
[0151] In some embodiments, the first operating system of the electronic device can register a virtual sensor with the second operating system through developer tools. The first operating system of the electronic device can set the parameters of the virtual sensor to parameter 1 when the developer tools are first launched, thereby displaying the GUI shown in Figure 9(a).
[0152] In some embodiments, the developer tools include a settings interface in which the developer can set the unfolded state of the simulated foldable screen device, so that the first operating system of the electronic device can set the parameters of the virtual sensor to parameter 1 to display the GUI as shown in 9(a).
[0153] For example, electronic devices have a pre-installed database for managing configuration data for different forms of tri-fold screen devices. The configuration data for each form includes, but is not limited to, magnetic attachment status, hinge angle, screen resolution, folding avoidance zone parameters, and punch-hole position data. When the electronic device launches the developer tools, it can automatically or in response to user actions retrieve the configuration data corresponding to form 1 from the database.
[0154] Referring again to Figure 9(a), the electronic device can also mark the location of the cutout on the simulation interface 901, which allows developers to avoid setting interface elements at the cutout location when developing applications.
[0155] Referring again to Figure 9(a), since interface 901 corresponds to the interface displayed when the tri-fold screen device is in form 1, the electronic device can also display control 903 in the status bar 902. Control 903 corresponds to form 1 of the tri-fold screen device, and its shape is similar to that of form 1 of the tri-fold screen device. When the electronic device detects that the user clicks on control 903, it can display the GUI shown in Figure 9(b).
[0156] As shown in Figure 9(b), in response to a user clicking control 903, the electronic device can display a status bar 904, which displays controls 903, 905, 906, 907, 908, 909, 910, 911, and 912. Control 903 corresponds to form 1 of the tri-fold screen device, control 905 to form 2, control 906 to form 3, control 907 to form 4, control 908 to form 5, control 909 to form 6, control 910 to form 7, control 911 to form 8, and control 912 to form 9. When the electronic device's first operating system detects a developer clicking control 905, it can display the GUI shown in Figure 9(c).
[0157] In some embodiments, the first operating system of the electronic device can modify the parameters of the virtual sensor to parameter 2 in response to the developer's click on control 905, so that the second operating system can generate and send frame data corresponding to the folded state to the first operating system according to parameter 2. The first operating system can draw according to the frame data generated by the second operating system to display the GUI shown in Figure 9(c).
[0158] For example, in response to the developer's click on control 905, the first operating system of the electronic device can retrieve the configuration data corresponding to form 2 of the three-fold screen device from the database, and then send the configuration data corresponding to form 2 to the second operating system, so that the parameters of the virtual sensor are parameter 2.
[0159] Similarly, when the first operating system of the electronic device detects a developer's click on control 906, in response to this operation, the GUI shown in Figure 9(d) can be displayed. When the first operating system of the electronic device detects a developer's click on control 907, in response to this operation, the GUI shown in Figure 9(e) can be displayed. When the first operating system of the electronic device detects a developer's click on control 908, in response to this operation, the GUI shown in Figure 9(f) can be displayed. When the first operating system of the electronic device detects a developer's click on control 909, in response to this operation, the GUI shown in Figure 10(a) can be displayed. When the first operating system of the electronic device detects a developer's click on control 910, in response to this operation, the GUI shown in Figure 10(b) can be displayed. When the first operating system of the electronic device detects a developer's click on control 911 or control 912, in response to this operation, the GUI shown in Figure 10(c) can be displayed.
[0160] As shown in Figure 9(c), the electronic device can display a simulated interface 913 in response to the user's click on the control 905. The simulated interface 913 is used to simulate the interface displayed when the tri-fold screen device is in form 2.
[0161] Understandably, in the example shown in Figure 9, the front-facing camera of the simulated tri-fold screen device is positioned on the left sub-display. When the tri-fold screen device is in form 2, the middle and right sub-displays are used to display the corresponding interface content, while the left sub-display is in a black screen state. Therefore, in the example shown in Figure 9(c), the electronic device no longer needs to indicate the location of the punch-hole on the simulated interface 913.
[0162] As shown in Figure 9(d), the electronic device can display a simulated interface 914 in response to the user's click on the control 906. The simulated interface 914 is used to simulate the interface displayed when the tri-fold screen device is in form 3.
[0163] Understandably, in the example shown in Figure 9, the front-facing camera of the simulated tri-fold screen device is positioned on the left sub-display. When the tri-fold screen device is in form 3, the left sub-display is used to display the corresponding interface content, while the middle and right sub-displays are in a black screen state. Therefore, in the example shown in Figure 9(d), the electronic device can indicate the location of the cutout on the simulated interface 914.
[0164] As shown in Figure 9(e), in response to a user's click on control 907, the electronic device can display a simulated interface 915, which simulates the interface displayed when the tri-fold screen device is in form 4. When the tri-fold screen device is in form 4, the three sub-displays of the tri-fold screen device can be used to display the corresponding interface content, so the size of the simulated interface 915 can be the same as the size of the simulated interface 901. Furthermore, since the left and middle sub-displays are in a semi-folded state when the tri-fold screen device is in form 4, user operation in this foldable area is inconvenient, and the display effect of interface elements in this area is not good enough. Therefore, in this embodiment, by adding a folding avoidance area to the simulated interface 915, which corresponds to the foldable areas of the left and middle sub-displays, developers can avoid setting interface elements in the folding avoidance area when developing applications, ensuring that the application can adapt to different forms of the foldable screen device.
[0165] As shown in Figure 9(f), in response to a user's click on control 908, the electronic device can display a simulated interface 916, which simulates the interface displayed when the tri-fold screen device is in form 5. When the tri-fold screen device is in form 5, the three sub-displays of the tri-fold screen device can be used to display the corresponding interface content, so the size of the simulated interface 916 can be the same as the size of the simulated interface 901. Since the middle sub-display and the right sub-display are in a semi-folded state when the tri-fold screen device is in form 5, it is inconvenient for the user to operate in this foldable area, and the display effect of the interface elements in this area is not good enough. Therefore, in this embodiment, by adding a folding avoidance area to the simulated interface 916, which corresponds to the foldable area of the middle sub-display and the right sub-display, developers can avoid setting interface elements in the folding avoidance area when developing applications, ensuring that the application can adapt to different forms of the foldable screen device. As shown in Figure 10(a), in response to a user's click on control 909, the electronic device can display a simulated interface 917, which simulates the interface displayed when the tri-fold screen device is in its foldable state (mode 6). When the tri-fold screen device is in its foldable state (mode 6), its three sub-displays can be used to display corresponding interface content; therefore, the size of the simulated interface 917 can be the same as the size of the simulated interface 901. Since the left and middle sub-displays, as well as the middle and right sub-displays, are in a semi-folded state when the tri-fold screen device is in its foldable state (mode 6), user operation in the foldable area is inconvenient, and the display effect of interface elements in this area is not good enough. Therefore, when the left and middle sub-displays are in a semi-folded state, and when the middle and right sub-displays are in a semi-folded state, no controls or other interface elements should be placed in the foldable area. In this embodiment of the application, by adding two folding avoidance areas to the simulated interface 917, the two folding avoidance areas correspond to the foldable areas of the left sub-display and the middle sub-display, and the foldable areas of the middle sub-display and the right sub-display, respectively. This allows developers to avoid setting interface elements in the folding avoidance areas when developing applications, ensuring that the application can adapt to different forms of foldable screen devices.
[0166] In the examples shown in Figure 9(e), (f) and Figure 10(a), the simulated interface displayed by the electronic device includes three sub-displays, so the electronic device can also identify the location of the cutout.
[0167] As shown in Figure 10(b), in response to a user's click on control 910, the electronic device can display a simulated interface 918, which simulates the interface displayed when the tri-fold screen device is in form 7. When the tri-fold screen device is in form 7, the middle sub-display and the right sub-display of the tri-fold screen device can be used to display the corresponding interface content. Therefore, the size of the simulated interface 918 can be the same as the size of the simulated interface 913. Since the left and middle sub-displays are folded and the middle and right sub-displays are half-folded when the tri-fold screen device is in form 7, it is inconvenient for the user to operate in the foldable areas corresponding to the middle and right sub-displays in this state, and the display effect of the interface elements in this area is not good enough. Therefore, in this embodiment, by adding a folding avoidance area to the simulated interface 918, which corresponds to the foldable areas of the middle and right sub-displays, developers can avoid setting interface elements in the folding avoidance area when developing applications, ensuring that the application can adapt to different forms of the foldable screen device.
[0168] As shown in Figure 10(c), in response to a user clicking control 911 or control 912, the electronic device can display a simulated interface 919. This simulated interface 919 simulates the interface displayed when the tri-fold screen device is in form 8 or form 9. When the tri-fold screen device is in form 8 or form 9, the left sub-display of the tri-fold screen device can be used to display the corresponding interface content; therefore, the size of the simulated interface 919 can be the same as the size of the simulated interface 914.
[0169] Understandably, in the example shown in Figure 10, the front-facing camera of the simulated tri-fold screen device is positioned on the left sub-display. When the tri-fold screen device is in form 8 or form 9, the left sub-display is used to display the corresponding interface content, while the middle and right sub-displays are in a black screen state. Therefore, in the example shown in Figure 10(c), the electronic device can mark the location of the cutout on the simulated interface 919.
[0170] The above section introduced the method for simulating a foldable screen device provided in the embodiments of this application, using a GUI. The following section will introduce the method for simulating a foldable screen device provided in the embodiments of this application, using a flowchart.
[0171] Figure 11 shows a schematic flowchart of a method for simulating a foldable screen device provided in an embodiment of this application. This method can be executed by an electronic device or by a component of the electronic device (e.g., a processor, a chip system, etc.). The following description takes an electronic device as the executing entity. As shown in Figure 11, the method 1100 includes:
[0172] S1101, the first operating system of the electronic device responds to the first operation by setting the parameters of the virtual sensor to the first parameter.
[0173] As mentioned above, the first operating system can register virtual hardware with the second operating system through developer tools. This virtual hardware includes virtual sensors. The electronic device can respond to the user's first operation by setting the parameters of the virtual sensors to a first parameter, which corresponds to the first form of the foldable screen device.
[0174] In some embodiments, the first operation is the operation of the developer launching the developer tools.
[0175] When the first operating system of the electronic device detects the operation of launching the developer tools, it can launch the developer tools and register the virtual sensor with the second operating system through the developer tools. In this way, the first operating system can set the parameters of the virtual sensor as the first parameter.
[0176] In some embodiments, the first operation is an operation performed by the developer in the settings interface of the developer tool to simulate the first form of the foldable screen device.
[0177] The developer tools include a settings interface where developers can set the first form of the simulated foldable screen device, so that the first operating system of the electronic device can set the parameters of the virtual sensors as the first parameters.
[0178] In some embodiments, the first operation is an operation performed by the developer on the first control.
[0179] The first control corresponds to the first form of the foldable screen device. Before generating the first parameters of the virtual sensor, the first operating system of the electronic device can generate the second parameter of the virtual sensor. This second parameter corresponds to the second form of the foldable screen device, meaning that the simulated interface currently displayed by the first operating system of the electronic device is used to simulate the interface when the foldable screen device is in the second form. When the first operating system of the electronic device detects a user's operation on the first control (such as clicking the first control), in response to this operation, it can set the parameter of the virtual sensor to the first parameter.
[0180] For example, the first control can be control 503, control 505 or control 506 as shown in Figure 5, and the first operation can be the developer clicking on control 503, control 505 or control 506.
[0181] In some possible embodiments, the electronic device includes a database for managing configuration data for different forms of the foldable screen device. The configuration data for each form includes, but is not limited to, magnetic attachment status, hinge angle, screen resolution, folding avoidance zone parameters, and punch-hole position data. When the electronic device launches the developer tools, it can automatically or in response to the user's first operation determine the first form corresponding to the first operation, and then retrieve the configuration data corresponding to the first form, i.e., the first parameters, from the database.
[0182] Table 1 illustrates the configuration data for a tri-fold screen device. It should be noted that the configuration data shown in Table 1 is merely an example and should not be construed as a specific limitation on the embodiments of this application.
[0183] Table 1. Parameters of different forms of tri-fold screen devices
[0184] In Table 1, magnetic state 1 refers to the magnetic state corresponding to the left and middle sub-displays of the tri-fold screen device, magnetic state 2 refers to the magnetic state corresponding to the middle and right sub-displays of the tri-fold screen device, pivot angle 1 refers to the pivot angle corresponding to the left and middle sub-displays, pivot angle 2 refers to the pivot angle corresponding to the middle and right sub-displays, and magnetic state "open" can be understood as the state of the magnetic sensor when the two sub-displays are in the unfolded or semi-folded state. Similarly, magnetic state "closed" can be understood as the state of the magnetic sensor when the two sub-displays are in the folded state, position 1 refers to the foldable area corresponding to the left and middle sub-displays, position 2 refers to the foldable area corresponding to the middle and right sub-displays, and position 3 refers to the cutout position of the left sub-display. Taking Form 1 as an example, when the three-fold screen device is in Form 1, the left sub-display and the middle sub-display are in the unfolded state, and the middle sub-display and the right sub-display are in the unfolded state. Therefore, magnetic state 1 is open, magnetic state 2 is open, hinge angle 1 is 180°, hinge angle 2 is 180°, screen resolution is 2232×3184, there is no folding avoidance area, and there is punch-hole data.
[0185] Based on Table 1 above, after determining the corresponding form, the first operating system of the electronic device can query the corresponding configuration data, i.e., the first parameter, from the table, and then send the first parameter to the second operating system to configure the parameters of the virtual sensor as the first parameter.
[0186] In this application embodiment, the method by which the first operating system sends the first parameter to the second operating system is not specifically limited.
[0187] For example, the first operating system and the second operating system can share memory 1, and the first operating system can write the first parameter into the shared memory 1.
[0188] For example, the first operating system may send an interrupt notification to the second operating system, the interrupt notification including a first parameter.
[0189] S1102, the second operating system generates the first frame of data based on the first parameter.
[0190] The second operating system includes a driver program corresponding to the virtual sensor, enabling it to detect changes in the virtual sensor's parameters. When the virtual sensor's parameter is a first parameter, the second operating system can read this first parameter and generate a first frame of data based on it.
[0191] It is understandable that the first frame data generated by the second operating system in S1102 is the same as the frame data generated by the operating system of the foldable screen device based on the first parameters of the sensor of the foldable screen device in the real case.
[0192] S1103, the second operating system sends the first frame of data to the first operating system.
[0193] Correspondingly, the first operating system receives the first frame of data sent by the second operating system.
[0194] S1104, the first operating system displays the first simulated interface based on the first frame of data.
[0195] The first simulated interface is used as the display interface for the foldable screen device in its first form.
[0196] For example, as shown in Figure 5(a), the first operating system of the electronic device can display a simulated interface 501, which corresponds to the interface displayed when the foldable screen device is in the unfolded state.
[0197] In this embodiment, the first operating system of the electronic device can register virtual sensors with the second operating system, and by changing the parameters of the virtual sensors, the second operating system can generate frame data based on the parameters of the virtual sensors. The first operating system of the electronic device displays a simulated interface based on the frame data generated by the second operating system. Since the simulated interface is generated based on the frame data of the second operating system, it can effectively simulate the display effect of foldable screen devices in different forms, which is helpful for developers, improves development efficiency, and eliminates the need for developers to use physical foldable screen devices, thus reducing development costs.
[0198] In this embodiment, when the developer has a physical foldable screen device and connects it to an electronic device, the electronic device can still simulate the interface displayed in different forms of the foldable screen using the method described above. This eliminates the need for the developer to manually change the form of the physical foldable screen device, thus extending the lifespan of the foldable screen device.
[0199] In some embodiments, the virtual hardware further includes a first virtual display screen and a second virtual display screen, wherein the first virtual display screen corresponds to the outer display screen of the foldable screen device, and the second virtual display screen corresponds to the inner display screen of the foldable screen device, and the foldable screen device is an inner foldable screen device. In other words, in this embodiment, the first virtual display screen is registered with the second operating system to simulate the outer display screen of the foldable screen device, and the second virtual display screen is registered to simulate the inner display screen of the foldable screen device. It is understood that when the foldable screen device is an inner foldable screen device and is in a folded state, the outer display screen of the foldable screen device is powered on, and the inner display screen is powered off. When the foldable screen device is an inner foldable screen device and is in an unfolded or semi-folded state, the outer display screen of the foldable screen device is powered off, and the inner display screen is powered on, or both the outer and inner display screens are powered on. The sizes of the first virtual display screen and the second virtual display screen can be the same as the sizes of the outer and inner display screens, respectively.
[0200] Since the virtual hardware includes a first virtual display and a second virtual display, the corresponding first operating system can include a drawing display #1 and a drawing display #2, where drawing display #1 corresponds to the first virtual display and drawing display #2 corresponds to the second virtual display. The first operating system can draw a frame data display simulation interface on one of the drawing display displays. When the power-on / off states of the first and second virtual displays change, the first operating system can destroy the old drawing display and recreate a new one to draw the frame data. The drawing display can be understood as a window (Windows) used to carry the frame data. After receiving the frame data, the first operating system can draw the frame data on the drawing display through a drawing service.
[0201] Understandably, since the first virtual display screen and the second virtual display screen have different sizes, the sizes of the drawing display screen #1 and the drawing display screen #2 are also different.
[0202] Since the virtual hardware includes a first virtual display screen and a second virtual display screen, the second operating system can control the power-on and power-off states of the first and second virtual display screens based on the first parameters of the virtual sensors, and can send instruction information to the first operating system to indicate the power-on and power-off states of the first and second virtual display screens. The first operating system can determine the drawing display screen based on the instruction information and draw frame data on the determined drawing display screen.
[0203] In summary, method 1100 also includes:
[0204] The second operating system controls the first virtual display screen to be in a first state and controls the second virtual display screen to be in a second state based on the first parameter.
[0205] The second operating system sends a first instruction message to the first operating system.
[0206] Correspondingly, the first operating system receives the first instruction information sent by the second operating system. The first instruction information is used to indicate that the first virtual display screen is in a first state and to control the second virtual display screen to be in a second state.
[0207] S1104, the first operating system displays the first simulated interface based on the first frame of data, including:
[0208] The first operating system draws a first frame of data on the first drawing display screen according to the first instruction information to display the first simulation interface.
[0209] When the first operating system draws the first frame of data on the first display screen according to the first instruction information, it may include the following possible implementation methods:
[0210] In one possible implementation, the first parameter corresponds to a folded state, and the second operating system can control the first virtual display screen to be powered on and the second virtual display screen to be powered off. The second operating system can also send instruction information #1 to the first operating system, which indicates that the first virtual display screen is powered on and the second virtual display screen is powered off. After receiving instruction information #1, the first operating system can draw a first frame of data on the drawing display screen #1 to display the first simulated interface.
[0211] In one possible implementation, the first state corresponding to the first parameter is a semi-folded state. The second operating system can control the first virtual display screen to be in a power-off state and the second virtual display screen to be in a power-on state. The second operating system can also send instruction information #2 to the first operating system, which indicates that the first virtual display screen is in a power-off state and the second virtual display screen is in a power-on state. After receiving instruction information #2, the first operating system can draw the first frame of data on the drawing display screen #2 to display the first simulated interface.
[0212] In one possible implementation, the first state corresponding to the first parameter is an expanded state. The second operating system can control the first virtual display screen to be in a power-off state and the second virtual display screen to be in a power-on state. The second operating system can also send instruction information #2 to the first operating system, which indicates that the first virtual display screen is in a power-off state and the second virtual display screen is in a power-on state. After receiving instruction information #2, the first operating system can draw the first frame of data on the drawing display screen #2 to display the first simulated interface.
[0213] As described above, when the first form is an unfolded state or a semi-folded state, both the first virtual display screen and the second virtual display screen can be powered on. The second operating system can then send indication information to the first operating system to indicate that both the first and second virtual display screens are powered on. When the first operating system draws the first frame of data on the first display screen based on this indication information, the following possible implementation methods may be included:
[0214] In one possible implementation, the first state corresponding to the first parameter is an expanded state, and the second operating system can control the first and second virtual display screens to be powered on. The second operating system can also send instruction information #3 to the first operating system, which indicates that the first and second virtual display screens are powered on. After receiving instruction information #3, the first operating system can draw a first frame of data on drawing display screen #1 and drawing display screen #2 to display two simulated interfaces. These two simulated interfaces can be understood as simulated sub-interfaces of the first simulated interface; that is, the first simulated interface includes the simulated sub-interface drawn on drawing display screen #1 and the simulated sub-interface drawn on drawing display screen #2. The first drawing display screen includes drawing display screen #1 and drawing display screen #2.
[0215] In one possible implementation, the first form corresponding to the first parameter is a semi-folded state, and the second operating system can control the first and second virtual display screens to be powered on. The second operating system can also send instruction information #3 to the first operating system, which indicates that the first and second virtual display screens are powered on. After receiving instruction information #3, the first operating system can draw the first frame of data on drawing display screen #1 and drawing display screen #2 to display two simulated interfaces. These two simulated interfaces can be understood as simulated sub-interfaces of the first simulated interface. The first drawing display screen includes drawing display screen #1 and drawing display screen #2.
[0216] It should be noted that, as described above, when the first state is either unfolded or semi-folded, the first operating system can draw frame data on the drawing display screen #2 to display the simulated interface. Specifically, when the first state is unfolded, the display direction of the drawing display screen #2 can be portrait orientation, meaning the simulated interface is displayed as vertical bars. When the first state is semi-folded, the display direction of the drawing display screen #2 can be landscape orientation, meaning the simulated interface is displayed as horizontal bars. In other words, in these embodiments, the folded state corresponds to one drawing display screen, and the semi-folded and unfolded states correspond to one drawing display screen.
[0217] It should also be noted that in some other embodiments, when the first form is in an unfolded state, the first operating system can draw frame data on the drawing display screen #2 to display the simulated interface; when the first form is in a semi-folded state, the first operating system can draw frame data on the drawing display screen #3 to display the simulated interface. In other words, in these embodiments, each form can correspond to a separate drawing display screen.
[0218] In some embodiments, the method 1100 further includes:
[0219] The first operating system responds to the user's second operation by setting the parameters of the virtual sensor to the second parameter.
[0220] The second parameter corresponds to the second form of the foldable screen device, where the first form is an unfolded state and the second form is a folded state, or the first form is a folded state and the second form is an unfolded state, or the first form is a folded state and the second form is a semi-folded state, or the first form is a semi-folded state and the second form is a folded state.
[0221] The second operating system generates the second frame data based on the second parameter, and controls the first virtual display screen to be in the second state and controls the second virtual display screen to be in the first state.
[0222] The second operating system sends a second frame of data and a second instruction message to the first operating system. The second instruction message is used to indicate that the first virtual display screen is in a second state and the second virtual display screen is in the first state.
[0223] The first operating system destroys the first drawing display screen and creates a second drawing display screen according to the second instruction information.
[0224] The first operating system draws a second frame of data on the second drawing display to show the second simulation interface, which is used to simulate the interface of the foldable screen device in the second form.
[0225] The second operating system switching the state of the first virtual display screen and the second virtual display screen, the first operating system destroying the first drawing display screen and creating the second drawing display screen, and drawing the second frame of data on the second drawing display screen can include the following possible implementation methods:
[0226] In one possible implementation, the first state corresponding to the first parameter is a folded state, and the second state corresponding to the second parameter is an unfolded state. The second operating system can control the first virtual display screen to change from a power-on state to a power-off state and the second virtual display screen to change from a power-off state to a power-on state. The second operating system can also send instruction information #2 to the first operating system, which indicates that the first virtual display screen is in a power-off state and the second virtual display screen is in a power-on state. After receiving instruction information #2, the first operating system can destroy the drawing display screen #1 and create the drawing display screen #2, and draw a second frame of data on the drawing display screen #2 to display the second simulated interface. In this possible implementation, the drawing display screen #1 is the first drawing display screen, and the drawing display screen #2 is the second drawing display screen.
[0227] For example, taking Figure 5 as an example, the electronic device can first display a simulated interface 507. When the operation of the developer clicking the control 505 is detected, the status bar 504 can be displayed. When the operation of the developer clicking the control 503 is detected, the simulated interface 507 can be switched to the simulated interface 501.
[0228] In one possible implementation, the first state corresponding to the first parameter is a folded state, and the second state corresponding to the second parameter is a semi-folded state. The second operating system can control the first virtual display screen to change from a power-on state to a power-off state and the second virtual display screen to change from a power-off state to a power-on state. The second operating system can also send instruction information #2 to the first operating system, which indicates that the first virtual display screen is in a power-off state and the second virtual display screen is in a power-on state. After receiving instruction information #2, the first operating system can destroy the drawing display screen #1 and create a drawing display screen #2, and draw a second frame of data on the drawing display screen #2 to display the second simulated interface. In this possible implementation, the drawing display screen #1 is the first drawing display screen, and the drawing display screen #2 is the second drawing display screen.
[0229] For example, taking Figure 5 as an example, the electronic device can first display a simulated interface 507. When the operation of the developer clicking the control 505 is detected, the status bar 504 can be displayed. When the operation of the developer clicking the control 506 is detected, the simulated interface 507 can be switched to the simulated interface 508.
[0230] In one possible implementation, the first state corresponding to the first parameter is a semi-folded state, and the second state corresponding to the second parameter is a folded state. The second operating system can control the first virtual display screen to change from a power-off state to a power-on state and the second virtual display screen to change from a power-on state to a power-off state. The second operating system can also send instruction information #1 to the first operating system, which indicates that the first virtual display screen is in a power-on state and the second virtual display screen is in a power-off state. After receiving instruction information #1, the first operating system can destroy the drawing display screen #2 and create the drawing display screen #1, and draw a second frame of data on the drawing display screen #1 to display the second simulated interface. In this possible implementation, the drawing display screen #2 is the first drawing display screen, and the drawing display screen #1 is the second drawing display screen.
[0231] For example, taking Figure 5 as an example, the electronic device can first display a simulated interface 508. When the operation of the developer clicking the control 506 is detected, the status bar 504 can be displayed. When the operation of the developer clicking the control 505 is detected, the simulated interface 508 can be switched to the simulated interface 507.
[0232] In one possible implementation, the first state corresponding to the first parameter is an unfolded state, and the second state corresponding to the second parameter is a folded state. The second operating system can control the first virtual display screen to change from a power-off state to a power-on state and the second virtual display screen to change from a power-on state to a power-off state. The second operating system can also send instruction information #1 to the first operating system, which indicates that the first virtual display screen is in a power-on state and the second virtual display screen is in a power-off state. After receiving instruction information #1, the first operating system can destroy the drawing display screen #2 and create the drawing display screen #1, and draw a second frame of data on the drawing display screen #1 to display the second simulated interface. In this possible implementation, the drawing display screen #2 is the first drawing display screen, and the drawing display screen #1 is the second drawing display screen.
[0233] For example, taking Figure 5 as an example, the electronic device can first display a simulated interface 501. When the operation of the developer clicking the control 503 is detected, the status bar 504 can be displayed. When the operation of the developer clicking the control 505 is detected, the simulated interface 501 can be switched to the simulated interface 507.
[0234] In other embodiments, when the first form is an unfolded state and the second form is a semi-folded state, or the first form is a semi-folded state and the second form is an unfolded state, the second operating system may not change the states of the first virtual display screen and the second virtual display screen. The first operating system may draw the second frame data in the following possible implementations:
[0235] In one possible implementation, the first state corresponding to the first parameter is a semi-folded state, and the second state corresponding to the second parameter is an unfolded state. The second operating system can maintain the state of the first and second virtual displays. The first operating system can destroy the drawing display #3 and create a drawing display #2, and draw a second frame of data on the drawing display #2 to display the second simulated interface. In this possible implementation, the drawing display #3 is the first drawing display, and the drawing display #2 is the second drawing display.
[0236] For example, taking Figure 5 as an example, the electronic device can first display a simulated interface 508. When the operation of the developer clicking the control 506 is detected, the status bar 504 can be displayed. When the operation of the developer clicking the control 504 is detected again, the simulated interface 508 can be switched to the simulated interface 501.
[0237] In one possible implementation, the first state corresponding to the first parameter is an expanded state, and the second state corresponding to the second parameter is a folded state. The second operating system can maintain the state of the first and second virtual displays. The first operating system can destroy the drawing display #2 and create a drawing display #3, and draw a second frame of data on the drawing display #3 to display the second simulated interface. In this possible implementation, the drawing display #2 is the first drawing display, and the drawing display #3 is the second drawing display.
[0238] For example, taking Figure 5 as an example, the electronic device can first display a simulated interface 501. When the operation of the developer clicking the control 503 is detected, the status bar 504 can be displayed. When the operation of the developer clicking the control 505 is detected, the simulated interface 501 can be switched to the simulated interface 507.
[0239] In this embodiment of the application, when the first operating system switches from simulating the first form to simulating the second form, the first operating system can switch between different drawing displays, so that the developer can perceive the change in form and the simulation effect is more realistic.
[0240] In some embodiments, the first state is a folded state, the second state is an unfolded state, and the direction of the second drawing display screen is the portrait direction. The method 1100 further includes:
[0241] The first operating system responds to the user's third operation by setting the parameters of the virtual sensor to the third parameter, which corresponds to the third form of the foldable screen device, namely the semi-folded state.
[0242] The second operating system generates the third frame of data based on the third parameter.
[0243] The second operating system sends a third frame of data to the first operating system.
[0244] The first operating system adjusts the orientation of the second display screen to landscape mode.
[0245] The first operating system draws a third frame of data on the second display screen to display a third simulated interface, wherein the third simulated interface is used to simulate the interface of the foldable screen device in its third form.
[0246] As described above, when the first state is either unfolded or semi-folded, the first operating system can draw frame data on the second rendering display to show the simulated interface. Specifically, when the first state is unfolded, the display orientation of the second rendering display can be portrait, meaning the simulated interface is displayed as vertical bars. When the first state is semi-folded, the display orientation of the second rendering display can be landscape, meaning the simulated interface is displayed as horizontal bars. Therefore, when the first operating system determines to switch from the unfolded state to the semi-folded state, it can adjust the orientation of the second rendering display from portrait to landscape, and then draw a third frame of data on the second rendering display to show the third simulated interface.
[0247] In this embodiment of the application, when the first operating system switches from the simulated unfolded state to the simulated semi-folded state, the first operating system can change the display direction of the drawing display screen, so that the developer can perceive the change in direction and the simulation effect is more realistic.
[0248] In some embodiments, the first form is a folded state, the second form is a semi-folded state, and the display orientation of the second drawing display screen is a landscape orientation. The method 1100 further includes:
[0249] The first operating system responds to the user's third operation by setting the parameters of the virtual sensor to the third parameter, which corresponds to the third form of the foldable screen device, namely the unfolded state.
[0250] The second operating system generates the third frame of data based on the third parameter.
[0251] The second operating system sends a third frame of data to the first operating system.
[0252] The first operating system adjusts the orientation of the second display screen to portrait mode.
[0253] The first operating system draws a third frame of data on the second display screen to display a third simulated interface, wherein the third simulated interface is used to simulate the interface of the foldable screen device in its third form.
[0254] When the first operating system determines that it is switching from the semi-folded state to the unfolded state, it can adjust the orientation of the second drawing display screen from the horizontal orientation to the vertical orientation, and then draw the third frame of data on the second drawing display screen to display the third simulation interface.
[0255] In this embodiment of the application, when the first operating system switches from a simulated semi-folded state to a simulated unfolded state, the first operating system can change the display orientation of the drawing display screen, so that the developer can perceive the change in orientation and the simulation effect is more realistic.
[0256] In the above description, the foldable screen device is taken as an example of an inward-folding screen device. In other embodiments of this application, the foldable screen device can also be an outward-folding screen device or a tri-folding screen device. When the foldable screen device is an outward-folding screen device or a tri-folding screen device, the virtual hardware also includes a first virtual display screen, wherein the first virtual display screen corresponds to the foldable display screen of the foldable screen device. In other words, in the embodiments of this application, the first virtual display screen is registered with the second operating system to simulate the foldable display screen of the foldable screen device. It can be understood that, unlike the inward-folding screen device, the folded state, half-folded state, or unfolded state of the outward-folding screen device corresponds to the same foldable display screen, and the nine forms of the tri-folding screen device correspond to the same foldable display screen, that is, the foldable display screen is always powered on. Therefore, in these embodiments, the first operating system can draw different frame data through one drawing display screen, or it can draw different frame data through multiple drawing display screens.
[0257] Understandably, when the first operating system draws different frame data through a drawing display, it can change the size of that drawing display to correspond to the folded, semi-folded, and unfolded states.
[0258] In some embodiments, when the first operating system displays the first simulated interface, the size of the first drawing display screen is a first size, and the method 1100 further includes:
[0259] The first operating system responds to the user's second operation by setting the parameters of the virtual sensor to the second parameter, which corresponds to the second form of the foldable screen device.
[0260] The second operating system generates the second frame of data based on the second parameter.
[0261] The second operating system sends a second frame of data to the first operating system.
[0262] The first operating system determines the size of the first drawing display screen as the second size.
[0263] The first operating system draws a second frame of data on the first drawing display screen to display a second simulated interface, which is used to simulate the interface of the foldable screen device in its second form.
[0264] One possible implementation involves a first state of folding and a second state of unfolding. The first size can be understood as the size of the interface displayed when the outward-folding screen device is in the folded state, and the second size can be understood as the size of the interface displayed when the outward-folding screen device is in the unfolded state. When the first operating system determines that it is switching from a simulated folded state to a simulated unfolded state, it can adjust the size of the first rendering display screen from the first size to the second size, and render a second frame of data on the first rendering display screen to simulate the interface of the folded screen device in the unfolded state.
[0265] One possible implementation involves a first state of unfolded operation and a second state of folded operation. The first size can be understood as the size of the interface displayed when the outward-folding screen device is in the unfolded state, and the second size can be understood as the size of the interface displayed when the outward-folding screen device is in the folded state. When the first operating system determines that it is switching from a simulated unfolded state to a simulated folded state, it can adjust the size of the first rendering display screen from the first size to the second size, and render a second frame of data on the first rendering display screen to simulate the interface of the folded screen device in the folded state.
[0266] One possible implementation is that the first form is one of the nine forms of a tri-fold screen device, and the second form is another of the nine forms. As shown in Figure 9 and Table 1, the size of the simulated interface can be the same or different in the nine forms of the tri-fold screen device. Therefore, the first size and the second size can be the same or different.
[0267] In some embodiments, the virtual hardware further includes a first virtual display screen, wherein the first virtual display screen corresponds to the foldable display screen of a foldable screen device, and the foldable screen device is an outward foldable screen device. The method 800 further includes:
[0268] The first operating system responds to the user's second operation by setting the parameters of the virtual sensor to the second parameter, which corresponds to the second form of the foldable screen device.
[0269] The second operating system generates the second frame of data based on the second parameter.
[0270] The second operating system sends a second frame of data to the first operating system.
[0271] The first operating system destroys the first drawing display and creates a second drawing display.
[0272] The first operating system draws a second frame of data on the second drawing display to show the second simulation interface, which is used to simulate the interface of the foldable screen device in the second form.
[0273] As described above, the first virtual display screen is always powered on. The first operating system can draw different frame data through multiple drawing displays. When the first operating system determines that it is switching from the first simulated mode to the second simulated mode, it can destroy the first drawing display screen and create the second drawing display screen, and draw the second frame data on the second drawing display screen to display the second simulated interface.
[0274] In some embodiments, the first virtual display screen includes a first virtual sub-display screen, a second virtual sub-display screen, and a third virtual sub-display screen, and method 1100 further includes:
[0275] In the first configuration where the first virtual sub-display and the second virtual sub-display are in a semi-folded state and the second and third virtual sub-displays are in an unfolded state, a folded avoidance zone is displayed on the first simulation interface; or...
[0276] In the first configuration where the first virtual sub-display and the second virtual sub-display are in an unfolded state and the second and third virtual sub-displays are in a semi-folded state, a folded avoidance zone is displayed on the first simulation interface; or...
[0277] In the first configuration where the first virtual sub-display and the second virtual sub-display are in a semi-folded state, and both the second and third virtual sub-displays are in a semi-folded state, a folding avoidance zone is displayed on the first simulation interface; or,
[0278] In the first configuration where the first virtual sub-display and the second virtual sub-display are in a folded state and the second virtual sub-display and the third virtual sub-display are in a semi-folded state, the folded avoidance zone is displayed on the first simulation interface.
[0279] For example, as shown in examples (e) and (f) in Figure 9 and (a) and (b) in Figure 10, the electronic device can display a folding avoidance zone on the simulation interface.
[0280] In some embodiments, the first virtual display screen includes a first virtual sub-display screen, a second virtual sub-display screen, and a third virtual sub-display screen, and method 1100 further includes:
[0281] When the first virtual sub-display and the second virtual sub-display are both in an unfolded state, and both the second and third virtual sub-displays are in an unfolded state, a cutout area is displayed on the first simulation interface; or, when the first virtual sub-display and the second virtual sub-display are both in a folded state, and both the second and third virtual sub-displays are in a folded state, a cutout area is displayed on the first simulation interface; or, when the first virtual sub-display and the second virtual sub-display are both in a semi-folded state, and both the second and third virtual sub-displays are in an unfolded state, a cutout area is displayed on the first simulation interface; or, when the first virtual sub-display and the second virtual sub-display are both in an unfolded state, and both the second and third virtual sub-displays are in a fold ... When the first virtual sub-display and the second virtual sub-display are in a semi-folded state, a cutout area is displayed on the first simulation interface; or, when the first virtual sub-display and the second virtual sub-display are in a semi-folded state and both the second and third virtual sub-displays are in a semi-folded state, a cutout area is displayed on the first simulation interface; or, when the first virtual sub-display and the second virtual sub-display are in a semi-folded state and both the second and third virtual sub-displays are in a folded state, a cutout area is displayed on the first simulation interface; or, when the first virtual sub-display and the second virtual sub-display are in an unfolded state and both the second and third virtual sub-displays are in a folded state, a cutout area is displayed on the first simulation interface.
[0282] For example, in the examples shown in Figures 9(a), (b), (d)-(f), and Figures 10(a) and (c), the electronic device can display the cut-out area on the simulation interface.
[0283] Figure 12 shows a schematic diagram of the software architecture provided in an embodiment of this application.
[0284] As shown in Figure 12, the host side of the electronic device includes a first operating system, which comprises developer tools, a communication module, and a rendering module. The developer tools are used to run a second operating system and register virtual hardware with it. The communication module is used for data interaction with the second operating system. The rendering module is used to render frame data.
[0285] The second operating system can be divided into multiple layers, including an application layer, a framework layer, a hardware abstraction layer (HAL), a driver layer, and a virtual hardware layer. The application layer of the second operating system can include a series of applications, such as browsers, app stores, cameras, gallery, calendars, call apps, maps, navigation apps, Bluetooth, music, video, SMS, instant messaging applications, etc., which are not limited in the embodiments of this application.
[0286] The framework layer includes sensor services, which provide sensor capabilities to various applications in the application layer. In this embodiment, applications can have different layouts depending on the form factor of the foldable screen device. The applications can sense changes in form factor through the sensor services and then determine the corresponding layout.
[0287] The Hardware Abstraction Layer (HAL) is an interface layer located between the operating system kernel and the hardware circuitry. It encapsulates the underlying hardware drivers and provides a generic interface for the framework layer to call these drivers. The HAL includes a sensor driver interface, which provides a stable sensor capability interface for the framework layer's sensor services.
[0288] The driving layer, which includes the driving of multiple sensors, is used to ensure the normal operation of the sensors.
[0289] The virtual hardware layer includes virtual hardware registered by the first operating system, such as virtual sensors and virtual displays.
[0290] When the first operating system changes the parameters of the virtual sensor, the corresponding driver in the driver layer can receive the virtual sensor parameters and report them to the hardware abstraction layer. The hardware abstraction layer reads the parameters from the driver layer and provides a calling interface for the sensor server in the framework layer. Various applications in the application layer can subscribe to the parameters through the sensor service in the framework layer and can generate corresponding frame data according to the changes in the parameters, so that the workflow is the same as during real switching. Therefore, the first operating system can realistically simulate a foldable screen device.
[0291] The method for simulating a foldable screen device provided in the embodiments of this application has been described in detail above. In the various embodiments of this application, unless otherwise specified or in case of logical conflict, the terminology and / or descriptions between the various embodiments are consistent and can be referenced by each other. The technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.
[0292] The foregoing primarily describes the method for simulating a foldable screen device provided in this application from the perspective of an electronic device. It is understood that, in order to achieve the above functions, the electronic device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0293] This application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the technical solutions described in the above embodiments. Its implementation principle and technical effects are similar to those of the related embodiments described above, and will not be repeated here.
[0294] This application provides a readable storage medium containing instructions that, when executed by an electronic device, cause the electronic device to perform the technical solution described in the above embodiments. The implementation principle and technical effects are similar and will not be repeated here.
[0295] This application provides a chip for executing instructions. When the chip is running, it executes the technical solutions described in the above embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0296] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.
[0297] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0298] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0299] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0300] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0301] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of software products. These computer software products are stored in a storage medium and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0302] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of this application should be included within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be determined by the protection scope of the claims.
Claims
1. A method for simulating a foldable screen device, characterized in that, The method is applied to an electronic device, which includes a first operating system and a second operating system. The first operating system runs the second operating system through developer tools and registers virtual hardware in the second operating system. The virtual hardware includes a virtual sensor, which is used to simulate a sensor used for form detection in a foldable screen device. The method includes: In response to the user's first operation, the first operating system sets the parameters of the virtual sensor to a first parameter, wherein the first parameter corresponds to the first form of the foldable screen device; The second operating system generates the first frame of data based on the first parameter; The second operating system sends the first frame of data to the first operating system; The first operating system displays a first simulated interface based on the first frame data. The first simulated interface is used to simulate the interface of a foldable screen device in the first form.
2. The method according to claim 1, characterized in that, The virtual hardware further includes a first virtual display screen and a second virtual display screen, wherein the first virtual display screen is used to simulate the outer display screen of the foldable screen device, and the second virtual display screen is used to simulate the inner display screen of the foldable screen device, wherein the foldable screen device is an inwardly foldable screen device. The method further includes: The second operating system controls the first virtual display screen to be in a first state and controls the second virtual display screen to be in a second state based on the first parameter; The second operating system sends a first instruction message to the first operating system, the first instruction message being used to indicate that the first virtual display screen is in a first state and the second virtual display screen is in a second state; The first operating system displays a first simulated interface based on the first frame data, including: The first operating system draws the first frame data on the first drawing display screen according to the first instruction information to display the first simulation interface.
3. The method according to claim 2, characterized in that, When the first form is the unfolded state, the first state is the power-down state, and the second state is the power-on state; When the first form is a folded state, the first state is the power-on state, and the second state is the power-off state; When the first form is a semi-folded state, the first state is a power-down state, and the second state is a power-on state.
4. The method according to claim 2 or 3, characterized in that, The method further includes: In response to the user's second operation, the first operating system sets the parameters of the virtual sensor to a second parameter, which corresponds to the second form of the foldable screen device; The second operating system generates a second frame of data based on the second parameter, and controls the first virtual display screen to be in the second state and controls the second virtual display screen to be in the first state; The second operating system sends the second frame data and the second indication information to the first operating system. The second indication information is used to indicate that the first virtual display screen is in the second state and the second virtual display screen is in the first state. The first operating system destroys the first drawing display screen and creates a second drawing display screen according to the second instruction information; The first operating system draws the second frame data on the second drawing display screen to display the second simulated interface, which is used to simulate the interface of the foldable screen device in the second form.
5. The method according to any one of claims 1 to 4, characterized in that, When the first form is a semi-folded state, the method further includes: The first operating system displays a collapsible avoidance area on the first simulation interface.
6. The method according to claim 4, characterized in that, The first form is an unfolded state, and the second form is a folded state; Alternatively, the first form is the folded state, and the second form is the unfolded state; Alternatively, the first form is the folded state, and the second form is the semi-folded state; Alternatively, the first form is the semi-folded state, and the second form is the folded state.
7. The method according to claim 6, characterized in that, The first state is the folded state, the second state is the unfolded state, the direction of the second drawing display screen is the portrait direction, and the method further includes: In response to a third operation by the user, the first operating system sets the parameters of the virtual sensor to a third parameter, wherein the third parameter corresponds to the third form of the foldable screen device, and the third form is the semi-folded state; The second operating system generates the third frame of data based on the third parameter; The second operating system sends the third frame of data to the first operating system; The first operating system adjusts the orientation of the second display screen to landscape mode; The first operating system draws the third frame of data on the second drawing display screen to display a third simulated interface, wherein the third simulated interface is used to simulate the interface of the foldable screen device in the third form.
8. The method according to claim 6, characterized in that, The first form is the folded state, the second form is the semi-folded state, the display orientation of the second drawing display screen is the landscape orientation, and the method further includes: In response to a third operation by the user, the first operating system sets the parameters of the virtual sensor to a third parameter, wherein the third parameter corresponds to the third form of the foldable screen device, and the third form is the unfolded state; The second operating system generates the third frame of data based on the third parameter; The second operating system sends the third frame of data to the first operating system; The first operating system adjusts the orientation of the second display screen to portrait mode; The first operating system draws the third frame of data on the second drawing display screen to display a third simulated interface, wherein the third simulated interface is used to simulate the interface of the foldable screen device in the third form.
9. The method according to claim 1, characterized in that, The virtual hardware also includes a first virtual display screen, wherein... The first virtual display screen is used to simulate the foldable display screen of a foldable screen device, wherein the foldable screen device is an outward foldable screen device. The first operating system displays the first simulated interface based on the first frame data, including: The first operating system draws the first frame data on the first drawing display screen to display the first simulated interface.
10. The method according to claim 1, characterized in that, The virtual hardware further includes a first virtual display screen, wherein the first virtual display screen is used to simulate the foldable display screen of a tri-fold screen device, and the first operating system displays a first simulated interface based on the first frame data, including: The first operating system draws the first frame data on the first drawing display screen to display the first simulated interface.
11. The method according to claim 9 or 10, characterized in that, When the first operating system displays the first simulated interface, the size of the first drawing display screen is a first size, and the method further includes: In response to the user's second operation, the first operating system sets the parameters of the virtual sensor to a second parameter, wherein the second parameter corresponds to the second form of the foldable screen device; The second operating system generates the second frame of data based on the second parameter; The second operating system sends the second frame of data to the first operating system; The first operating system determines the size of the first drawing display screen as the second size; The first operating system draws the second frame data on the first drawing display screen to display the second simulated interface, which is used to simulate the interface of the foldable screen device in the second form.
12. The method according to claim 9 or 10, characterized in that, The method further includes: In response to the user's second operation, the first operating system sets the parameters of the virtual sensor to a second parameter, wherein the second parameter corresponds to the second form of the foldable screen device; The second operating system generates the second frame of data based on the second parameter; The second operating system sends the second frame of data to the first operating system; The first operating system destroys the first drawing display screen and creates a second drawing display screen; The first operating system draws the second frame data on the second drawing display screen to display the second simulated interface, which is used to simulate the interface of the foldable screen device in the second form.
13. The method according to claim 10, characterized in that, The first virtual display screen includes a first virtual sub-display screen, a second virtual sub-display screen, and a third virtual sub-display screen. The method further includes: When the first configuration is characterized by the first virtual sub-display and the second virtual sub-display being in a semi-folded state and the second virtual sub-display and the third virtual sub-display being in an unfolded state, a folding avoidance zone is displayed on the first simulation interface; or... When the first configuration is such that the first virtual sub-display and the second virtual sub-display are in the unfolded state and the second virtual sub-display and the third virtual sub-display are in the semi-folded state, the folding avoidance area is displayed on the first simulation interface; or... When the first configuration is such that the first virtual sub-display and the second virtual sub-display are in a semi-folded state, and the second virtual sub-display and the third virtual sub-display are in a semi-folded state, the folding avoidance area is displayed on the first simulation interface; or... When the first configuration is such that the first virtual sub-display and the second virtual sub-display are in a folded state and the second virtual sub-display and the third virtual sub-display are in a semi-folded state, the folding avoidance zone is displayed on the first simulation interface.
14. The method according to claim 10, characterized in that, The first virtual display screen includes a first virtual sub-display screen, a second virtual sub-display screen, and a third virtual sub-display screen. The method further includes: When the first configuration is such that the first virtual sub-display and the second virtual sub-display are in an unfolded state, and the second virtual sub-display and the third virtual sub-display are in the unfolded state, a cutout area is displayed on the first simulated interface; or... When the first configuration is such that the first virtual sub-display and the second virtual sub-display are in a folded state, and the second virtual sub-display and the third virtual sub-display are in the folded state, the cutout area is displayed on the first simulation interface; or... When the first configuration is characterized by the first virtual sub-display and the second virtual sub-display being in a semi-folded state and the second virtual sub-display and the third virtual sub-display being in the unfolded state, the cutout area is displayed on the first simulation interface; or... When the first configuration is such that the first virtual sub-display and the second virtual sub-display are in the unfolded state and the second virtual sub-display and the third virtual sub-display are in the semi-folded state, the cutout area is displayed on the first simulated interface; or... When the first configuration is such that the first virtual sub-display and the second virtual sub-display are in a semi-folded state, and the second virtual sub-display and the third virtual sub-display are in a semi-folded state, the cutout area is displayed on the first simulation interface; or... When the first configuration is such that the first virtual sub-display and the second virtual sub-display are in the semi-folded state and the second virtual sub-display and the third virtual sub-display are in the folded state, the cutout area is displayed on the first simulation interface; or... When the first form is that the first virtual sub-display and the second virtual sub-display are in the unfolded state and the second virtual sub-display and the third virtual sub-display are in the folded state, the cutout area is displayed on the first simulation interface.
15. The method according to claim 1, characterized in that, The virtual hardware further includes a first virtual display screen and a second virtual display screen, wherein the first virtual display screen is used to simulate the outer display screen of the foldable screen device, and the second virtual display screen is used to simulate the inner display screen of the foldable screen device. The foldable screen device is an inwardly foldable screen device, and the first form is an unfolded state or a semi-folded state. The method further includes: The second operating system controls the first virtual display screen and the second virtual display screen to be powered on based on the first parameter; The second operating system sends a third instruction message to the first operating system, the third instruction message being used to indicate that the first virtual display screen and the second virtual display screen are in the power-on state; The first operating system displays a first simulated interface based on the first frame data, including: The first operating system draws the first frame data on a first drawing display screen and a second drawing display screen according to the third instruction information to display the first simulation interface. The first simulation interface includes a first simulation sub-interface drawn on the first drawing display screen and a second simulation sub-interface drawn on the second drawing display screen.
16. The method according to any one of claims 1 to 15, characterized in that, The virtual sensor is used to simulate a rotating shaft sensor and / or to simulate a magnetic attraction sensor.
17. The method according to any one of claims 1 to 16, characterized in that, The first operating system displays a first interface, which is a developer tool interface. The first interface includes a first control, which is associated with the first form. The first operation is an operation performed on the first control.
18. The method according to any one of claims 1 to 17, characterized in that, In response to a user's first operation, the first operating system sets the parameters of the virtual sensor to a first parameter, wherein the first parameter corresponds to a first form of the foldable screen device, including: In response to the first operation, the first operating system retrieves the first parameter corresponding to the first mode from the database; the first operating system sends the first parameter to the second operating system to configure the parameters of the virtual sensor as the first parameter.
19. A computer-readable storage medium, characterized in that, It stores a computer program thereon, which, when executed by an electronic device, enables the implementation of the method as described in any one of claims 1 to 18.
20. A chip, characterized in that, The chip includes a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface to execute the method as described in any one of claims 1 to 18.
21. An electronic device, characterized in that, It includes one or more processors; one or more memories; said one or more memories storing one or more computer programs, said one or more computer programs including instructions that, when executed by said one or more processors, cause the method of any one of claims 1 to 18 to be performed.
22. A computer program product, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1 to 18.