Application direction updating method and device, electronic equipment, medium and program product

By determining and updating the display direction of the application in the terminal device according to the changes in system direction and application configuration changes, the problem of chaotic application layout is solved, synchronous updates between application and system directions are realized, and user experience is improved.

CN119759476APending Publication Date: 2025-04-04VIVO MOBILE COMM CO LTD

Patent Information

Application Number
CN202411931191.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

When the application direction changes in the prior art in terminal devices, the problem of application layout disorder cannot be effectively avoided, especially when multiple application windows are opened at the same time, and the system direction changes cause the application to be updated unadapted directions, the layout disorder will occur.

Method used

When the configuration of the target application is changed, the new direction of the application is determined based on the direction detected by the sensor, the direction indicated by the direction switch, and the direction update process of the application components is performed when supported, to ensure that the application layout is consistent with the system direction.

Benefits of technology

It effectively avoids application layout disorder, ensures that applications can switch seamlessly and run smoothly when the system direction changes, and improves the user experience when multiple application windows are displayed simultaneously.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759476A_ABST
    Figure CN119759476A_ABST
Patent Text Reader

Abstract

The invention discloses an application direction updating method and device, electronic equipment, a medium and a program product, and belongs to the technical field of electronic equipment. The application direction updating method comprises the steps that under the condition that first configuration of a target application is changed, the first direction of the target application is determined according to first information, and the first information comprises at least one of the following items: a second direction requested in the changed first configuration, a direction detected by a sensor and a direction indicated by a direction switch; and under the condition that the first direction is inconsistent with the current direction of the target application, if the current state of the electronic equipment supports direction updating of the target application, executing a direction updating process of the target application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of electronic equipment, and in particular, relates to an application direction updating method, device, electronic equipment, medium and program product. Background Art

[0002] Generally, multiple applications (including background applications, desktop, etc.) are opened on the terminal at the same time. These application windows have their own requested directions, but under the current direction management mechanism, they will be re-layouted according to the system direction.

[0003] If the application has not adapted to the corresponding orientation of the system and the window is visible, the user will see a disordered layout. For example, the current terminal opens vertical screen application A and horizontal screen application B in sequence, and stays on application B. At this time, the system orientation is generally horizontal. At this time, application A will also recalculate the layout according to the horizontal screen. If application A is not adapted to the horizontal screen layout and B is transparent, making A's window visible, you will see A's layout disordered. Summary of the invention

[0004] The embodiments of the present application provide an application direction update method, device, electronic device, medium and program product to avoid the problem of application layout disorder.

[0005] In a first aspect, an embodiment of the present application provides an application direction updating method, including:

[0006] In the case where the first configuration of the target application is changed, determining the first direction of the target application according to first information, the first information including at least one of the following: a second direction requested in the changed first configuration, a direction detected by a sensor, and a direction indicated by a direction switch;

[0007] In the case that the first direction is inconsistent with the current direction of the target application, if the current state of the electronic device supports the target application to update the direction, the direction update process of the target application is executed.

[0008] Optionally, the direction updating process of the target application includes:

[0009] generating a second configuration of the application component of the target application according to the first direction;

[0010] According to the second configuration, performing a first operation;

[0011] The first operation includes at least one of the following:

[0012] Perform orientation updates;

[0013] The window client of the application component is notified of the second configuration.

[0014] Optionally, when the application component is the highest-level component in the process where the target application is located, the first operation further includes:

[0015] The second configuration is sent to the process where the target application is located.

[0016] Optionally, the method further comprises:

[0017] When the current state of the electronic device does not support the target application to update the direction, determining whether the application component of the target application is in the switching process;

[0018] If it is in the switching process, wait for the switching process to be completed;

[0019] If it is not in the switching process and the direction of the application component of the target application determines the system direction, when the system direction changes, if the direction of the highest-level component in the current system is inconsistent with the system direction and it is in the switching process, wait for the switching process to be completed, otherwise, determine the system global configuration changes.

[0020] Optionally, the method further includes:

[0021] When the target condition is met, determining a first configuration change of the target application;

[0022] The target condition includes at least one of the following:

[0023] System global configuration changes;

[0024] Direction changes detected by sensors;

[0025] The screen orientation switch status changes;

[0026] The direction change requested by the target application;

[0027] Directional changes in the target application's associated parties;

[0028] The switch is complete.

[0029] In a second aspect, an embodiment of the present application further provides an application direction updating device, including:

[0030] a determination module, configured to determine, when a first configuration of a target application is changed, a first direction of the target application according to first information, wherein the first information includes at least one of the following: a second direction requested in the changed first configuration, a direction detected by a sensor, and a direction indicated by a direction switch;

[0031] The execution module is used for executing a direction update process of the target application if the first direction is inconsistent with the current direction of the target application and the current state of the electronic device supports the target application to update the direction.

