Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
In order to perform display control on an application, embodiments of the present invention provide a display control method of an application and an electronic device.
In one embodiment of the present invention, a display control method for an application, applied to a processor communicatively connected to a plurality of screens, includes:
when an operation instruction of an operation target application aiming at a first screen is received, whether an interface of the operation target application is currently displayed on a second screen connected to the processor is determined based on the identification of the target application, and the first screen is in communication connection with the processor.
And if so, controlling the target application to exit through a second process.
And controlling the target application to run through a first process and displaying an interface of the target application on the first screen.
As can be seen from the above, in the case that there is a second screen currently displaying the interface of the target application in the other screens connected to the processor except the first screen, the exit of the target application may be controlled by the second process, so that the interface of the target application exits from the display on the second screen. And controlling the target application to run in the first process through the first process, and displaying an interface of the target application on a first screen. Therefore, under the condition that the processor is in communication connection with a plurality of screens, the embodiment of the invention can control the interface of the same application to be simultaneously displayed on only one screen connected with the processor, thereby realizing the display control of the application.
The following examples are provided to illustrate embodiments of the present invention
The display control method of the application will be explained.
Referring to fig. 1A, a schematic flowchart of a display control method for a first application according to an embodiment of the present invention is provided, where the method includes the following steps S101 to S103.
In particular, the method is applied to a processor which is in communication connection with a plurality of screens, namely, the processor can display contents on the plurality of screens. The processor and the screen can be connected in a wired or wireless mode.
The number of the screens can be any number greater than or equal to 2.
For example, the processor is communicatively coupled to a plurality of screens mounted on the vehicle, with different screens being mounted at different locations on the vehicle. The screens can be classified into a CSD (Center Stack Display) screen and a PSD (Passenger Side Display) screen.
S101: and when an operation instruction of the target application for the operation of the first screen is received, determining whether an interface of the target application in an operation state is currently displayed on a second screen connected to the processor or not based on the identification of the target application.
And the first screen is in communication connection with the processor.
Specifically, the running instruction may be an instruction for starting the target application, which is input by the user by clicking an icon of the corresponding target application displayed on the first screen, or an instruction for starting the target application, which is input by the user by selecting the icon of the corresponding target application displayed on the first screen through a device such as a keyboard and a mouse.
In addition, in the case where it is determined that the second screen exists, it is described that there is another screen on which the interface of the target application is being displayed, and the step S102 may be continuously performed. In the case where it is determined that the second screen does not exist, illustrating that there is no other screen on which the target application is being displayed, step S103 may be directly performed.
In an embodiment of the present invention, process communication may be performed with processes that control application operation and display interfaces of the applications on other screens, respectively, to determine whether an application operating in each process is a target application, and determine a screen corresponding to a process in which the running application is the target application as a second screen.
In another embodiment of the present invention, the above step S101 may be implemented by the following steps a to B.
Step A: and selecting an application identifier group with the activation identifier being the identifier of the target application from application identifier groups respectively corresponding to other screens except the first screen and connected to the processor.
And the application identification group corresponding to each screen is used for recording the identification of the application of which the screen displays the interface.
The activation flag is: and displaying the identifier of the application corresponding to the interface currently displayed on the screen.
Specifically, the identifier of the application may be represented in the form of a name, a package name, a number, and the like of the application.
In addition, the application identification group can be represented in the form of an array, a character string group, a list, a heap, a stack, and the like. Each screen may correspond to an application identifier group, and a preset position in the application identifier group may be set as an activation identifier. When the application is opened through the process and the interface of the application is controlled to be displayed on the screen, the identifier of the opened application can be stored to the activation identifier position in the application identifier group, and when the application exits through the process and the interface of the application is displayed on the screen, the identifier located at the activation identifier position can be moved to other positions in the application identifier group, so that the identifier stored at the activation identifier position in the application identifier group is the identifier of the application corresponding to the interface currently displayed on the screen.
The activation flag may be located at any position in the application identification group. In the case where the application identifier group is represented in the form of a stack, the activation identifier bit may be located at the top of the stack.
Specifically, the application identifier group corresponding to each of the other screens may be traversed to determine the application identifier group whose identifier at the activation identifier is the identifier of the target application.
And B: and determining the screen corresponding to the selected application identification group as a second screen of the interface currently displaying the target application.
Because different application identifier groups are used for recording identifiers of applications of which interfaces are displayed on different screens, the different application identifier groups correspond to different screens.
S102: and controlling the target application to exit through a second process.
Wherein the second process is configured to: and running the target application and controlling an interface of the target application to be displayed on the second screen.
Referring to fig. 1B, a schematic diagram of an application interface displayed on a first screen and a second screen according to an embodiment of the present invention is provided.
Specifically, as can be seen from fig. 1C, the second screen displays the interface of the navigation application in a full screen mode.
Referring to fig. 1C, a schematic diagram of an application interface displayed on a second screen according to an embodiment of the present invention is provided.
Specifically, as can be seen from fig. 1C, the second screen displays the login interface of the "smart life" application in a full-screen mode.
Referring to fig. 1D, a schematic diagram of a second screen main interface according to an embodiment of the present invention is provided.
As can be seen from fig. 1D, icons of "ECARX navigation", "moral map", "multimedia", "phone", "user center", "my car", "car owner", "360 ° look around", "magic book", "smart life", "system setup", and "theme" applications are displayed on the main interface of the second screen.
In an embodiment of the present invention, since it is determined that the interface of the target application is displayed on the second screen, it indicates that the second process is currently running the target application, and an instruction indicating that the second process controls the target application to end running may be sent to the second process, so as to control the second process to exit the target application.
In a case where the operating system installed in the processor is an Android operating system, binder communication may be performed with an AMS (activity management service) method, so as to invoke a finishactive method to control the second process to exit the target application.
In an embodiment of the invention, step S101 may be implemented by steps C to E for each screen connected to the processor except the first screen, which will not be described in detail herein.
S103: and controlling the target application to run through a first process and displaying an interface of the target application on the first screen.
In an embodiment of the present invention, the first process may be a process created after the target application is determined to run, or may be a process created in advance and used for controlling the running of the target application and displaying an interface of the target application on the first screen. Specifically, the first process may be created directly after it is determined that the first screen is opened.
And if the operating system installed in the processor is an Android operating system, invoking an exectActivity method to start the target application, thereby controlling an interface of the target application to be displayed on the first screen.
Referring to fig. 1E, a schematic diagram of a first screen main interface according to an embodiment of the present invention is provided.
As can be seen from fig. 1E, icons of "height map", "PSD startup", "multimedia", "my car", "smart life", and "schedule" applications are displayed on the main interface of the first screen.
Referring to fig. 1F, a schematic diagram of an application interface displayed on a first screen according to an embodiment of the present invention is provided.
Specifically, as can be seen from fig. 1F, the first screen displays the interface of the navigation application in a full screen mode.
Referring to fig. 1G, a schematic diagram of an application interface displayed on a second first screen according to an embodiment of the present invention is provided.
Specifically, as shown in fig. 1C, in the case that the interface of the "smart life" application is displayed on the second screen, if the "smart life" application is run in response to the instruction input by the user and the target instruction of the interface of the "smart life" application is displayed on the first screen, the "smart life" application may be exited through the second process. And running the intelligent life application through the first process, and displaying an interface of the intelligent life application on the first screen. As can be seen from fig. 1G, the first screen displays the interface of the "smart life" application in full screen mode.
As can be seen from the above, in the case that there is a second screen currently displaying the interface of the target application in the other screens connected to the processor except the first screen, the exit of the target application may be controlled by the second process, so that the interface of the target application exits from the display on the second screen. And controlling the target application to run in the first process through the first process, and displaying an interface of the target application on a first screen. Therefore, under the condition that the processor is in communication connection with a plurality of screens, the embodiment of the invention can control the interface of the same application to be simultaneously displayed on only one screen connected with the processor, thereby realizing the display control aiming at the application.
In an embodiment of the present invention, the step S101 may be implemented by steps C to E for each screen connected to the processor, except the first screen.
And C: and judging whether the screen is in a split screen mode or not.
The screen is in a split screen mode, which indicates that the screen can simultaneously display the interfaces of a plurality of applications, and the interfaces of different applications are respectively displayed in different split screen areas of the split screen.
Under the condition that the operating system installed on the processor is an Android operating system, an isinssplitscreenwindowingmode method in the AMS method can be called to determine whether the screen is in a split screen mode.
Referring to fig. 2, a schematic diagram of an interface of an application displayed in a split screen mode on a screen according to an embodiment of the present invention is shown.
The screen respectively displays an interface of an intelligent life application and an interface of a navigation application in a split screen mode, wherein the interface of the intelligent life application and the interface of the navigation application are 2 application interfaces, the intelligent life application currently displays a weather interface and is displayed in a left split screen area on the left side of the split screen, and the interface of the navigation application is displayed in a right split screen area on the right side of the split screen.
In addition, step D may be performed when the screen is in the split screen mode, and step E may be performed when the screen is not in the split screen mode, and the interface of one application is displayed on the same screen.
Step D: and respectively determining whether the identifiers of the applications corresponding to the interfaces displayed in different split screen areas of the screen are the identifiers of the target applications, and if so, determining that the screen is a second screen.
In an embodiment of the present invention, different split-screen areas in the screen may respectively correspond to a split-screen application identifier group, and then it may be respectively determined whether an activation identifier included in each split-screen application identifier group of the screen is an identifier of a target application, where an interface of an application currently displayed in the split-screen area corresponding to the split-screen application identifier group whose activation identifier is the identifier of the target application is an interface of the target application.
The split-screen application identifier group is similar to the application identifier group, except that the split-screen application identifier group includes an identifier of an application whose interface is displayed in a split-screen area of a screen, which is not described in detail herein.
In an embodiment of the present invention, when the operating system installed on the processor is an Android operating system, and when two split screen areas are included in a split screen, an identifier of an application currently displayed in a first split screen area may be determined by a gettopseencackagename (true) method, and an identifier of an application currently displayed in a second split screen area may be determined by a gettopseencackagename (false) method.
The first split screen area and the second split screen area are two split screen areas contained in a screen in a split screen mode respectively. For example, the first split screen area may be a left split screen area, and the second split screen area may be a right split screen area. The first split screen area can also be an upper split screen area, and the second split screen area is a lower split screen area. After the identifiers of the applications corresponding to the current display interfaces in the two split-screen areas are respectively obtained, it can be determined that the obtained identifiers are split-screen areas of the identifiers of the target applications, that is, split-screen areas of the interface of the current display target applications.
Specifically, if a split screen area included in the split screen is currently displaying the interface of the target application, it indicates that the split screen is displaying the interface of the target application, and the split screen of the interface of the target application may be determined as the second screen.
Step E: and determining whether the identifier of the application corresponding to the interface displayed on the screen is the identifier of the target application, and if so, determining that the screen is a second screen.
Specifically, in a case that the screen is not in the split screen mode, the screen simultaneously displays an application interface, where step E is similar to step S101 described above, and details of this embodiment of the present invention are not repeated.
Referring to fig. 3, a flowchart of a display control method for a second application according to an embodiment of the present invention is shown, and compared with the foregoing embodiment shown in fig. 1A, the foregoing step S102 may be implemented by the following step S102A.
S102A: and when an application display instruction input by a user based on the operation prompt is received, controlling the target application to exit through a second process.
Wherein, the operation prompt is as follows: and displaying a prompt whether to display the interface of the target application on the first screen or not on the first screen.
Specifically, the operation prompt may be displayed in a prompt information box, a confirmation box, or the like, and may be represented in the form of text, sound, image, or the like.
In the case where the first screen and the second screen are screens installed in a vehicle, the second screen may be a main driving screen, and the first screen may be a sub driving screen. In the vehicle application scenario, referring to fig. 4A, a schematic diagram of an operation prompt according to an embodiment of the present invention is provided.
As shown in fig. 1C, the main driving screen, that is, the second screen currently displays an "smart life" application interface, if an instruction input by a user is received to run the "smart life" application, and when a running instruction of the interface of the "smart life" application is displayed on the assistant driving screen, that is, the first screen, the running prompt is displayed on the assistant driving screen, the running prompt is displayed in a confirmation box, and the running prompt is displayed in a form of a text "whether the main driving is using the smart life assistant driving to open and the main driving is disconnected from continuing to open or not".
Specifically, as shown in fig. 1C, the main driving screen, that is, the second screen currently displays an "smart life" application interface, if an instruction input by a user is received to run the "smart life" application, and when a target instruction of the interface of the "smart life" application is displayed on the secondary driving screen, that is, the first screen, an application running prompt is displayed on the secondary driving screen, the application running prompt is displayed in a confirmation box, and the application running prompt is displayed in a form of a text "whether the main driving is using the smart life secondary driving to open and disconnect the main driving for continuous opening or not".
In addition, in the vehicle application scenario, referring to fig. 4B, a schematic diagram of a second operation prompt provided in the embodiment of the present invention is shown.
The method comprises the steps that a multimedia application interface is currently displayed on a main driving screen, namely a second screen, if an instruction input by a user is received to run the multimedia application, and when a running instruction of the multimedia application interface is displayed on a secondary driving screen, namely a first screen, a running prompt is displayed on the secondary driving screen, the running prompt is displayed in a confirmation frame, and the running prompt is displayed in a form of a text that whether the main driving is opened by using the multimedia secondary driving and the use of the main driving is disconnected or not is continuously opened.
Further, the user may input the representation to perform the application display instruction by clicking a screen, or by inputting a representation through a mouse, a keyboard, or the like, for example, as can be seen from fig. 4A or 4B, in the case where the above-mentioned operation prompt is displayed in the confirmation box, the user may input the application display instruction by clicking an "open" key in the confirmation box, and the user may click a "cancel" key in the confirmation box, inputting a cancel display instruction, which indicates to cancel the interface of the target application displayed on the first screen.
In a case where it is determined that the user does not input the application display instruction based on the above-described operation prompt, or inputs the cancel display instruction, the flow may be ended.
As can be seen from the above, before the target application is controlled to exit through the second process, the operation prompt is displayed on the first screen, and only after the application display instruction input by the user based on the operation prompt is received, the target application is controlled to exit through the second process. Therefore, the user can be prevented from displaying the interface of the target application on the first screen due to misoperation indication under most conditions, and the problem that the display of the interface of the target application on the second screen is influenced because the second process directly exits the target application can be avoided.
Referring to fig. 5, a flowchart of a display control method for a third application according to an embodiment of the present invention is shown, and compared with the embodiment shown in fig. 1A, the foregoing step S102 may be implemented by the following step S102B.
S102B: and under the condition that the second screen is in the split screen mode, controlling the second screen to exit the split screen mode, displaying the interfaces of the applications except the target application in the current display application of the second screen in a full screen mode, and controlling the target application to exit through a second process.
In an embodiment of the present invention, since the second screen is in the split screen mode, interfaces of different applications can be displayed simultaneously. The different applications are respectively run through different processes, wherein the target application can be run through the second process, and the other applications are run through other processes. The exit of the target application through the second process does not affect the operation of other applications. And after the target application exits, the interface of the target application is no longer displayed on the second screen, and the split-screen area originally used for displaying the interface of the target application can be used for displaying the interfaces of other applications, so that the split-screen mode can exit, and the applications except the target application in the currently displayed application of the second screen are displayed in a full-screen mode.
Specifically, when the interface of the target application is displayed in the first split screen area, a disisssplit screen (false) method may be called to control the first split screen area where the interface of the target application exits, and when the interface of the target application is displayed in the second split screen area, a disisssplit screen (true) method may be called to control the second split screen area where the interface of the target application exits.
Specifically, the method of exiting the target application is similar to the foregoing step S102, and details thereof are not repeated in this embodiment of the present invention.
As can be seen from the above, when the second screen is in the split-screen mode and the interface of the target application is displayed in one split-screen area of the second screen, if the target application is controlled to exit through the second process, the interface of the target application is no longer displayed on the second screen. Therefore, the interface of the application program is not suitable to be displayed in the second screen in the split-screen mode any more, the second screen can be controlled to exit the split-screen mode, the interfaces of the applications except the target application are displayed in the full-screen mode, and then the target application is controlled to exit.
Referring to fig. 6, a schematic flow chart of a display control method for a fourth application according to an embodiment of the present invention is shown, and compared with the foregoing embodiment shown in fig. 1A, the method further includes the following step S104 before the step S101.
S104: when an operation instruction of an operation target application aiming at a first screen is received, whether the target application supports display in different screen synchronous interfaces or not is determined.
Specifically, the target application may include a display identifier indicating whether the target application supports display on different screen synchronization interfaces, and whether the target application supports display on different screen synchronization interfaces may be determined through the display identifier. In addition, the application list can store the identifiers of the applications capable of performing synchronous interface display on different screens, and whether the application list contains the identifier of the target application or not is determined, so that whether the target application supports synchronous interface display on different screens or not is determined.
The value of eos _ supports _ multiproges of the target application may be used as a display identifier, and when the value of eos _ supports _ multiproges is true, it indicates that the target application supports display on different screen synchronization interfaces. Otherwise, if the value is false, it indicates that the target application does not support the display on different screen synchronous interfaces.
In an embodiment of the present invention, when the operating system installed in the processor is an Android operating system, it may be determined, through a PackageManagerService service, whether a value of an eos _ supports _ multiproges value of each application installed in the processor is tube or false, so as to determine whether the application supports display on different screen synchronization interfaces.
If the target application supports synchronous interface display on different screens, the interface of the target application can be synchronously displayed on the first screen and other screens, and when the interface of the target application is displayed on the first screen, the interface of the target application displayed on the second screen can be continuously displayed without controlling the target application to exit through the second process. The above step S103 may be directly performed.
If the target application does not support synchronous interface display on different screens, the first screen and other screens cannot simultaneously display the interface of the target application, and the interface of the target application can be displayed on one screen at the same time. Therefore, when the steps S101 to S102 need to be executed, a second screen of the interface of the target application currently displayed in the other screens is determined, and the target application is controlled to exit through the second process, so that the interface of the target application exits from the second screen for display, and then the interface of the target application is displayed on the first screen, thereby ensuring that the interface of the target application is only displayed on the first screen.
As can be seen from the above, in the case that the target application does not support simultaneous interface display on different screens, the interface of the target application can only be displayed on one screen, and therefore, it is necessary to determine whether the interface of the target application is displayed on another screen before the interface of the target application is displayed on the first screen, and in the case that the second screen on which the interface of the target application is displayed exists, the interface of the target application needs to be displayed on the first screen after the target application is exited through the second process. Under the condition that the target application supports simultaneous interface display on different screens, whether the interfaces of the target application are displayed on other screens or not does not influence the interface of the target application displayed on the first screen, so that the interface of the target application can be directly displayed on the first screen without controlling the target application to exit through a second process. The steps required by the control target application for performing interface display on the first screen can be reduced, and the efficiency of performing interface display on the first screen by the control target application is improved.
Referring to fig. 7, a flowchart of a display control method for a fifth application according to an embodiment of the present invention is shown, and compared with the foregoing embodiment shown in fig. 1A, the foregoing step S103 can be implemented by the following steps S103A-S103C.
S103A: and determining whether the interface of the target application to be displayed on the first screen is a first interface.
Wherein the first interface is: and controlling an interface displayed on the second screen before the target application exits through the second process.
Specifically, the interface to be displayed may be a preset interface that is displayed first after the target application starts to run, or may be another interface of the target application.
In addition, in the process of running the target application through the second process, cache data of the opened interface may be stored, where the cache data includes data, such as an instruction input by a user, in the process of displaying the interface by the second process.
And the second process also stores the interface identification of the interface of the opened application in the interface identification group. The interface identifier may be represented in the form of a name, a number, or the like of the interface. The interface identification group can be represented in the form of an array, a character string group, a list, a heap, a stack and the like.
The interface identifier at the activated interface identifier position in the interface identifier group can be moved to other positions in the interface identifier group when the process control interface exits from displaying on the screen, so that the interface identifier stored at the activated interface identifier position in the interface identifier group is the interface identifier of the interface currently displayed on the screen.
The activation interface identification bit may be located at any position in the interface identification group, and in the case that the interface identification group is represented in the form of a stack, the activation interface identification bit may be located at the top of the stack.
In an embodiment of the present invention, it may be determined whether the interface identifier stored at the activated interface identifier in the interface identifier group corresponding to the process of running the target application through the second process is the interface identifier of the interface to be displayed, and if so, it is determined that the first interface is the interface to be displayed by the target application, and step S103B is executed. Otherwise, the first interface is not the interface to be displayed by the target application, and step S103C is executed.
S103B: and controlling the target application to start through a first process, migrating the cache data of the first interface to the first process, and displaying the first interface on a first screen through the first process based on the cache data of the first interface.
In another embodiment of the present invention, the cache data of the first interface may be migrated to a first process, and the first process controls the first process to load and display the first interface on a first screen according to the cache data of the first interface, so that the first screen may restore, based on the cache data, an interface displayed on a second screen before the target application exits from the second process.
S103C: and controlling the target application to start through the first process, loading through the first process, displaying an interface to be displayed of the target application on a first screen, and clearing cache data of the first interface.
In an embodiment of the present invention, the first process controls the target application to start, and the first process controls the first screen to display an interface to be displayed of the target application.
As can be seen from the above, under the condition that the interface to be displayed by the target application is the same as the first interface displayed on the second screen before the target application is controlled to exit by the second process, the cache data of the first interface may be migrated to the first process, and the first process loads the cache data to display the first interface, so that the first screen may continue to display the first interface on the basis of the second screen, and the interface display effect of the target application is relatively continuous. And under the condition that the interface to be displayed of the target application is different from the first interface, the cache data of the first interface can be cleared, so that the data storage resources of the processor occupied by the cache data are reduced.
Referring to fig. 8, a flowchart of an application interface display control method for a vehicle screen according to an embodiment of the present invention is shown, where the method includes the following steps S801-S815.
Specifically, two screens, namely a CSD screen and a PSD screen, are installed on the vehicle and are in communication connection through the same processor, the CSD screen supports a split screen mode, and the CSD screen can display two application interfaces in a left split screen area and a right split screen area respectively under the condition that the CSD screen is in the split screen mode.
S801: and judging whether the received instruction is an instruction for indicating that the target application is displayed on the CSD screen.
If not, it indicates that the instruction indicates to display an interface of the target application on a PSD screen, where the PSD screen is the first screen and the CSD screen is the second screen, and step S802 is executed. If so, it means that the instruction indicates to display an interface of the target application on a CSD screen, where the CSD screen is the first screen and the PSD screen is the second screen, and step S811 is performed.
S802: and judging whether the CSD screen is in a split screen mode.
If the CSD screen is in the split screen mode, the interfaces of the two applications are simultaneously displayed on the CSD screen, and step S803 is executed. And if the CSD screen is not in the split screen mode, displaying an application interface on the CSD screen. Step S806 is performed.
S803: and judging whether any one of the first identifier and the second identifier is the identifier of the target application.
Wherein, the first identifier is: and the mark at the top of the stack in the left application mark stack corresponding to the left split screen area of the CSD screen.
The second identifier is: and the identifier positioned at the top of the stack in the right application identifier stack corresponding to the right split screen area of the CSD screen.
Specifically, the identifier at the top of the left application identifier stack is an identifier of an application corresponding to the current display interface in the left split screen area of the CSD screen. And the identifier at the top of the stack in the right application identifier stack is the identifier of the application corresponding to the current display interface in the right split screen area of the CSD screen.
If any one of the first identifier and the second identifier is the identifier of the target application, which indicates that the CSD screen is currently displaying the interface of the target application, step S804 is executed. Otherwise, it is stated that the CSD screen does not currently display the interface of the target application, and the target application may be directly started and the interface of the target application may be displayed on the PSD screen.
S804: control displays the run prompt on the PSD screen and determines whether the user enters an application display instruction.
Wherein the operation prompt is a prompt indicating whether to display an interface of the target application on the PSD screen. After the user sees the running prompt, the user can select to input an instruction indicating whether to continue displaying the interface of the target application on the PSD screen. If the user inputs an application display instruction, the user determines to display the interface of the target application on the PSD screen, and step S805 is executed. Otherwise, the user does not determine that the interface of the target application is displayed on the PSD screen, and the process is ended.
Specifically, the step S804 is similar to the embodiment shown in the step S102A shown in fig. 2, and the description of the embodiment of the present invention is omitted here.
S805: and controlling the CSD screen to quit displaying the interface of the target application.
Specifically, if the interface of the target application is displayed in the left split screen area of the CSD screen before exiting from displaying the interface of the target application, the target application may be exited by controlling a process for running the target application and controlling the interface of the target application to be displayed in the left split screen area.
If the interface of the target application is displayed in the right split screen area of the CSD screen before exiting the interface displaying the target application, the target application can be exited by controlling the process for running the target application and controlling the interface displaying the target application in the right split screen area.
After the CSD screen is controlled to quit displaying the interface of the target application, the target application can be started and the interface of the target application can be displayed on the PSD screen.
Specifically, the step S805 is similar to the steps S102B-S102C shown in fig. 5, and the description of the present invention is omitted here.
S806: and judging whether the third identifier is the identifier of the target application.
Because the CSD screen is not in the split screen mode, the CSD screen displays the application interface in the full screen mode, and the CSD screen only displays the application interface at the same time.
Wherein the third identifier is: and the CSD application corresponding to the CSD screen identifies the identifier positioned at the top of the stack in the stack. The identifier at the top of the CSD application identifier stack is an identifier of an application corresponding to an interface currently displayed in a full screen mode on the CSD screen.
If the third identifier is the identifier of the target application, which indicates that the CSD screen is currently displaying the interface of the target application, step S807 is executed. Otherwise, it is stated that the CSD screen does not currently display the interface of the target application, and the target application may be directly started and the interface of the target application may be displayed on the PSD screen.
Specifically, step S806 is similar to step S101 shown in fig. 1A, and is not repeated herein in the embodiment of the present invention.
S807: control displays the run prompt on the PSD screen and determines whether the user enters an application display instruction.
Wherein the operation prompt is a prompt indicating whether to display an interface of the target application on the PSD screen. After the user sees the running prompt, the user can select to input an instruction indicating whether to continue displaying the interface of the target application on the PSD screen. If the user inputs an application display instruction, the user determines to display the interface of the target application on the PSD screen, and step S808 is executed. Otherwise, the user does not determine that the interface of the target application is displayed on the PSD screen, and the process is ended.
Specifically, the step S807 is similar to the embodiment shown in the step S102A shown in fig. 2, and the embodiment of the present invention is not repeated herein.
S808: and judging whether the second interface is the same as the interface to be displayed of the target application.
Wherein the second interface is: the third process controls an interface displayed on the CSD screen before the target application exits. The third process is as follows: and a process for running the target application and controlling the interface of the target application to be displayed in the CSD screen.
If the second interface is the same as the interface to be displayed, step S809 is executed. If the second interface is different from the interface to be displayed, step S810 is executed.
S809: and controlling the target application to run through a fourth process, and controlling the second interface to be loaded and displayed on the PSD screen through the fourth process.
Wherein the fourth process is: and a process for running the target application and controlling the display of the interface of the target application in the PSD screen.
S810: and controlling the target application to run through a fourth process, clearing cache data of a second interface, and controlling the target application to display an interface to be displayed on the PSD screen through the fourth process.
Specifically, the steps S808 to S810 are similar to the steps S103A to S103C shown in fig. 7, and are not repeated herein in this embodiment of the invention.
S811: and judging whether the fourth identifier is the identifier of the target application.
In an embodiment of the present invention, in the case that it is determined in step S801 that the instruction indicates to display the target application on the CSD screen, where the CSD screen is the first screen and the PSD screen is the second screen, it is required to determine whether the currently displayed interface on the PSD screen is an interface of the target application, and this step S811 is executed.
Wherein the fourth flag is: and the PSD corresponding to the PSD screen applies the mark positioned at the top of the stack in the mark stack.
Specifically, the identifier at the top of the PSD application identifier stack is an identifier of an application corresponding to the currently displayed interface of the PSD screen.
If the fourth identifier is the identifier of the target application, which indicates that the PSD screen is currently displaying the interface of the target application, step S812 is executed. Otherwise, if the PSD screen does not display the interface of the target application currently, the target application may be directly started and the interface of the target application may be displayed on the CSD screen.
Specifically, the step S811 is similar to the step S101 shown in fig. 1A, and the embodiment of the invention is not repeated here.
S812: control displays the run prompt on the CSD screen and determines whether the user enters an application display instruction.
Wherein, the operation prompt is a prompt of whether to display an interface of the target application on the CSD screen. After viewing the running prompt, the user can select to input an instruction indicating whether to continue displaying the interface of the target application on the CSD screen. If the user inputs an application display instruction, the user determines to display the interface of the target application on the CSD screen, and step S813 is executed. Otherwise, the user does not determine to display the interface of the target application on the CSD screen, and the flow is ended.
Specifically, the step S812 is similar to the embodiment shown in the steps S102A-S102B shown in fig. 2, and the embodiment of the invention is not repeated here.
S813: and judging whether the third interface is the same as the interface to be displayed of the target application.
Wherein the third interface is: and controlling the target application to exit the interface displayed on the PSD screen through a fifth process. The fifth process is as follows: and a process for running the target application and controlling the display of the interface of the target application in the PSD screen.
If the third interface is the same as the interface to be displayed, step S814 is executed. If the third interface is different from the interface to be displayed, step S815 is executed.
S814: and controlling the target application to run through a sixth process, and controlling the third interface to be loaded and displayed on the CSD screen.
Wherein the sixth process is: and a process for running the target application and controlling the interface of the target application to be displayed in the CSD screen.
S815: and controlling the target application to run through a sixth process, controlling the interface to be displayed of the target application to be displayed on the CSD screen, and clearing the cache data of the third interface.
Specifically, the steps S813 to S815 are similar to the steps S103A to S103C shown in fig. 7, and are not repeated herein in this embodiment of the invention.
Referring to fig. 9, a flowchart of a display control method for a sixth application according to an embodiment of the present invention is shown, and compared with the foregoing embodiment shown in fig. 1A, after step S103, the method further includes the following steps S105 to S109.
S105: and judging whether the target application is a playing service application.
The service playing application may be an application for playing audio, an application for playing video, and the like.
In the case where the target application is a broadcast service application, and there may be a broadcast service in the target application, the following step S106 is executed.
S106: and when the playing service application has the playing service, judging whether the first screen has a main playing channel.
Specifically, the playing service may be a service for playing audio. The main play channel may be a wired audio play channel, that is, the played audio is output through wired audio output devices, such as a wired sound box, a wired earphone, and the like. The main playing channel may also be a wireless audio playing channel, that is, the played audio is output through a wireless audio output device, such as a bluetooth headset, a mobile phone, a bluetooth sound box, etc.
Specifically, in a case where the main playback channel is a wired audio playback channel, it may be determined whether the processor is connected to a wired audio output device, and if so, it may be determined that the main playback channel exists in the first screen.
And under the condition that the main playing channel is a wireless audio playing channel, determining whether the processor is connected with the wireless audio output equipment, and if so, determining that the main playing channel exists in the first screen.
In an embodiment of the present invention, when the operating system installed in the processor is an Android operating system, a USAGE type may be obtained through an AdaptAPI interface, and when the main playback channel exists, the obtained USAGE type is a first preset type corresponding to the main playback channel.
If it is determined that the main playback channel corresponding to the first screen exists, the audio playback may be performed through the main playback channel, step S107 is performed, and if it is determined that the main playback channel corresponding to the first screen does not exist, it is determined that the audio playback cannot be performed through the main playback channel, step S108 is performed.
S107: and playing audio through the main playing channel based on the first process.
Specifically, the playing service obtains a playing focus, and the first process may pause the audio being played and execute the playing service having the audio focus.
In an embodiment of the present invention, the step S106 may be implemented by a step F.
Step F: and constructing a playing example through the first process, and playing audio through the main playing channel based on the constructed playing example.
Wherein, the constructed playing instance is an audio playing instance, such as an audio player. Specifically, the audio playing instance may be AudioTrack, when the operating system installed in the processor is an Android operating system.
Further, it is possible to determine from which output apparatus the played information is output, based on a preset correspondence between the determined USAGE type and the output apparatus. For example, if the obtained USAGE type is a type corresponding to the main playback channel, and the main playback channel is a wireless audio playback channel, the played audio is output from the wireless audio playback device. In the case that the wireless AUDIO playing DEVICE is a BLUETOOTH DEVICE, the identifier of the output DEVICE playing the AUDIO may be determined as AUDIO _ DEVICE _ OUT _ BLUETOOTH _ A2DP, and after determining the data coding of the BLUETOOTH DEVICE according to the identifier of the output DEVICE through a BLUETOOTH protocol, the played AUDIO is sent to the BLUETOOTH DEVICE through a BLUETOOTH chip, so that the played AUDIO is output from the BLUETOOTH DEVICE.
S108: and judging whether the first screen has an auxiliary play channel.
Specifically, the auxiliary playback channel is a playback channel different from the main playback channel.
For example, in a case where the main playback channel is a wireless audio playback channel, the auxiliary playback channel may be a wired audio playback channel. On the contrary, in the case that the main playback channel is a wired audio playback channel, the auxiliary playback channel may be a wireless audio playback channel.
In an embodiment of the present invention, if the first screen has an auxiliary playback channel, the audio may be played through the auxiliary playback channel, and step S109 may be executed. If the auxiliary play channel does not exist in the first screen, it indicates that the main play channel and the auxiliary play channel do not exist in the current first screen, and the audio cannot be played, and the process is ended.
S109: and playing audio through the auxiliary playing channel based on the first process.
Specifically, similar to the step S107, the playing service obtains a playing focus, the first process may pause the audio being played, and execute the playing service with the audio focus.
In an embodiment of the present invention, the step S109 may be implemented by a step G.
Step G: and constructing a playing example based on the first process, and playing audio through the auxiliary playing channel based on the constructed playing example.
Specifically, step G is similar to step F, and the difference between step G and step F is only that step G performs information playing through the auxiliary playing channel, which is not described again in this embodiment of the present invention.
As can be seen from the above, the embodiment of the present invention provides the main playback channel and the auxiliary playback channel, and can perform audio playback through the main playback channel in the presence of the main playback channel, and can also perform audio playback through the auxiliary playback channel in the absence of the main playback channel but in the presence of the auxiliary playback channel.
Referring to fig. 10, a seventh aspect of the present invention is provided
Compared with the embodiment shown in fig. 9, the method further includes the following steps S110 to S111.
S110: in the audio playing process, whether the state of the main playing channel changes or not is monitored through a preset monitoring interface.
Specifically, since the embodiment of the present invention preferentially plays the information through the main play channel, the information can be played through the auxiliary play channel only when the main play channel does not exist.
Therefore, if the first process can play information through the main play channel, it may be determined that the main play channel exists, and the change of the state of the main play channel may be a disconnection of the main play channel. The first process cannot continue the audio playback through the main playback channel, that is, the status of the audio playback changes.
For example, in a case where the main playback channel is a wireless audio playback channel, when audio playback is performed through the main playback channel, audio may be output through a bluetooth headset, and a change in the state of the main playback channel may be caused by disconnection between the bluetooth headset and the processor.
If the first process cannot play the information through the main play channel, it may be determined that the main play channel does not exist, and the state of the main play channel may be changed if the main play channel exists, and the first process may play the information through the main play channel. According to the principle that the information playing is preferentially carried out through the main playing channel in the embodiment of the invention, the playing channel can be switched in the first process, and the auxiliary playing channel is switched to the main playing channel for carrying out the information playing, so that the audio playing state is changed.
For example, when the main playback channel is a wireless audio playback channel and the auxiliary playback channel is a wired audio playback channel, playing information through the auxiliary playback channel may be performed by playing audio through a wired speaker. In the process of playing audio through the wired speaker, the state change of the main playing channel may be the connection between the bluetooth headset and the processor.
So that the state of audio playing may change in case the state of the main playing channel changes, step S111 may be performed. If the state of the playing channel is not changed, the audio playing can be continued through the currently used playing channel.
S111: and pausing the audio playing based on the first process.
Specifically, since the state of the audio playback is changed when the state of the main playback channel is changed, in order to prevent an audio playback error from occurring due to the change in the state of the audio playback, the playback of the audio may be suspended.
In addition, after the audio playing is paused, the step S106 may be executed again to determine whether the main playing channel exists, so as to continue playing the information.
It can be seen from the above that, when the monitoring interface monitors that the state of the main playing channel changes, the audio can be controlled to pause playing, and whether the main playing channel exists is determined again, if the main playing channel exists, the audio can be played through the main playing channel, otherwise, whether the auxiliary playing channel exists is determined, and if the auxiliary playing channel exists, the audio can be played through the auxiliary playing channel. Therefore, under the condition that the state of the main playing channel is changed, the audio playing can be continued.
Referring to fig. 11, a flowchart of an audio playing method for a vehicle screen according to an embodiment of the present invention is provided, where the method includes the following steps S1101-S1114.
Specifically, in the embodiment of the present invention, the operating system installed in the processor is an android operating system, the processor is in communication connection with the CSD screen and the PSD screen, and the main playback channel of the CSD screen is a cable playback channel and outputs audio through an external speaker. The main playing channel of the PSD screen is a wireless audio playing channel, audio is output through a Bluetooth headset, and the auxiliary playing channel of the PSD screen is a wired audio playing channel, and the audio is output through an external loudspeaker. The loudspeaker can be installed on a vehicle, and is connected with the processor by default, namely an auxiliary playing channel of the PSD screen and a main playing channel of the CSD screen exist all the time.
S1101: and monitoring the connection state of the Bluetooth headset and the processor through the Bluetooth headset monitoring interface.
Specifically, the bluetooth headset monitoring interface may be a commonly used interface in the prior art, which is not limited in the embodiment of the present invention.
S1102: and determining that the audio playing service exists in the target application.
S1103: it is determined whether the interface of the target application is displayed on the PSD screen and the bluetooth headset is connected to the processor.
Specifically, since the main playback channel corresponding to the PSD screen outputs the audio through the bluetooth headset, the main playback channel of the PSD screen exists and can preferentially output the audio through the bluetooth headset when the interface of the target application is displayed on the PSD screen and the bluetooth headset is connected to the processor, and step S1104 is executed.
If the interface of the target application is displayed on the PSD screen but the bluetooth headset is not connected to the processor, the playback channel of the PSD screen does not exist, and the audio can be output through the auxiliary playback channel corresponding to the PSD screen through the external speaker, and step S1111 is executed. Or the interface of the target application is displayed on the CSD screen, the audio is output through the main playback channel corresponding to the CSD screen through the play-out speaker, and step S1111 is executed.
S1104: the USAGE type is obtained through the AdaptAPI interface.
If the acquired USAGE type is a preset USAGE _ MEDIA2(TBD) type indicating that audio is output from the bluetooth headset, the audio may be played through the main playback channel of the PSD screen, and step S1105 is performed.
If the obtained USAGE type is a preset USAGE _ MEDIA type indicating that audio is output from the loud speaker, the audio may be played through the auxiliary playback channel of the PSD screen or the main playback channel of the CSD screen, and step S1111 is executed.
Specifically, the steps S1101 to S1105 are similar to the steps S105 to S106 shown in fig. 9, and are not repeated herein in this embodiment of the present invention.
S1105: audio focus is applied based on USAGE _ MEDIA2(TBD) type and a play instance is constructed in a first process.
S1106: and playing the audio through the constructed playing example and outputting the audio from the Bluetooth headset.
Specifically, steps S1105 to S1106 are similar to step F, and are not described again in this embodiment of the present invention.
S1107: and monitoring whether the connection between the Bluetooth headset and the processor is disconnected or not through a monitoring interface.
If the connection between the bluetooth headset and the processor is disconnected, in the current situation, the audio played by the playing instance cannot be output from the bluetooth headset, the main playing channel is disconnected, the state of the main playing channel is changed, the played audio cannot be output normally, and step S1108 needs to be executed.
And if the connection between the Bluetooth headset and the processor is not disconnected and the state of the main playing channel is not changed, continuing to play the audio and outputting the audio through the Bluetooth headset.
S1108: and sending information representing disconnection between the Bluetooth headset and the processor to the first process.
S1109: the playing instance is controlled by the first process to pause playing the audio.
Specifically, since the connection between the bluetooth headset and the processor is disconnected, the audio cannot be continuously output through the bluetooth headset in the current situation, and therefore the playing of the audio can be suspended by controlling the playing instance through the first process.
Under the above condition, if it is monitored that the user instructs to execute the audio playing service again, the process returns to step S1102 to continue execution.
Specifically, the steps S1108-S1109 are similar to the step S111 shown in fig. 10, and are not repeated herein in this embodiment of the invention.
S1110: the audio focus is applied based on USAGE _ MEDIA type and an audio player instance is built in a first process.
Since step S1110 is performed in the case where it is determined that audio is output through the loud speaker, audio focus is applied by a preset USAGE _ MEDIA type representing that audio is output from the loud speaker.
S1111: and playing the audio through the constructed playing example and outputting the audio from the loudspeaker.
Specifically, the steps S1110 to S1111 are similar to the step G, and are not repeated herein in the embodiment of the present invention.
S1112: and monitoring whether the connection between the Bluetooth headset and the processor is generated or not through a monitoring interface.
Specifically, if the bluetooth headset is connected to the processor, the audio may be output through the bluetooth headset in the current situation, and the audio is output through the bluetooth headset in the main playback channel corresponding to the PSD screen, that is, the audio is preferentially output through the bluetooth headset when the interface of the target application is displayed on the PSD screen.
Therefore, in the case that it is determined that the connection between the bluetooth headset and the processor is generated, the playing channel may be switched to the main playing channel, that is, the audio is output from the bluetooth headset, and step S1113 is performed.
And if the connection between the Bluetooth headset and the processor is not established, continuing to play audio through the auxiliary playing channel.
Specifically, the step S1112 is similar to the step S110 shown in fig. 10, and the description of the embodiment of the present invention is omitted.
S1113: and sending information representing the connection established between the Bluetooth headset and the processor to the first process.
S1114: the playing instance is controlled by the first process to pause playing the audio.
Specifically, because the connection is established between the bluetooth headset and the processor, and the main playing channel exists, the playing channel can be switched under the current condition, the auxiliary playing channel is switched to the main playing channel, the playing instance can be controlled to pause playing audio through the first process, and the audio playing channel can be prevented from being abnormally played in the switching process.
Specifically, steps S1113 to S1114 are similar to step S111 shown in fig. 10, and are not repeated herein in this embodiment of the present invention.
Under the above condition, if it is monitored that the user instructs to execute the audio playing service again, the process returns to step S1102 to continue execution.
An embodiment of the present invention further provides an electronic device, as a processor communicatively connected to multiple screens, as shown in fig. 12, including a processor 1201, a communication interface 1202, a memory 1203, and a communication bus 1204, where the processor 1201, the communication interface 1202, and the memory 1203 complete mutual communication through the communication bus 1204,
a memory 1203 for storing a computer program;
the processor 1201 is configured to implement the steps of the display control method of any one of the applications described above when executing the program stored in the memory 1203.
The electronic equipment provided by the embodiment of the invention is applied to
And during the display control of the application, under the condition that a second screen which is currently used for displaying the interface of the target application exists in other screens except the first screen and connected to the processor, the target application can be controlled to exit through the second process, so that the interface of the target application exits from the second screen for display. And controlling the target application to run in the first process through the first process, and displaying an interface of the target application on a first screen. Therefore, under the condition that the processor is in communication connection with a plurality of screens, the embodiment of the invention can control the interface of the same application to be simultaneously displayed on only one screen connected with the processor, thereby realizing the display control of the application.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In yet another embodiment provided by the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, the computer program implementing any of the above when executed by a processor
And the step of the applied display control method.
By applying the computer program stored in the computer-readable storage medium provided in the present embodiment
And during the display control of the application, under the condition that a second screen which is currently used for displaying the interface of the target application exists in other screens except the first screen and connected to the processor, the target application can be controlled to exit through the second process, so that the interface of the target application exits from the second screen for display. And controlling the target application to run in the first process through the first process, and displaying an interface of the target application on a first screen. Therefore, under the condition that the processor is in communication connection with a plurality of screens, the embodiment of the invention can control the interface of the same application to be simultaneously displayed on only one screen connected with the processor, thereby realizing the display control of the application.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the steps of the display control method of any of the above embodiments.
When the computer program product provided by the embodiment is executed to perform display control of an application, in the case that a second screen currently displaying an interface of the target application exists in other screens, except the first screen, connected to the processor, the target application can be controlled to exit through the second process, so that the interface of the target application exits from the second screen for display. And controlling the target application to run in the first process through the first process, and displaying an interface of the target application on a first screen. Therefore, under the condition that the processor is in communication connection with a plurality of screens, the embodiment of the invention can control the interface of the same application to be simultaneously displayed on only one screen connected with the processor, thereby realizing the display control of the application.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the electronic device, the computer-readable storage medium and the computer program product, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to what can be referred to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.