Display method and device, electronic equipment and storage medium
By generating the display interface by obtaining the control state and screen type flag, the problem of poor privacy protection and interaction of controls in multi-device display is solved, realizing control-level display control and differentiated display states, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING XIAOMI MOBILE SOFTWARE CO LTD
- Filing Date
- 2024-10-29
- Publication Date
- 2026-05-01
AI Technical Summary
In multi-device display, mirroring of controls leads to poor privacy protection and user interaction, and makes it impossible to achieve differentiated display states of controls on different display devices.
By obtaining the control status flags and display screen type flags in the target application interface, the interface to be displayed on the display screen is generated. Based on the control status and screen type, the display status of the control on different display screens is determined, thereby realizing control-level display control.
It enables differentiated display states of controls on different display screens, improving privacy protection and user interaction experience, and enhancing the richness and relevance of display states.
Smart Images

Figure CN121957421A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more particularly to a display method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, with the development of intelligent technology and the accumulation of Internet of Things technology by various manufacturers, more and more devices are involved in display, including TVs, computers, and tablets. This allows mobile phone display content to be projected onto different display devices, or screen content to be saved through screen recording and shared with others, greatly facilitating people's lives, work, and entertainment.
[0003] However, during this sharing process, the controls in the interface content are basically displayed in a mirrored manner on multiple display devices, that is, the content displayed on the secondary screen is completely identical to the content on the primary screen. This is not conducive to privacy protection and user interaction. Therefore, how to make different controls have different display states when displayed on different devices is a technical problem that urgently needs to be solved. Summary of the Invention
[0004] This application aims to at least partially address one of the technical problems in the related art.
[0005] Therefore, this application proposes a display method, apparatus, electronic device, and storage medium to realize control-level display control, so as to distinguish the display status of controls on different display screens.
[0006] One embodiment of this application proposes a display method, including:
[0007] Obtain the status flags of the controls in the first interface to be displayed in the target application, and the screen type flag of the display screen used to display the first interface;
[0008] Based on the status flag of the control and the screen type flag of the display screen, a first interface to be displayed on the display screen is generated; wherein, the first interface displays the display status of the control on the display screen.
[0009] Another aspect of this application provides a display device, comprising:
[0010] The acquisition module is used to acquire the status flags of controls in the first interface to be displayed in the target application, and the screen type flag of the display screen used to display the first interface;
[0011] The processing module is configured to generate a first interface to be displayed on the display screen based on the status flag of the control and the screen type flag of the display screen; wherein the first interface displays the display status of the control on the display screen.
[0012] Another embodiment of this application proposes a chip including processing circuitry configured to perform the method described in one aspect above.
[0013] Another embodiment of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method described in one aspect above or the method described in the other aspect above.
[0014] Another embodiment of this application proposes a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in one aspect above or the method described in another aspect above.
[0015] Another embodiment of this application proposes a computer program product having a computer program stored thereon, which, when executed by a processor, implements the method described in one aspect above or the method described in the other aspect above.
[0016] The display method, apparatus, electronic device, and storage medium proposed in this application obtain the status flags of controls in a first interface to be displayed in a target application, and the screen type flag of the display screen used to display the first interface. Based on the status flags of the controls and the screen type flag of the display screen, a first interface to be displayed on the display screen is generated. The first interface displays the display state of the controls on the display screen. The display screen is determined based on the screen type flag, and the display state of the controls when displayed on the corresponding display screen is determined based on the status flags of the controls. This achieves control-level display control to distinguish the display state of controls on different display screens.
[0017] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0018] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0019] Figure 1 A flowchart illustrating a display method provided in an embodiment of this application. Figure 1 ;
[0020] Figure 2 Flowchart of another display method provided in the embodiments of this application Figure 2 ;
[0021] Figure 3 Flowchart of another display method provided in the embodiments of this application Figure 3 ;
[0022] Figure 4 This is a schematic diagram illustrating the principle of a display method provided in an embodiment of this application;
[0023] Figure 5 A schematic diagram illustrating the display state of controls in a scene provided in an embodiment of this application;
[0024] Figure 6 This is a schematic diagram of the structure of a display device provided in an embodiment of this application;
[0025] Figure 7 This is a block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0026] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0027] The following description, with reference to the accompanying drawings, describes a display method, apparatus, electronic device, and storage medium according to embodiments of this application.
[0028] Figure 1 A flowchart illustrating a display method provided in an embodiment of this application. Figure 1 .
[0029] The execution subject of the display method in this application embodiment is a display device, which can be disposed in an electronic device. The electronic device can be any device with computing capabilities, such as a mobile terminal. A mobile terminal can be a mobile phone, tablet computer, personal digital assistant, wearable device, or other hardware device with various operating systems, touchscreens, and / or displays; this embodiment does not limit the scope of the application.
[0030] like Figure 1 As shown, the method may include the following steps:
[0031] Step 101: Obtain the status flags of the controls in the first interface to be displayed in the target application, and the screen type flag of the display screen used to display the first interface.
[0032] In this embodiment, the target application is one of multiple applications in an electronic device. The target application can be a currently running application or an already launched application. The target application can be a system application, such as a photo album or phone book, or a user application developed by a third-party developer. The user application can call the system interface of the electronic device and use the display method of this application to control the display of controls within the user application. The first interface is the first interface to be displayed by the target application; that is, the first page is still in layer state and has not yet undergone layer compositing to generate an interface that can be displayed on the screen. The first interface includes at least one control. During the startup of the target application, the status flags of each control in the first interface are passed to the operating system. The operating system saves the status flags of each control to the layer attribute of each control, and then performs composite display. The status flags of the controls are used to indicate whether the control is displayed on various display screens.
[0033] In this embodiment, display rules for whether each control in the interface of each application is displayed on different display screens have been pre-defined. Therefore, to display on the corresponding display screen, it is necessary to determine on which type of display screen the first interface of the current target application should be displayed. This requires obtaining the screen type flag of the display screen, that is, the screen type flag indicates the screen type of the display screen used to display the first interface of the target application. The screen type of the display screen includes physical screens and virtual screens. The physical screen refers to the screen of the electronic device itself, which is a physical screen. That is, the content of the application interface is directly rendered and displayed on this physical screen. The physical screen is, for example, the inner or outer screen of a foldable phone, or the large screen (main screen) or small screen (secondary screen) on the front of a dual-screen phone. In the Android system, a virtual screen is an abstract screen. A virtual screen can be used to create an interface, image, or video output. This output can be used to record screen content, take screenshots, or serve as other screen output targets (such as screen casting). Virtual screens include virtual screens in screen casting scenarios and / or virtual screens in screen recording scenarios. In the process of compositing the interface to be displayed on the virtual screen, the virtual screen is not directly displayed on the electronic device, so it does not affect the interface content currently displayed on the electronic device.
[0034] Step 102: Generate the first interface to be displayed on the display screen based on the status flags of the controls and the screen type flags of the display screen.
[0035] The first interface displays the control's display status on the screen. In one implementation, the display status indicates the control's visibility, meaning it can be shown or not shown to achieve different display effects. In another implementation, the display status indicates the control's transparency, meaning it can have various transparency settings to achieve different display effects.
[0036] In this embodiment, the screen type flag determines the type of display screen on which the application interface will be displayed, while the status flags of the controls in the application interface determine the corresponding display state of the controls when displayed on various types of display screens. The display state of the controls in the first interface corresponds to the display screen. That is, when the display screen displays the first interface, the display controls in the first interface correspond to the display screen, thus enabling the same control to achieve the corresponding display state on different display screens.
[0037] In one implementation of this application, layer analysis is performed on the first interface to determine at least one layer corresponding to the first interface. The at least one layer includes a control layer. The display state of the control layer on the display screen is determined based on the control's status flag and screen type flag. The display state is used to indicate the visibility of the control layer on the corresponding display screen. Based on the at least one layer and the display state of the control layer on the display screen, a first interface to be displayed on the display screen is generated. That is, by compositing the layers, a first interface to be sent to the corresponding display screen for display is generated.
[0038] In the display method of this application embodiment, the status flags of controls in the first interface to be displayed in the target application and the screen type flag of the display screen used to display the first interface are obtained. Based on the status flags of the controls and the screen type flag of the display screen, the first interface to be displayed on the display screen is generated. The first interface displays the display state of the controls on the display screen. The display screen is determined based on the screen type flag, and the display state of the controls when displayed on the corresponding display screen is determined based on the status flags of the controls. This realizes control-level display control, so as to distinguish the display state of the controls on the corresponding display screen.
[0039] Based on the above embodiments, Figure 2 Flowchart of another display method provided in the embodiments of this application Figure 2 It specifically explains how to display controls when the display screen is a physical screen, such as... Figure 2 As shown, the method includes the following steps:
[0040] Step 201: Obtain the status flags of the controls in the first interface to be displayed in the target application, and the screen type flag of the display screen used to display the first interface.
[0041] Step 201 can be explained in the foregoing embodiments, as the principle is the same, and will not be repeated here.
[0042] In one scenario, if screen mirroring and / or screen recording are not currently enabled, the displayed screen type is a physical screen. Therefore, the obtained physical screen type flag includes a first flag, which indicates whether the displayed screen is a physical screen or a virtual screen. As an example, the first flag is a numerical value; for instance, a value of 00 indicates a physical screen, and a value of 01 indicates a virtual screen.
[0043] In the second scenario, if screen casting and / or screen recording are currently enabled, at least one screen type flag will be obtained, including a screen type flag for a virtual screen. Each virtual screen's screen type flag includes a first flag and a second flag. The first flag indicates whether the display screen is a physical screen or a virtual screen. The second flag indicates whether the virtual screen is created in a screen casting scenario or a screen recording scenario. The second flag can be a display flag; a display flag value of true indicates that the virtual screen is a screen casting virtual screen; a display flag value of false indicates that the virtual screen is a screen recording virtual screen. The display flag value can also be set to a number; this embodiment does not limit its specific value.
[0044] It should be noted that the display state of the same control may be the same or different when displayed on different screens. As an example, control 1 in application interface A may not be displayed on the application interface when displayed on the phone's own screen. However, control 1 will be displayed in the corresponding virtual screen when the phone is projected onto the screen, and it will also be displayed in the corresponding virtual screen when the phone is screen recorded. Step 202: Obtain at least one layer corresponding to the first interface.
[0045] At least one of the layers includes a layer containing controls.
[0046] As one implementation method, the layers of the first interface are analyzed using the components in the operating system used for layer analysis and management to obtain at least one layer corresponding to the first interface.
[0047] Step 203: Identify the status flags of the control and determine the values of the control's status flags.
[0048] In this embodiment, the value of the control's status flag can be a set numerical value or a set character. By setting different values, the corresponding display state of the control can be indicated when it is displayed on different display screens. When displayed on a physical screen, different display states can also be displayed. For example, from the perspective of protecting user privacy, the display state includes displaying or not displaying, which realizes control-level control without having to control the entire interface to be displayed, thus improving targeting.
[0049] Step 204: Determine whether the display screen is a physical screen based on the first flag in the screen type flag.
[0050] In this embodiment of the application, the display screen is determined to be a physical screen based on the first flag in the obtained screen type flag. For example, if the first flag value is 00, the display screen is determined to be a physical screen. The physical screen can be any display screen in the mobile phone, such as the inner screen or the outer screen.
[0051] Step 205: In response to the display screen being a physical screen, determine the display state of the layer of the control corresponding to the physical screen based on the value of the control's state flag.
[0052] In this embodiment, the display state of the layer of the control corresponding to the physical screen is determined according to the value of the control's state flag. The following is a description of different display scenarios:
[0053] In one scenario of this application embodiment, in response to the value of the state flag being a first target value, the display state of the layer of the control corresponding to the physical screen is determined to be a first display state based on the first target value. As one implementation method, the correspondence between the first target value and the display state is preset, and the display state of the layer of the control corresponding to the physical screen can be determined to be the first display state based on the first target value.
[0054] In another scenario of this application embodiment, in response to the value of the status flag being a second target value, the display state of the layer of the control corresponding to the physical screen is determined to be a second display state. As one implementation, the correspondence between the second target value and the display state is preset. Based on the second target value, the display state of the layer of the control corresponding to the physical screen can be determined to be the second display state. Wherein, if the display screen has only one type of physical screen, the first target value and the second target value are different values, thus achieving the purpose of indicating different display states. In this application embodiment, the display screen includes multiple types, such as three types. In order to indicate the corresponding display state in different display screens through the value of the status flag, a first candidate set and a second candidate set can be set. Both the first and second candidate sets include multiple values, and there is no intersection between the first and second candidate sets. The first target value is set to a value in the first candidate set; the second target value is set to a value in the second candidate set. As an example, for three types of display screens, the first candidate set includes three values, namely 1, 2, and 3; the second candidate set includes three values, namely 4, 5, and 6. The first target value can be one of 1, 2, and 3, and the second target value can be one of 4, 5, and 6. This allows the control to indicate various display states on different screens by using different values of the status flags, thus meeting the display needs of various scenarios.
[0055] It should be noted that the first display state and the second display state are two different display states, in order to allow the same control to display the corresponding display state on different display screens. Examples are given below for different situations:
[0056] In the first scenario: for privacy protection, as one implementation, if the first display state is not displayed, then the second display state is displayed; as another implementation, if the first display state is displayed, then the second display state is not displayed. Alternatively, if the first display state is blurred, then the second display state is normal display without blurring; as yet another implementation, if the first display state is normal display without blurring, then the second display state is blurred.
[0057] In the second scenario, for personalized display, one implementation is that the first display state uses the first color and the second display state uses the second color; another implementation is that the first display state uses the second color and the second display state uses the first color. The first and second colors are different colors, and this embodiment does not impose any limitations on them.
[0058] Other display states are not listed in this embodiment.
[0059] Step 206: Based on the display status of the control's layers on the display screen, composite at least one layer to obtain the first interface to be displayed on the display screen.
[0060] In this embodiment, the display state of the control layer on the corresponding display screen has been determined. Therefore, when at least one layer is composited according to the display state of the control layer on the display screen, the visibility of the control in the first interface can be determined, so that the corresponding display state can be displayed when the first interface is displayed on the display screen.
[0061] In the display method of this application embodiment, the state flags of controls in the first interface to be displayed in the target application and the screen type flag of the display screen used to display the first interface are obtained. Based on the state flags of the controls and the screen type flag, the first interface to be displayed on the display screen is generated. The first interface displays the display state of the controls on the display screen. The display screen is determined to be a physical screen based on the screen type flag. The display state of the controls when displayed on the corresponding physical screen is determined based on the state flags of the controls. This allows the same control to be displayed in different display screens with corresponding display states. Compared with related technologies that display the same display state regardless of the display screen, i.e., displaying the same control, this application provides a richer display state of visibility, meets the user's need for privacy protection, and does not require processing the content of the entire window, but only the control needs to be managed, resulting in better performance and display state.
[0062] Based on the above embodiments, this application provides another display method. Figure 3 Flowchart of another display method provided in the embodiments of this application Figure 3 It specifically explains how to display controls when the display screen is a virtual screen, such as... Figure 3 As shown, the method includes the following steps:
[0063] Step 301: Obtain the status flags of the controls in the first interface to be displayed in the target application, and the screen type flag of the display screen used to display the first interface.
[0064] Step 301 can be explained in the foregoing embodiments, as the principle is the same, and will not be repeated here.
[0065] Step 302: Obtain at least one layer corresponding to the first interface.
[0066] At least one of the layers includes a layer containing controls.
[0067] As one implementation method, the layers of the first interface are analyzed using the components in the operating system used for layer analysis and management to obtain at least one layer corresponding to the first interface.
[0068] Step 303: Identify the status flags of the control and determine the values of the status flags of the control.
[0069] In this embodiment, the value of the control's status flag can be a set numerical value or a set character. By setting different values, the corresponding display state of the control can be indicated when it is displayed on different display screens. When displayed on a physical screen, different display states can also be displayed. For example, from the perspective of protecting user privacy, the display state includes displaying or not displaying, which realizes control-level control without having to control the entire interface to be displayed, thus improving targeting.
[0070] Step 304: Determine whether the display screen is a physical screen based on the first flag in the screen type flag.
[0071] Step 304 can be explained in the previous embodiments, and the principle is the same, so it will not be repeated here.
[0072] Step 305: In response to the display screen being a virtual screen, determine the type of the virtual screen based on the second flag in the screen type flag.
[0073] In this embodiment, since virtual screens include virtual screens in screen recording scenarios and virtual screens in screen projection scenarios, after determining that the display screen is a virtual screen, it is necessary to further determine which scenario the virtual screen belongs to. This requires further identification of the virtual screen type based on the second flag in the screen type flag. The second flag is set for the created virtual screen when it is created, and is used to indicate which scenario the created virtual screen belongs to. As an example, the second flag can be a flag value, represented by `display flag`. If `display flag` is true, it indicates that the virtual screen is a screen projection virtual screen; if `display flag` is false, it indicates that the virtual screen is a screen recording virtual screen.
[0074] Step 306: Determine the display state of the layer of the control corresponding to the virtual screen based on the type of the virtual screen and the value of the control's state flag.
[0075] In this embodiment, the display state of the control on the corresponding virtual screen can be determined based on the value of the control's state flag. The following descriptions address different display scenarios:
[0076] First, let's explain the projection virtual screen based on its type:
[0077] In the first scenario, in response to the virtual screen type being a projection virtual screen and the status flag value being a third target value, the display state of the layer of the control corresponding to the projection virtual screen is determined to be the first display state. As one implementation method, the correspondence between the third target value and the display state is pre-defined. Based on the third target value, the display state of the layer of the control corresponding to the physical screen can be determined to be the first display state. Wherein, the first target value is a value from the first candidate set; the second target value is a value from the second candidate set; and the third target value includes at least one value from the first candidate set and one value from the second candidate set.
[0078] As an example, for three display screens, the first candidate set includes three values: 1, 2, and 3; the second candidate set includes three values: 4, 5, and 6. The first target value is one of 1, 2, and 3, and the second target value is one of 4, 5, and 6. The third target value also has three possibilities: one of 2, 4, and 6. This allows the control to indicate various display states on different display screens by using different values of the status flag, thus meeting the display needs of various scenarios.
[0079] In the second scenario, in response to the virtual screen type being a projected virtual screen and the status flag being a fourth target value, the display state of the layer of the control corresponding to the projected virtual screen is determined to be the second display state. As one implementation, the correspondence between the fourth target value and the display state is pre-defined; based on the fourth target value, the display state of the layer of the control corresponding to the physical screen can be determined to be the second display state. The fourth target value includes at least one value from the first candidate set and at least one value from the second candidate set, and there is no overlap between the fourth target value and the third target value.
[0080] As an example, considering three display screens, the first candidate set includes three values: 1, 2, and 3; the second candidate set includes three values: 4, 5, and 6. The first target value is one of 1, 2, and 3, and the second target value is one of 4, 5, and 6. The third target value also has three possibilities: one of 2, 4, and 6. Therefore, the fourth target value also has three possibilities: one of 1, 3, and 5. This allows the control to indicate various display states on different display screens by using different values of the status flags, thus meeting the display needs of various scenarios. Next, we will explain using a screen recording virtual screen as an example:
[0081] In the first scenario, responding to the virtual screen type being a screen recording virtual screen, and with the status flag set to the fifth target value, the display state of the layer corresponding to the screen recording virtual screen is determined to be the first display state. As one implementation, the correspondence between the fifth target value and the display state is pre-defined. Based on the fifth target value, the display state of the layer corresponding to the physical screen's control can be determined to be the first display state. The fifth target value includes at least one value from the first candidate set and at least one value from the second candidate set, and the fifth target value intersects with both the third and fourth target values.
[0082] As an example, for three display screens, the first candidate set includes three values: 1, 2, and 3; the second candidate set includes three values: 4, 5, and 6. The first target value is one of 1, 2, and 3, and the second target value is one of 4, 5, and 6. The third target value also has three possibilities: one of 2, 4, and 6. Therefore, the fourth target value also has three possibilities: one of 1, 3, and 5. As an example, the fifth target value is one of 2, 3, and 5. This allows the control to indicate various display states on different display screens by using different values of status flags, thus meeting the display needs of various scenarios.
[0083] In the second scenario, responding to the virtual screen type being a screen recording virtual screen, and with the state flag set to the sixth target value, the display state of the layer corresponding to the screen recording virtual screen's control is determined to be the second display state. As one implementation, the correspondence between the sixth target value and the display state is pre-defined. Based on the sixth target value, the display state of the layer corresponding to the physical screen's control can be determined to be the second display state. The sixth target value includes at least one value from the first candidate set and at least one value from the second candidate set, and there is no overlap between the sixth target value and the fifth target value.
[0084] As an example, for three display screens, the first candidate set includes three values: 1, 2, and 3; the second candidate set includes three values: 4, 5, and 6. The first target value is one of 1, 2, and 3, and the second target value is one of 4, 5, and 6. The third target value also has three possibilities: one of 2, 4, and 6. Therefore, the fourth target value also has three possibilities: one of 1, 3, and 5. As an example, the fifth target value is one of 2, 3, and 5, and thus, the sixth target value is one of 1, 4, and 6. This allows the control to indicate various display states on different display screens by using different values of the status flags, thus meeting the display needs of various scenarios.
[0085] It should be noted that when the status flag of a control has the same value, the display state of the control on the physical screen, the projection virtual screen, and the screen recording virtual screen may be different or the same. The specific values of each target flag in different scenarios corresponding to various display screens can be set according to requirements, and this embodiment does not impose any limitations. The description of the control's display state in the aforementioned embodiments also applies to virtual screens, including screen recording virtual screens and projection virtual screens, and will not be repeated in this embodiment.
[0086] Step 307: Based on the display status of the control's layers on the display screen, composite at least one layer to obtain the first interface to be displayed on the display screen.
[0087] In this embodiment, the display state of the control layer on the corresponding display screen has been determined. Therefore, when at least one layer is composited according to the display state of the control layer on the display screen, the visibility of the control in the first interface can be determined, so that the corresponding display state can be displayed when the first interface is displayed on the display screen.
[0088] In the display method of this application embodiment, the state flags of controls in the first interface to be displayed in the target application and the screen type flag of the display screen used to display the first interface are obtained. Based on the state flags of the controls and the screen type flag, the first interface to be displayed on the display screen is generated. The first interface displays the display state of the controls on the display screen. The screen type flag determines whether the display screen is a screen recording virtual screen or a screen projection virtual screen. The state flags of the controls determine the display state of the controls when displayed on the corresponding virtual screen. This allows for different display states for the same control on different display screens. Compared to related technologies that display the same state regardless of the display screen (i.e., displaying the same control everywhere), this application provides richer visibility display states, satisfying users' privacy protection needs. Furthermore, it eliminates the need to process the entire window content, requiring only control management, resulting in better performance and display states. It also distinguishes between screen recording and screen projection scenarios, providing more display methods to meet the needs of different scenarios.
[0089] Based on the above embodiments, in practical application scenarios, the application interface can be displayed on one display screen or multiple display screens. As an example scenario, the electronic device is a mobile phone, and the user initiates screen casting and screen recording. That is, the user wants to both cast and record the screen. At this time, the user opens an application interface, and the mobile phone screen also needs to display it. In other words, the application interface needs to be displayed simultaneously on three different display screens. Specifically, for the same control within the application interface, it needs to be displayed on three different display screens simultaneously, showing the corresponding display state under various scenarios. The display state can also be understood as the display effect, such as being displayed or not displayed. Applications typically include multiple controls, and different applications include different controls. For each control, the state flag value is a set value. The state flag values of different controls may be different to ensure that different controls have corresponding display states on different display screens. Simultaneously, the same control, based on the state flag value, also has corresponding display states on different display screens. Examples of various display states of controls on three different display screens are listed below.
[0090] Table 1
[0091]
[0092]
[0093] As shown in Table 1, for each control, in order to satisfy the two display states and the various combinations of display states when displayed on three display screens, Table 1 shows the multiple display methods of a control on three display screens with different flag values, meeting the display requirements of different scenarios. Specifically, when flag = 0, it is the default situation in the Android system of related technologies, that is, the control is displayed on all three display screens, that is, there is no distinction in display on different display screens. In this embodiment, when the flag value is determined to be the set value of 0, no distinction is made in display screens, and the same effect is displayed on all display screens.
[0094] As an example, Figure 4 This is a schematic diagram illustrating the principle of a display method provided in an embodiment of this application. (Refer to...) Figure 4 Let's take a window controller in the application as an example for explanation:
[0095] During application startup, according to the window controller settings, the window controller's flag is set to 3 when it is created. Then, the application programming interface (API) provided by the Framework is called. The API is used to pass upper-level parameters, receive screen events, and read screen parameters. The window controller's flag value is transmitted from the application to the system's SurfaceFlinger via a Transaction.
[0096] For controls in the application interface to be displayed: window controllers, in response to the detection of screen casting and screen recording commands, determine the screen type of the corresponding display screen, including physical screen, screen casting virtual screen, and screen recording virtual screen. When creating each type of screen, set the corresponding basic screen parameters, i.e. screen type flag. This parameter is uniformly managed in DisplayManage and is also passed to the operating system's system service Surfaceflinger through Transaction.
[0097] The underlying processing of the SurfaceFlinger system service in the operating system:
[0098] a. First, define a set of control display rules, as shown in Table 1 above. By default, Android system flag=0 will be displayed on all display screens. If the window controller is only displayed on the projection virtual screen, then flag=3.
[0099] b. After the system service SurfaceFlinger receives the flag data of the window controller sent by the application, it will save it in the layer property of the window controller.
[0100] c. After the system service SurfaceFlinger receives the display flag data, it will trigger a display update and transfer the data to the displayDevice for storage. DisplayManage and displayDevice are in one-to-one correspondence, and displayDevice is in turn mapped one-to-one with the actual physical screen device.
[0101] d. During the compositing phase, SurfaceFlinger filters control layers based on different display settings. One implementation method is to filter the layers of controls in the first interface based on the control's state flags and screen type flags. This determines whether the control layers in the first interface are displayed on each display screen, i.e., it determines the display state of the control layers on each display screen. Then, based on the display state of the control layers on each display screen and other layers in the first interface, the layers are recomposited to obtain the first interface to be displayed on each screen. The first interface displays the display state of the controls when shown on the corresponding display screen. It's important to understand that the first interface is obtained by setting the display state of the control layers in the first interface and then compositing the various layers in the first interface.
[0102] Furthermore, to save the first interface data and send it for display, SurfaceFlinger collects all visible layers and passes them to HWCDisplay in the HAL (Hardware Abstraction Layer). Its core component, HWC (hwcomposer), is the module in Android used for window composition and display. It is responsible for further compositing the layers composed by SurfaceFlinger onto the display device. HWCDisplay interacts with the display hardware to ensure that the first interface obtained after recompositing the layers can be correctly displayed on the display screen. Alternatively, the composed first interface is sent to a virtual screen or a physical screen for rendering. After rendering on the virtual screen, the content of the first interface rendered on the virtual screen is copied and transmitted to the corresponding physical screen on the hardware device for display. That is, in a screen mirroring scenario, it is displayed on the device being mirrored; in a screen recording scenario, it is displayed on the device being recorded, ensuring that controls have corresponding display states on different display screens.
[0103] It should be noted that when the Android system starts, the SurfaceFlinger service is loaded into memory and its code is executed by the processor to complete its function.
[0104] For other systems, such as UI display systems, the same control can be displayed differently on different display screens in accordance with the display method in the embodiments of this application. The implementation principle is similar and will not be described in detail here.
[0105] As an example, Figure 5 This is a schematic diagram illustrating the display state of controls in a scene, as provided in an embodiment of this application. Figure 5As shown, taking the window controller control as an example, A indicates the display effect of the window controller in the application on the physical screen of the mobile phone, where the display state of the window controller is not displayed. B indicates the display effect in the screen recording scenario, that is, the display state of the window controller is not displayed. C indicates the display effect in the screen projection scenario, that is, the display state of the window controller is displayed. This realizes control based on controls, so that different controls have corresponding display states when displayed on different screens, which meets different user interaction and privacy control needs. The corresponding display states when displayed on different screens can be set according to needs, and this embodiment does not limit it.
[0106] To implement the above embodiments, this application also proposes a display device.
[0107] Figure 6 This is a schematic diagram of the structure of a display device provided in an embodiment of this application.
[0108] like Figure 6 As shown, the device may include:
[0109] The acquisition module 71 is used to acquire the status flags of the controls in the first interface to be displayed in the target application, and the screen type flag of the display screen used to display the first interface.
[0110] The processing module 72 is used to generate a first interface to be displayed on the display screen based on the status flag of the control and the screen type flag of the display screen; wherein the first interface displays the display status of the control on the display screen.
[0111] Furthermore, in one implementation of this application embodiment, the processing module 72 is further configured to:
[0112] Obtain at least one layer corresponding to the first interface; wherein, the at least one layer includes the layer of the control;
[0113] The display status of the control's layer on the display screen is determined based on the control's status flag and the display screen's screen type flag; wherein, the display status is used to indicate the visibility of the control's layer on the display screen;
[0114] Based on the display status of the control's layers on the display screen, at least one layer is composited to obtain the first interface to be displayed on the display screen.
[0115] In one implementation of this application embodiment, the processing module 72 is further configured to:
[0116] The status flags of the control are identified, and the values of the status flags are determined;
[0117] Based on the first flag in the screen type flag, determine whether the display screen is a physical screen;
[0118] In response to the fact that the display screen is a physical screen, the display state of the layer of the control corresponding to the physical screen is determined according to the value of the status flag of the control.
[0119] In one implementation of this application embodiment, the processing module 72 is further configured to:
[0120] In response to the value of the status flag being a first target value, the display state of the layer of the control corresponding to the physical screen is determined to be a first display state.
[0121] In one implementation of this application embodiment, the processing module 72 is further configured to:
[0122] In response to the value of the status flag being a second target value, the display state of the layer of the control corresponding to the physical screen is determined to be a second display state.
[0123] In one implementation of this application embodiment, the processing module 72 is further configured to:
[0124] The status flags of the control are identified, and the values of the status flags of the control are determined;
[0125] Based on the first flag in the screen type flag, determine whether the display screen is a physical screen;
[0126] In response to the fact that the display screen is a virtual screen, the type of the virtual screen is determined according to the second flag in the screen type flag;
[0127] Based on the type of the virtual screen and the value of the status flag of the control, determine the display state of the layer of the control corresponding to the virtual screen.
[0128] In one implementation of this application embodiment, the processing module 72 is further configured to:
[0129] In response to the virtual screen being a projection virtual screen and the status flag being a third target value, the display state of the layer of the control corresponding to the projection virtual screen is determined to be a first display state; wherein, the first target value is a value in the first candidate set; the second target value is a value in the second candidate set; and the third target value includes at least one value in the first candidate set and one value in the second candidate set.
[0130] In one implementation of this application embodiment, the processing module 72 is further configured to:
[0131] In response to the virtual screen being a projection virtual screen and the status flag being a fourth target value, the display state of the layer of the control corresponding to the projection virtual screen is determined to be a second display state; wherein, the fourth target value includes at least one value in the first candidate set and at least one value in the second candidate set, and there is no intersection between the fourth target value and the third target value.
[0132] In one implementation of this application embodiment, the processing module 72 is further configured to:
[0133] In response to the virtual screen being a screen recording virtual screen and the status flag being a fifth target value, the display state of the layer of the control corresponding to the screen recording virtual screen is determined to be a first display state; wherein, the fifth target value includes at least one value in the first candidate set and at least one value in the second candidate set, and the fifth target value has an intersection with the third target value and the fourth target value respectively.
[0134] In one implementation of this application embodiment, the processing module 72 is further configured to:
[0135] In response to the virtual screen being a screen recording virtual screen and the status flag being a sixth target value, the display state of the layer of the control corresponding to the screen recording virtual screen is determined to be a second display state; wherein, the sixth target value includes at least one value in the first candidate set and at least one value in the second candidate set, and there is no intersection between the sixth target value and the fifth target value.
[0136] It should be noted that the foregoing explanation of the method embodiments also applies to the apparatus of this embodiment, and will not be repeated here.
[0137] The display device proposed in this application obtains the state flags of controls in a first interface to be displayed in a target application, and the screen type flag of the display screen used to display the first interface. Based on the state flags of the controls and the screen type flag, it generates the first interface to be displayed on the display screen. The first interface displays the display state of the controls on the display screen. The display screen is determined based on the screen type flag, and the display state of the controls when displayed on the corresponding display screen is determined based on the state flags of the controls, thereby realizing control-level display control to distinguish the display state of controls on different display screens. For example, it can realize that for the same control, the corresponding display state can be implemented on different display screens, meeting the needs of different scenarios.
[0138] To implement the above embodiments, this application also proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the method described in the foregoing method embodiments.
[0139] To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in the foregoing method embodiments.
[0140] To implement the above embodiments, this application also proposes a computer program product having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in the foregoing method embodiments.
[0141] Figure 7 This is a block diagram of an electronic device provided in an embodiment of this application. For example, the electronic device 800 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0142] Reference Figure 7 The electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input / output (I / O) interface 812, sensor component 814, and communication component 816.
[0143] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0144] Memory 804 is configured to store various types of data to support the operation of electronic device 800. Examples of this data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0145] Power component 806 provides power to various components of electronic device 800. Power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.
[0146] Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0147] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0148] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0149] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 can detect the on / off state of electronic device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or a component of electronic device 800, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0150] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, 4G, or 5G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0151] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0152] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0153] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0154] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0155] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0156] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0157] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0158] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0159] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0160] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A display method, characterized in that, include: Obtain the status flags of the controls in the first interface to be displayed in the target application, and the screen type flag of the display screen used to display the first interface; Based on the status flag of the control and the screen type flag of the display screen, a first interface to be displayed on the display screen is generated; wherein, the first interface displays the display status of the control on the display screen.
2. The method as described in claim 1, characterized in that, The step of generating the first interface based on the status flag of the control and the screen type flag of the display screen includes: Obtain at least one layer corresponding to the first interface; wherein, the at least one layer includes the layer of the control; The display status of the control's layer on the display screen is determined based on the control's status flag and the display screen's screen type flag; wherein, the display status is used to indicate the visibility of the control's layer on the display screen; Based on the display status of the control's layer on the display screen, the at least one layer is composited to obtain the first interface to be displayed on the display screen.
3. The method as described in claim 2, characterized in that, Determining the display state of the control's layer on the display screen based on the control's status flag and the display screen's screen type flag includes: The status flags of the control are identified, and the values of the status flags are determined; Based on the first flag in the screen type flag, determine whether the display screen is a physical screen; In response to the fact that the display screen is a physical screen, the display state of the layer of the control corresponding to the physical screen is determined according to the value of the status flag of the control.
4. The method as described in claim 3, characterized in that, Based on the value of the control's status flag, determine the display state of the layer corresponding to the control on the physical screen, including: In response to the value of the status flag being a first target value, the display state of the layer of the control corresponding to the physical screen is determined to be a first display state.
5. The method as described in claim 3, characterized in that, The method further includes: In response to the value of the status flag being a second target value, the display state of the layer of the control corresponding to the physical screen is determined to be a second display state.
6. The method as described in claim 2, characterized in that, Determining the display state of the layer corresponding to the control on the display screen based on the control's status flag and the display screen's screen type flag includes: The status flags of the control are identified, and the values of the status flags of the control are determined; Based on the first flag in the screen type flag, determine whether the display screen is a physical screen; In response to the fact that the display screen is a virtual screen, the type of the virtual screen is determined according to the second flag in the screen type flag; Based on the type of the virtual screen and the value of the status flag of the control, determine the display state of the layer of the control corresponding to the virtual screen.
7. The method as described in claim 6, characterized in that, Determining the display state of the layer of the control corresponding to the virtual screen based on the type of the virtual screen and the value of the control's state flag includes: In response to the virtual screen being a projection virtual screen and the status flag being a third target value, the display state of the layer of the control corresponding to the projection virtual screen is determined to be a first display state; wherein, the first target value is a value in the first candidate set; the second target value is a value in the second candidate set; and the third target value includes at least one value in the first candidate set and one value in the second candidate set.
8. The method as described in claim 7, characterized in that, The method further includes: In response to the virtual screen being a projection virtual screen and the status flag being a fourth target value, the display state of the layer of the control corresponding to the projection virtual screen is determined to be a second display state; wherein, the fourth target value includes at least one value in the first candidate set and at least one value in the second candidate set, and there is no intersection between the fourth target value and the third target value.
9. The method as described in claim 8, characterized in that, The method further includes: In response to the virtual screen being a screen recording virtual screen and the status flag being a fifth target value, the display state of the layer of the control corresponding to the screen recording virtual screen is determined to be a first display state; wherein, the fifth target value includes at least one value in the first candidate set and at least one value in the second candidate set, and the fifth target value has an intersection with the third target value and the fourth target value respectively.
10. The method as described in claim 9, characterized in that, The method further includes: In response to the virtual screen being a screen recording virtual screen and the status flag being a sixth target value, the display state of the layer of the control corresponding to the screen recording virtual screen is determined to be a second display state; wherein, the sixth target value includes at least one value in the first candidate set and at least one value in the second candidate set, and there is no intersection between the sixth target value and the fifth target value.
11. A display device, characterized in that, include: The acquisition module acquires the status flags of controls in the first interface to be displayed in the target application, as well as the screen type flag of the display screen used to display the first interface. The processing module is configured to generate a first interface to be displayed on the display screen based on the status flag of the control and the screen type flag of the display screen; wherein the first interface displays the display status of the control on the display screen.
12. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the method as described in any one of claims 1-10.
13. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-10.