[0032] Optionally, the execution module includes:

[0033] a generating unit, configured to generate a second configuration of the application component of the target application according to the first direction;

[0034] an execution unit, configured to execute a first operation according to the second configuration;

[0035] The first operation includes at least one of the following:

[0036] Perform orientation updates;

[0037] The window client of the application component is notified of the second configuration.

[0038] Optionally, when the application component is the highest-level component in the process where the target application is located, the execution unit is further configured to:

[0039] The second configuration is sent to the process where the target application is located.

[0040] Optionally, the device further comprises:

[0041] A determination module, configured to determine whether an application component of the target application is in a switching process when the current state of the electronic device does not support the target application to update the direction;

[0042] A first processing module, configured to wait for the handover process to be completed if the handover process is in progress;

[0043] The second processing module is used to wait for the switching process to be completed if the direction of the application component of the target application determines the system direction and if the system direction changes, if the direction of the highest-level component in the current system is inconsistent with the system direction and is in the switching process, otherwise, determine the system global configuration changes.

[0044] Optionally, the device further comprises:

[0045] A trigger module, configured to determine a first configuration change of a target application when a target condition is met;

[0046] The target condition includes at least one of the following:

[0047] System global configuration changes;

[0048] Direction changes detected by sensors;

[0049] The screen orientation switch status changes;

[0050] The direction change requested by the target application;

[0051] Directional changes in the target application's associated parties;

[0052] The switch is complete.

[0053] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps described in the first aspect.

[0054] In a fourth aspect, an embodiment of the present application further provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps described in the first aspect are implemented.

[0055] In a fifth aspect, an embodiment of the present application further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps described in the first aspect.

[0056] In a sixth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0057] In an embodiment of the present application, by determining the first direction of the target application based on the first information when the first configuration of the target application is changed, and when the first direction is inconsistent with the current direction of the target application, if the current state of the electronic device supports the target application to update the direction, the direction update process of the target application is executed, thereby avoiding the problem of disordered application layout. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 is a flowchart of an application direction updating method according to an embodiment of the present application;

[0059] Figure 2 is a schematic diagram comparing the principles of the original direction update mechanism and the direction update mechanism of the embodiment of the present application;

[0060] Figure 3 is a schematic diagram comparing the effects of the original direction update mechanism and the direction update mechanism of the embodiment of the present application;

[0061] Figure 4 is a schematic diagram of application configuration comparison of the direction update mechanism of an embodiment of the present application;

[0062] Figure 5 It is a detailed flow chart of an embodiment of the present application;

[0063] Figure 6 is a module schematic diagram of an application direction updating device according to an embodiment of the present application;

[0064] Figure 7 It is one of the structural schematic diagrams of the electronic device according to the embodiment of the present application;

[0065] Figure 8 This is the second structural schematic diagram of the electronic device according to the embodiment of the present application. DETAILED DESCRIPTION

[0066] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0067] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0068] The following, in conjunction with the accompanying drawings, describes in detail the application direction updating method, device, electronic device, medium and program product provided by the embodiments of the present application through specific embodiments and their application scenarios.

[0069] like Figure 1 As shown, an embodiment of the present application provides an application direction updating method, which is applied to an electronic device, and the method includes:

[0070] Step S101, when a first configuration of a target application is changed, determining a first direction of the target application according to first information, wherein the first information includes at least one of the following: a second direction requested in the changed first configuration, a direction detected by a sensor, and a direction indicated by a direction switch;

[0071] Step S102: when the first direction is inconsistent with the current direction of the target application, if the current state of the electronic device supports the target application to update the direction, then executing the direction update process of the target application.

[0072] It should be noted that in the embodiment of the present application, when the first configuration of the target application is changed, the first direction of the target application is determined according to the first information, and when the first direction is inconsistent with the current direction of the target application, if the current state of the electronic device supports the target application to update the direction, the direction update process of the target application is executed, thereby avoiding the problem of application layout disorder. For example, when a newly opened application affects the system direction, and the previously opened application is not compatible with the system direction, the previously opened application will not adjust the direction, thereby not causing the layout disorder of the previously opened application.

[0073] Optionally, the direction mentioned in the embodiment of the present application can be understood as the display direction of the application, that is, the layout direction of the application when it is displayed on the desktop, which direction generally includes: horizontal screen direction (abbreviated as horizontal screen) and vertical screen direction (abbreviated as vertical screen).

[0074] Optionally, in one implementation, the method further includes:

[0075] When the target condition is met, determining a first configuration change of the target application;

[0076] The target condition includes at least one of A11-A16:

[0077] A11. System global configuration changes;

[0078] This situation can be understood as the system orientation has changed. For example, the previous system orientation was horizontal, and the changed system orientation is vertical. At this time, it can be understood that the direction of the target application follows the system direction, that is, the change in the system orientation will affect the direction of the target application.

[0079] A12, direction change detected by the sensor;

[0080] It should be noted that the sensor refers to a sensor in an electronic device that detects the direction of the electronic device, such as a gyroscope or direction sensor in the electronic device. In this case, if the direction detected by the sensor changes, the direction of the target application may also change accordingly. For example, if the electronic device is in portrait mode, the direction of the target application is also in portrait mode. If the electronic device becomes landscape mode, the direction of the target application should also become landscape mode.

[0081] A13, screen orientation switch status changes;

[0082] It should be noted that this situation can be understood as the electronic device is provided with a screen orientation switch, for example, a switch for turning on the vertical screen. If the switch is turned on, it means that the electronic device needs to be in the vertical screen display state all the time. Even if the target application needs to change from the vertical screen to the horizontal screen, in this case, the direction of the target application will not change. For example, if the user turns off the switch for turning on the vertical screen, and the electronic device is in the horizontal screen state, if application A is in the vertical screen state before turning off the switch for turning on the vertical screen, then after turning off the switch for turning on the vertical screen, application A should be updated to the horizontal screen state.

[0083] A14, direction change requested by the target application;

[0084] In this case, it can be understood that the direction of the target application is affected by its requested direction. If the target application requests a horizontal screen at time 1 and a vertical screen at time 2, the direction should be changed based on the request of the target application.

[0085] A15. Direction changes of the associated parties of the target application;

[0086] It should be noted that the associated party can be understood as other applications or components that affect the direction of the target application. For example, the direction of application A changes with the direction of application B (that is, the direction of application A is consistent with the direction of application B). When application B changes from portrait to landscape, the direction of application A should also change from portrait to landscape.

[0087] A16, switching is completed;

[0088] This situation can be understood as follows: if the target application becomes the application currently being used by the user through switching, the direction of the target application may change after the switching is completed. For example, before the switching, the target application is displayed in portrait mode in the system background, and the user switches the target application in landscape mode, that is, the target application running in the system background is switched to the foreground. At this time, the target application should be displayed in landscape mode in the foreground after the switching.

[0089] Optionally, the first direction mentioned in the embodiment of the present application refers to the actual display direction of the target application, that is, the actual direction of the target application.

[0090] Optionally, in one implementation, the specific implementation of determining the first direction of the target application according to the first information includes at least one of the following:

[0091] B11. If the direction indicated by the direction switch does not support the second direction, the first direction of the determined target application should be the same as the direction indicated by the direction switch;

[0092] For example, the second direction is landscape, and the direction indicated by the direction switch is portrait (for example, the electronic device is provided with a switch to determine whether to turn on the portrait display, and if the switch is turned on, it indicates that the electronic device needs to always be in portrait display state). At this time, the electronic device does not support the direction requested by the target application, that is, the first direction of the target application should be portrait, that is, the actual direction of the target application determined at this time should be portrait.

[0093] B12. If the direction indicated by the direction switch supports the second direction, the first direction of the target application is determined to be the second direction;

[0094] For example, the second direction is landscape, and the direction indicated by the direction switch can be either landscape or portrait (for example, the electronic device is provided with a switch to determine whether to turn on the portrait display. If the switch is turned off, it indicates that the electronic device can be in either portrait or portrait display state). At this time, the electronic device supports the direction requested by the target application, that is, the first direction of the target application should be landscape, that is, the actual direction of the target application determined at this time should be landscape.

[0095] B13. If the direction detected by the sensor is the same as the second direction, the first direction of the determined target application should be the same as the direction detected by the sensor;

[0096] For example, the second direction is landscape, and the direction detected by the sensor is landscape. At this time, the electronic device supports the direction requested by the target application, that is, the first direction of the target application should be landscape, that is, the actual direction of the target application determined at this time should be landscape.

[0097] B14. If the direction detected by the sensor is different from the second direction, and if the direction indicated by the direction switch supports the second direction, the first direction of the target application is determined to be the second direction;

[0098] For example, the second direction is landscape, and the direction detected by the sensor is portrait. The direction indicated by the direction switch can be either landscape or portrait (for example, the electronic device is provided with a switch to determine whether to turn on the portrait display. If the switch is turned off, it indicates that the electronic device can be in either portrait or portrait display state). At this time, the electronic device supports the direction requested by the target application, that is, the first direction of the target application should be landscape, that is, the actual direction of the target application determined at this time should be landscape.

[0099] B15. If the direction detected by the sensor is different from the second direction, and if the direction indicated by the direction switch does not support the second direction, the first direction of the determined target application should be the same as the direction detected by the sensor;

[0100] For example, the second direction is landscape, the direction detected by the sensor is portrait, and the direction indicated by the direction switch is portrait (for example, the electronic device is provided with a switch to determine whether to turn on the portrait display. If the switch is turned on, it indicates that the electronic device needs to always be in portrait display state). At this time, the electronic device does not support the direction requested by the target application, that is, the first direction of the target application should be portrait, that is, the actual direction of the target application determined at this time should be portrait.

[0101] It should be noted that the above B11-B15 are merely examples for determining the first direction of the target application and do not constitute a limitation on the embodiments of the present application. Any implementation method that can determine the first direction of the target application belongs to the protection scope of the embodiments of the present application.

[0102] Optionally, in one implementation, the specific implementation of the direction update process of the target application includes:

[0103] Step S11, generating a second configuration of the application component of the target application according to the first direction;

[0104] Optionally, the second configuration includes the first direction.

[0105] Step S12, performing a first operation according to the second configuration;

[0106] The first operation includes at least one of the following:

[0107] A11, execute direction update;

[0108] That is, in this case, the direction is updated directly according to the direction indicated by the second configuration.

[0109] A12. Notify the window client of the application component of the second configuration;

[0110] It should be noted that, by sending the second configuration to the window client of the application component, the window client can re-render the layout according to the direction indicated by the second configuration to ensure that the window layout adapts to the direction indicated by the second configuration.

[0111] Optionally, in an implementation manner, when the application component is the highest-level component in the process where the target application is located, the first operation further includes:

[0112] The second configuration is sent to the process where the target application is located.

[0113] It should be noted that since the direction of a process is consistent with the direction of the highest-level component in the process, if the application component of the target application is not the highest-level component in the process where the target application is located, it will not affect the direction of the process. If it is the highest-level component, the direction of the process needs to be adjusted, and the second configuration needs to be sent to the process to adjust the direction of the process.

[0114] Optionally, in one implementation, the method further includes:

[0115] S21, when the current state of the electronic device does not support the target application to update the direction, determining whether the application component of the target application is in the switching process;

[0116] Optionally, the switching mentioned in the embodiments of the present application refers to a change in the state of the electronic device (for example, the screen state in one case), for example, application switching, that is, switching from one application to another; orientation switching, that is, switching from one orientation to another (for example, switching from horizontal screen to vertical screen); unlocking the electronic device; switching the electronic device from off screen to bright screen; switching the electronic device from bright screen to off screen, etc.

[0117] S22, if in the switching process, waiting for the switching process to be completed;

[0118] It should be noted that if the target application is in the switching process, it is not suitable to update the direction of the target application. At this time, it is necessary to wait for the application switching to be completed before continuing the subsequent direction update process.

[0119] S23, if it is not in the switching process, and the direction of the application component of the target application determines the system direction, in the case of a change in the system direction, if the direction of the highest-level component in the current system is inconsistent with the system direction and it is in the switching process, wait for the switching process to be completed, otherwise, determine the system global configuration change.

[0120] It should be noted that the direction of the application component determines the direction of the system, which can be understood as the system direction is affected by the direction of the application component, that is, the system direction is the same as the direction of the application component, and the application component can also be called the system direction source.

[0121] It should be noted that if the switching process is not in progress and the application component of the target application is not the system direction source, the direction update process can be executed; however, if the application component of the target application is the system direction source, it is necessary to determine whether the system mode has changed. If there is no change, the direction update process can be executed. If there is a change, and the direction of the current highest-level component of the system is inconsistent with the system direction, but it is not in the switching process, then the system global configuration change is determined. If there is a change, and the direction of the current highest-level component of the system is inconsistent with the system direction, and it is in the switching process, it is necessary to wait for the switching to be completed before continuing the subsequent application direction update process.

[0122] It should be noted that, under the Android mechanism, direction and configuration (config) are bound, and the system direction update causes the system global config to be updated, which will then be sent to all window containers and to each application process. The application client will then be laid out according to the new config; and the embodiment of the present application is intended to ensure that the direction-related information in the application window and process config remains the direction requested by the application itself, so that the application can be laid out according to the requested direction. When the application direction has not changed, the system direction change will not trigger the application client to re-layout and draw.

[0123] like Figure 2 As shown in the figure, the relationship between the application request direction, system direction, and application actual direction is marked. Figure 2 As shown, in the original direction update mechanism, the direction requested by the application will affect the system direction, and after the system direction is updated, it will affect the direction of the application window (non-special modes such as split-screen small windows will directly determine the direction of the application window), and the application window and the application client are bound, thus determining the drawing direction of the application client content layout; while using the direction update mechanism of the embodiment of the present application, the direction requested by the application affects the system direction and also affects the actual direction of the application itself, but there is no strong correlation between the system direction and the actual direction of the application itself.

[0124] It should be noted that when the original direction update mechanism switches continuously between applications in different directions, freezes or display anomalies usually occur because the system direction is updated when the application is switched; the original direction update mechanism has some limitations because the application direction and the system direction are consistent, resulting in many scenarios requiring frozen screen rotation animation, such as Figure 3The effect of the original direction update mechanism in is illustrated. For example, when the opened application window has some properties such as semi-transparent, non-full screen, etc. that may allow you to see other application interfaces below, seamless switching is not allowed, because this will expose the sudden change process of the application interface content below, and will display half-screen and other abnormalities. For example, vertical screen application A opens transparent horizontal screen application B. If seamless switching is performed, after opening B, the system direction is directly switched to horizontal. In this case, the vertical screen application A below will also suddenly switch to horizontal, and because the client and server are not synchronized, screen flashing and other phenomena will occur. The direction update mechanism of the embodiment of the present application has independent directions for each application. For example, in the above example scenario, vertical screen application A still maintains vertical display, and the animation will not be interrupted midway. For application configuration comparison, Figure 4 As shown in the figure, the system window management service (wms) sends different direction configs to the clients of application A and application B respectively to keep their different directions displayed. Therefore, there is no need to worry about sudden screen flashing problems. You can directly switch seamlessly. The system direction is changed after the application switching is completed to ensure smooth animation transition. The switching process can be seen in Figure 3 The switching effect under the direction update mechanism of the embodiment of the present application.

[0125] It should also be noted that under the original direction update mechanism, when returning to the portrait desktop from a landscape application, in some scenarios, such as when there is a pip window (i.e., a reduced window), the desktop may undergo repeated config changes, i.e., direction changes, which will cause the desktop to be repeatedly re-layouted and redrawn, which can easily cause time-consuming jams. After returning to the desktop, the system direction becomes portrait, and the landscape application will receive the portrait config. The internal logic of the application may modify the layout information according to the portrait. When the landscape application is opened again, it will re-update the layout according to the landscape. In the direction update mechanism of the embodiment of the present application, in the above-mentioned pip scenario, the desktop will not receive repeated direction changes, and will independently maintain its own portrait layout. There is no time-consuming jamming problem, and the landscape application will not receive the portrait config after exiting. There is no need to re-layout and redraw when it is opened again, thereby ensuring the smoothness of application switching.

[0126] It should be noted that Android has the concept of processes. Each application runs in a process, and multiple applications, components, services, and floating windows can run in the same process. Each component has a different direction, and the process also has config information. In the original direction update mechanism, the process config is to obtain the config of the highest-level component, and the direction of the component config in the original direction update mechanism is roughly consistent with the system direction except for the switching process. The application in the process will also use the process config for layout processing on the client. The direction update mechanism of the embodiment of the present application has been compatible with this, ensuring that the direction of the process config is consistent with the direction of the top display component. If no component is visible and there is a foreground service or floating window, it must be consistent with the system direction.

[0127] The implementation process of the embodiment of the present application is described in detail below.

[0128] like Figure 5 As shown, the main process includes:

[0129] Step 501, determining a first configuration change of a target application;

[0130] For example, at least one of the following processes may be included:

[0131] Process A: When the system global configuration changes, that is, when the system config is updated, it will trigger the first configuration change of the target application;

[0132] It should be noted that the system global configuration includes not only direction information, but also dark mode switching, so forced direction updates are also required.

[0133] Process B: The orientation change detected by the sensor and / or the screen orientation switch status change may trigger the first configuration change of the target application;

[0134] It should be noted that this process may not trigger configuration changes, but components that rely on these directions will be updated in a timely manner, actively triggering configuration changes.

[0135] Process C: The direction change requested by the target application, that is, the direction change requested by the application itself triggers the first configuration change of the target application;

[0136] Process D: The direction of the associated party of the target application changes. That is, if the direction of the dependent party of the target application changes, it will trigger the first configuration change of the target application.

[0137] For example, when the direction of component A follows component B below, the direction change of component B will notify component A's configuration update.

[0138] Process E: The handover is completed. That is, after the handover is completed, the participating components trigger the direction update, which will trigger the first configuration change of the target application;

[0139] It should be noted that the direction change cannot be triggered during the switching process, otherwise it will cause random flashing. You need to try to trigger the configuration change after the switching is completed.

[0140] It should be noted that if any of the above processes exists, step 502 will be triggered.

[0141] Step 502, determining a first direction of the target application according to the first information;

[0142] Specifically, the first information includes but is not limited to at least one of the following: a second direction requested in the first configuration after the change, a direction detected by a sensor, and a direction indicated by a direction switch.

[0143] Optionally, if it is determined that the obtained first direction is inconsistent with the current direction of the application, step 503 is executed.

[0144] Step 503, determining whether the current state of the electronic device supports the application to update the direction;

[0145] For example, if the application component is the container that ultimately determines the system direction, or the application component is in a switching process, the direction cannot be updated immediately, and the process goes to step 510 ; otherwise, the process goes to step 504 .

[0146] Step 504: generating a second configuration of the application component of the target application according to the first direction;

[0147] Step 505, executing direction update;

[0148] It should be noted that if the current system does not have a switching process being prepared (which can be represented by a switching animation), a switching process of direction change will be triggered automatically. If the current system already has a switching process, the direction update will be directly added to the switching process that has been executed.

[0149] Step 506, determining that the application component is the highest-level component in the process where the target application is located; if it is the highest-level component, executing step 507;

[0150] Step 507, sending the second configuration to the process where the target application is located;

[0151] This step is to pass the new configuration to the application process through a cross-process method (binder).

[0152] It should be noted that step 506 and step 507 are optional steps.

[0153] Step 508, notifying the window client of the application component of the second configuration;

[0154] It should be noted that this step is to pass the new configuration to the application's window client in a cross-process manner.

[0155] Step 509, the window client redraws the application layout;

[0156] It should be noted that after receiving these callbacks, the application's window client will rearrange and draw according to the received information to adapt to the current direction.

[0157] Step 510, determining whether the application component of the target application is in the switching process, if it is in the switching process, executing step 511, otherwise executing step 512;

[0158] Step 511, waiting for the handover process to be completed, and then triggering the E process in step 501;

[0159] Step 512, determining whether the application component is a system direction source, if it is a system direction source, executing step 513;

[0160] Step 513, update system direction;

[0161] It should be noted that step 513 can also be triggered by other trigger points in the system process (the original direction update mechanism itself triggers the process, which will not be described in detail here), which means calculating and trying to update the system direction. If the direction does change, go to step 514.

[0162] Step 514, determining whether the direction of the highest-level component in the current system is inconsistent with the system direction and is in the switching process, if so, executing step 511, otherwise triggering process A in step 501;

[0163] It should be noted that, through the above process of the embodiment of the present application, the strong association between the system direction and the actual direction of the application window is released, and the actual direction of the application is determined by the application's own requested direction combined with factors such as the current system sensor direction and the direction switch.

[0164] The embodiments of the present application can achieve the following beneficial effects:

[0165] 1. When application windows in different directions are displayed at the same time, they can be displayed in their own directions to avoid disordered layout, and provide strong support for the needs of the atomic workbench (the atomic workbench can display multiple application windows at the same time) that require multiple applications in different directions to be displayed in their own directions at the same time;

[0166] 2. When the system direction changes, other application windows do not need to constantly switch their layout and drawing, avoiding unnecessary time-consuming waiting;

[0167] 3. Seamless application switching is the prerequisite for the extreme speed engine to quickly switch applications (it is impossible to continue opening and exiting applications when the frozen screen rotates). The embodiment of the present application also ensures the smoothness of switching back and forth between multiple applications.

[0168] It should be noted that the application direction update method provided in the embodiment of the present application can be executed by an application direction update device, or a control module in the application direction update device for executing the application direction update method. In the embodiment of the present application, the application direction update method provided in the embodiment of the present application is described by taking the application direction update device executing the application direction update method as an example.

[0169] like Figure 6 As shown, at least one embodiment of the present application further provides an application direction updating device, which is applied to an electronic device, and the device includes:

[0170] A determination module 601 is used to determine a first direction of the target application according to first information when a first configuration of the target application is changed, wherein the first information includes at least one of the following: a second direction requested in the changed first configuration, a direction detected by a sensor, and a direction indicated by a direction switch;

[0171] The execution module 602 is configured to execute a direction update process of the target application if the first direction is inconsistent with the current direction of the target application and the current state of the electronic device supports the target application to update the direction.

[0172] Optionally, the execution module 602 includes:

[0173] a generating unit, configured to generate a second configuration of the application component of the target application according to the first direction;

[0174] an execution unit, configured to execute a first operation according to the second configuration;

[0175] The first operation includes at least one of the following:

[0176] Perform orientation updates;

[0177] The window client of the application component is notified of the second configuration.

[0178] Optionally, when the application component is the highest-level component in the process where the target application is located, the execution unit is further configured to:

[0179] The second configuration is sent to the process where the target application is located.

[0180] Optionally, the device further comprises:

[0181] A determination module, configured to determine whether an application component of the target application is in a switching process when the current state of the electronic device does not support the target application to update the direction;

[0182] A first processing module, configured to wait for the handover process to be completed if the handover process is in progress;

[0183] The second processing module is used to wait for the switching process to be completed if the direction of the application component of the target application determines the system direction and if the system direction changes, if the direction of the highest-level component in the current system is inconsistent with the system direction and is in the switching process, otherwise, determine the system global configuration changes.

[0184] Optionally, the device further comprises:

[0185] A trigger module, configured to determine a first configuration change of a target application when a target condition is met;

[0186] The target condition includes at least one of the following:

[0187] System global configuration changes;

[0188] Direction changes detected by sensors;

[0189] The screen orientation switch status changes;

[0190] The direction change requested by the target application;

[0191] Directional changes in the target application's associated parties;

[0192] The switch is complete.

[0193] It should be noted that the device embodiment corresponds to the above method, and all implementation methods in the above method embodiment are applicable to the device embodiment and can achieve the same technical effect.

[0194] The application direction updating device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0195] The application direction updating device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0196] The application direction updating device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0197] The device of the embodiment of the present application can achieve the following beneficial effects:

[0198] 1. When application windows in different directions are displayed at the same time, they can be displayed in their own directions to avoid disordered layout, and provide strong support for the needs of the atomic workbench (the atomic workbench can display multiple application windows at the same time) that require multiple applications in different directions to be displayed in their own directions at the same time;

[0199] 2. When the system direction changes, other application windows do not need to constantly switch their layout and drawing, avoiding unnecessary time-consuming waiting;

[0200] 3. Seamless application switching is the prerequisite for the extreme speed engine to quickly switch applications (it is impossible to continue opening and exiting applications when the frozen screen rotates). The embodiment of the present application also ensures the smoothness of switching back and forth between multiple applications.

[0201] Optional, such as Figure 7As shown, an embodiment of the present application also provides an electronic device 700, including a processor 701, a memory 702, and a program or instruction stored in the memory 702 and executable on the processor 701. When the program or instruction is executed by the processor 701, each process of the above-mentioned application direction update method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0202] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0203] Figure 8 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0204] The electronic device 800 includes but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810 and other components.

[0205] Those skilled in the art will appreciate that the electronic device 800 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 810 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0206] The processor 810 is configured to:

[0207] In the case where the first configuration of the target application is changed, determining the first direction of the target application according to first information, the first information including at least one of the following: a second direction requested in the changed first configuration, a direction detected by a sensor, and a direction indicated by a direction switch;

[0208] In the case that the first direction is inconsistent with the current direction of the target application, if the current state of the electronic device supports the target application to update the direction, the direction update process of the target application is executed.

[0209] It should be noted that, by determining the first direction of the target application based on the first information when the first configuration of the target application changes, and when the first direction is inconsistent with the current direction of the target application, if the current state of the electronic device supports the target application to update the direction, the direction update process of the target application is executed, thereby avoiding the problem of disordered application layout.

[0210] Optionally, the processor 810 is configured to:

[0211] generating a second configuration of the application component of the target application according to the first direction;

[0212] According to the second configuration, performing a first operation;

[0213] The first operation includes at least one of the following:

[0214] Perform orientation updates;

[0215] The window client of the application component is notified of the second configuration.

[0216] Optionally, when the application component is the highest-level component in the process where the target application is located, the first operation further includes:

[0217] The second configuration is sent to the process where the target application is located.

[0218] Optionally, the processor 810 is further configured to:

[0219] When the current state of the electronic device does not support the target application to update the direction, determining whether the application component of the target application is in the switching process;

[0220] If it is in the switching process, wait for the switching process to be completed;

[0221] If it is not in the switching process and the direction of the application component of the target application determines the system direction, when the system direction changes, if the direction of the highest-level component in the current system is inconsistent with the system direction and it is in the switching process, wait for the switching process to be completed, otherwise, determine the system global configuration changes.

[0222] Optionally, the processor 810 is further configured to:

[0223] When the target condition is met, determining a first configuration change of the target application;

[0224] The target condition includes at least one of the following:

[0225] System global configuration changes;

[0226] Direction changes detected by sensors;

[0227] The screen orientation switch status changes;

[0228] The direction change requested by the target application;

[0229] Directional changes in the target application's associated parties;

[0230] The switch is complete.

[0231] It should be noted that the electronic device of the embodiment of the present application can achieve the following beneficial effects:

[0232] 1. When application windows in different directions are displayed at the same time, they can be displayed in their own directions to avoid disordered layout, and provide strong support for the needs of the atomic workbench (the atomic workbench can display multiple application windows at the same time) that require multiple applications in different directions to be displayed in their own directions at the same time;

[0233] 2. When the system direction changes, other application windows do not need to constantly switch their layout and drawing, avoiding unnecessary time-consuming waiting;

[0234] 3. Seamless application switching is the prerequisite for the extreme speed engine to quickly switch applications (it is impossible to continue opening and exiting applications when the frozen screen rotates). The embodiment of the present application also ensures the smoothness of switching back and forth between multiple applications.

[0235] It should be understood that in the embodiment of the present application, the input unit 804 may include a graphics processor (Graphics Processing Unit, GPU) 8041 and a microphone 8042, and the graphics processor 8041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 807 includes a touch panel X071 and other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 may include two parts: a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 809 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 810 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, the user interface, and the application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 810.

[0236] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned application direction update method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0237] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0238] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned application direction update method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0239] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0240] The embodiment of the present application further provides a computer program / program product, which is stored in a storage medium, and is executed by at least one processor to implement the various processes of the above-mentioned application direction update method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0241] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0242] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0243] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for updating an application direction, characterized in that: include: In the case where the first configuration of the target application is changed, determining the first direction of the target application according to first information, the first information including at least one of the following: a second direction requested in the changed first configuration, a direction detected by a sensor, and a direction indicated by a direction switch; In the case that the first direction is inconsistent with the current direction of the target application, if the current state of the electronic device supports the target application to update the direction, the direction update process of the target application is executed.

2. The method according to claim 1, characterized in that The direction updating process of the target application includes: generating a second configuration of the application component of the target application according to the first direction; According to the second configuration, performing a first operation; The first operation includes at least one of the following: Perform orientation updates; The window client of the application component is notified of the second configuration.

3. The method according to claim 2, characterized in that In the case where the application component is the highest-level component in the process where the target application is located, the first operation further includes: The second configuration is sent to the process where the target application is located.

4. The method according to claim 1, characterized in that: The method further comprises: When the current state of the electronic device does not support the target application to update the direction, determining whether the application component of the target application is in the switching process; If it is in the switching process, wait for the switching process to be completed; If it is not in the switching process and the direction of the application component of the target application determines the system direction, when the system direction changes, if the direction of the highest-level component in the current system is inconsistent with the system direction and it is in the switching process, wait for the switching process to be completed, otherwise, determine the system global configuration changes.

5. The method according to any one of claims 1 to 4, characterized in that: Also includes: When the target condition is met, determining a first configuration change of the target application; The target condition includes at least one of the following: System global configuration changes; Direction changes detected by sensors; The screen orientation switch status changes; The direction change requested by the target application; Directional changes in the target application's associated parties; The switch is complete.

6. An application direction updating device, characterized in that: include: a determination module, configured to determine, when a first configuration of a target application is changed, a first direction of the target application according to first information, wherein the first information includes at least one of the following: a second direction requested in the changed first configuration, a direction detected by a sensor, and a direction indicated by a direction switch; The execution module is used for executing a direction update process of the target application if the first direction is inconsistent with the current direction of the target application and the current state of the electronic device supports the target application to update the direction.

7. The device according to claim 6, characterized in that The execution module comprises: a generating unit, configured to generate a second configuration of the application component of the target application according to the first direction; an execution unit, configured to execute a first operation according to the second configuration; The first operation includes at least one of the following: Perform orientation updates; The second configuration is notified to the window client of the application component.

8. The device according to claim 7, characterized in that In the case where the application component is the highest-level component in the process where the target application is located, the execution unit is further configured to: The second configuration is sent to the process where the target application is located.

9. The device according to claim 6, characterized in that Also includes: A determination module, configured to determine whether an application component of the target application is in a switching process when the current state of the electronic device does not support the target application to update the direction; A first processing module, configured to wait for the handover process to be completed if the handover process is in progress; The second processing module is used to wait for the switching process to be completed if the direction of the application component of the target application determines the system direction and if the system direction changes, if the direction of the highest-level component in the current system is inconsistent with the system direction and is in the switching process, otherwise, determine the system global configuration changes.

10. The device according to any one of claims 6 to 9, characterized in that: Also includes: A trigger module, configured to determine a first configuration change of a target application when a target condition is met; The target condition includes at least one of the following: System global configuration changes; Direction changes detected by sensors; The screen orientation switch status changes; The direction change requested by the target application; Directional changes in the target application's associated parties; The switch is complete.

11. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the application direction updating method as described in any one of claims 1 to 5.

12. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the application direction updating method according to any one of claims 1 to 5 are implemented.

13. A computer program product, characterized in that It comprises computer instructions, which, when executed by a processor, implement the steps of the application direction updating method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Control method of mobile terminal and mobile terminal

    CN102662582A

  • Method for triggering operation in mobile terminal, and mobile terminal

    CN102736857A

  • Landscape and portrait switching method and mobile terminal

    CN107340958A

  • Screen display direction switching processing method and device and terminal equipment

    CN110557503A

  • Automatic setting method for horizontal screen and vertical screen of mobile terminal

    CN113220385A

Cited By

  • Application orientation updating method and apparatus, electronic device, medium and program product

    WO2026138651A1