Method, device and storage medium for processing configuration changes

By monitoring system configuration changes and judging the status of the application interface when the device is in a horizontal screen state, the problem of circular restart and continuous flickering of the application interface is solved, and the user experience is improved.

CN118740971BActive Publication Date: 2025-02-18HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411223215.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2025-02-18
Estimated Expiration
2044-09-03

AI Technical Summary

Technical Problem

When the user uses the device in a horizontal screen, some applications do not adapt to the horizontal screen, causing the application interface to restart cycle and continue to flicker, affecting the user experience.

Method used

When the device is in a horizontal screen state, monitor system configuration changes, determine whether the application interface is in an active state, whether it is requested to start the vertical screen interface, and whether it supports forced horizontal screen. If these conditions are met, the operation of sending configuration change messages to the application is exited to prevent the application interface from restarting cyclically.

Benefits of technology

It effectively interrupts the cycle restart process of the application interface that does not support horizontal screen display but supports forced horizontal screen, preventing the application interface from flashing continuously and improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740971B_ABST
    Figure CN118740971B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and storage medium for processing configuration changes, and belongs to the field of terminal technology. The method includes: when the electronic device is in a horizontal screen state, in response to a system configuration change occurring during the operation of a first application, when the first application meets a preset condition, exiting the operation of sending a configuration change message to the first application. Among them, the configuration change message is used to indicate that the system configuration has changed, and the preset conditions include that the application interface of the first application is in an activated state, the first application requests to start the application interface in the portrait orientation, and the first application supports forced horizontal screen. In this way, when the current application interface is displayed in the foreground and the current application does not support horizontal screen display but supports forced horizontal screen, the operation of sending a configuration change message to the application can be exited, thereby interrupting the cyclic restart process of the application interface, preventing the application interface from continuously flickering, and improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a method, device and storage medium for processing configuration changes. Background Art

[0002] With the continuous development of terminal technology, terminal devices are becoming more and more powerful, and a variety of applications can be installed for users to use. However, when users use the device in landscape mode, some applications may not be adapted to landscape mode and do not support landscape display. For these applications, users or the system can set them to support forced landscape mode as needed to force them to support landscape display.

[0003] For an application that does not support landscape display but is configured to support forced landscape display, when the device is in landscape state, when the user first starts a certain application interface of the application (or a part of the application interface that does not support landscape display), the application can initiate a startup request for the application interface in portrait orientation according to the user's startup operation. After receiving the startup request, the system can first determine whether the application interface supports forced landscape display. If it supports forced landscape display, the request for portrait orientation is ignored, and the boundary information of the application interface is modified to the boundary information of the landscape orientation interface to display the application interface in landscape orientation. In addition, the change of boundary information belongs to a kind of system configuration change, so the change of boundary information will also trigger a configuration change message. For the configuration change message triggered by the system side, the system will dispatch the configuration change message to the application. After receiving the configuration change message, the application will restart the application interface according to the system configuration change, and the restart of the application interface will cause the interface to flicker. When the application interface is restarted, the above process will be repeated, and this repeated cycle will cause the application interface to restart cyclically, causing the application interface to flicker continuously. Summary of the invention

[0004] The present application provides a method, device and storage medium for processing configuration changes, which can interrupt the cyclic restart process of an application interface that does not support landscape display but supports forced landscape display when the device is in landscape mode, prevent the application interface from continuously flickering, and improve the user experience.

[0005] The technical solution is as follows:

[0006] In a first aspect, a method for processing a configuration change is provided, the application being in an electronic device, the electronic device including a first application, including:

[0007] When the electronic device is in a landscape state, in response to a system configuration change occurring during the operation of a first application, when the first application satisfies a preset condition, the operation of sending a configuration change message to the first application is exited. The configuration change message is used to indicate that the system configuration has changed, and the preset condition includes that the application interface of the first application is in an activated state, the first application requests to start the application interface in a portrait orientation, and the first application supports forced landscape.

[0008] That is, when the electronic device is in the horizontal screen state, during the application running process, if the system configuration change is monitored, it can first be determined whether the current application interface of the application is in an activated state, whether the application requests to start the application interface in the vertical screen direction, and whether the application supports forced horizontal screen. If the current application interface of the application is in an activated state, the application requests to start the application interface in the vertical screen direction, and the application supports forced horizontal screen, then the operation of sending the configuration change message to the application is exited, that is, the configuration change message is not distributed to the application. When the system configuration change is monitored, if the current application interface of the application is in an activated state, the application requests to start the application interface in the vertical screen direction, and the application supports forced horizontal screen, it means that the current application interface is displayed in the foreground, the current application does not support horizontal screen display but supports forced horizontal screen. At this time, if the configuration change message is distributed to the application, it may cause the application to cyclically restart the application interface according to the configuration change message. In this case, by exiting the operation of sending the configuration change message to the application, that is, not distributing the configuration change message to the application, the application can be prevented from restarting the application interface according to the configuration change message, thereby interrupting the cyclic restart process of the application interface of the application, preventing the application interface from continuously flickering, and improving the user experience.

[0009] In one embodiment of the present application, when the first application meets a preset condition, before exiting the operation of sending a configuration change message to the first application, in response to the user's operation of launching the first application interface of the first application, if the first application interface does not support landscape display, the first application initiates a first launch request, and the first launch request is used to request to launch the first application interface in portrait orientation; in response to the first launch request, if the first application supports forced landscape orientation, the boundary corresponding to the first application interface is adjusted to the boundary of the landscape orientation interface, and a configuration change message is triggered.

[0010] In this way, when the electronic device is in landscape mode and the first application in the electronic device does not support landscape display but supports forced landscape, after the application interface of the first application is started for the first time to trigger a configuration change message, it is possible to prohibit the configuration change message from being sent to the first application, so that the first application cannot restart the application interface according to the configuration change message, and the first application interface can stop restarting after the first startup, thereby avoiding the problem of continuous flickering of the interface caused by cyclic restart of the application interface.

[0011] In one embodiment of the present application, after the boundary of the first application interface is adjusted to the boundary of the horizontal screen interface, the first application interface in the horizontal screen direction is displayed, and the first application interface enters the activated state. That is, after the boundary is adjusted, the first application interface can enter the activated state.

[0012] The first application interface enters the activated state to indicate that the first application interface is visible and interactive. The activated state is an important stage in the life cycle of the activity corresponding to the first application interface, and is one of the most active states in the activity life cycle. When the activity is in the activated state, it means that the activity is visible, in the foreground, has the user input focus, can receive user input and interact with the user.

[0013] In one embodiment of the present application, in response to the first start request, when the first application does not support forced landscape, the first application interface in portrait orientation is displayed. That is, when the first application does not support forced landscape, the system can directly display the first application interface in portrait orientation without adjusting the borders in order to force the first application interface to be displayed in landscape orientation.

[0014] In one embodiment of the present application, in response to a user operation of launching a first application interface of a first application, when the first application interface supports landscape display, the first application initiates a second launch request, and the second launch request is used to request to launch the first application interface in landscape orientation; in response to the second launch request, the first application interface in landscape orientation is displayed.

[0015] That is, when the first application interface supports landscape display, the first application can directly request to start the first application interface in landscape orientation, so that the electronic device displays the first application interface in landscape orientation.

[0016] In one embodiment of the present application, in response to a system configuration change occurring during the running of a first application, if the first application does not meet a preset condition, a configuration change message is sent to the first application; the first application initiates a second startup request based on the configuration change message, and the second startup request is used to request to restart the first application interface.

[0017] When the system configuration changes during the operation of the first application, if the first application does not meet the preset conditions, the configuration change message can be processed normally, that is, the configuration change message can be dispatched to the first application normally, thus avoiding affecting the normal operation of the application under normal circumstances.

[0018] In one embodiment of the present application, the first application does not meet the preset condition including one or more of the following situations:

[0019] The application interface of the first application is not in an activated state; the first application requests to start the application interface in a horizontal screen direction; the first application does not support forced horizontal screen.

[0020] In one embodiment of the present application, when the first application does not meet the preset conditions, before sending a configuration change message to the first application, in response to the user's operation of starting the first application interface of the first application, when the first application interface supports horizontal screen display, the first application initiates a second start request, and the second start request is used to request to start the first application interface in horizontal direction; in response to the second start request, the first application interface in horizontal direction is displayed; an instruction to change the system configuration is received; the system configuration is changed according to the instruction, and a configuration change message is triggered.

[0021] In this way, when the first application supports horizontal screen display, if a system configuration change occurs during the operation of the first application, a configuration change message can be normally sent to the first application, so that the electronic device can normally display the application interface in the horizontal screen direction.

[0022] In one embodiment of the present application, when the first application does not meet a preset condition, before sending a configuration change message to the first application, in response to a user operation of launching a first application interface of the first application, if the first application interface does not support landscape display, the first application initiates a first launch request, and the first launch request is used to request to launch the first application interface in portrait orientation; in response to the first launch request, if the first application does not support forced landscape display, an application interface in portrait orientation is displayed; an instruction to change the system configuration is received; the system configuration is changed according to the instruction, and a configuration change message is triggered.

[0023] In this way, when the first application does not support landscape display and does not support forced landscape, if a system configuration change occurs during the running of the first application, a configuration change message can be sent to the first application normally, so that the electronic device can normally display the application interface in portrait orientation.

[0024] In one embodiment of the present application, when the first application does not meet the preset conditions, before sending a configuration change message to the first application, when the application interface of the first application is not in an activated state, an instruction to change the system configuration is received; the system configuration is changed according to the instruction, and a configuration change message is triggered.

[0025] In this way, when the application interface of the first application is not in an activated state, such as in a paused or stopped state, if a system configuration change occurs during the operation of the first application, a configuration change message can be normally sent to the first application so that the first application can be correctly configured.

[0026] In one embodiment of the present application, the preset conditions also include at least one of the following conditions: the display mode of the first application interface is full-screen display; the number of times the first application interface triggers the activation state within a certain period of time reaches a first preset number of times; the number of times the first application interface changes the boundary within a certain period of time reaches a second preset number of times.

[0027] The certain duration may be a pre-configured duration, and the first preset number of times and the second preset number of times may also be pre-set, for example, 2 times or 3 times.

[0028] By adding the display mode of the first application interface as full-screen display to the preset conditions, the accuracy of predicting the current scene as a scene in which the interface continuously flickers can be improved. By setting the condition that the number of times the first application interface triggers the activation state within a certain period of time reaches a first preset number of times, it can be limited to prohibiting the dispatch of configuration change messages to the application when the first application interface frequently triggers the activation state, and the accuracy of predicting the current scene as a scene in which the interface continuously flickers can be improved. By adding the condition that the number of times the first application interface changes the boundary within a certain period of time reaches a second preset number of times to the preset conditions, it can be limited to prohibiting the dispatch of configuration change messages to the application when the first application interface frequently modifies the boundary, and the accuracy of predicting the current scene as a scene in which the interface continuously flickers can be further improved.

[0029] In a second aspect, a device for processing configuration changes is provided, wherein the device for processing configuration changes has the function of implementing the method behavior for processing configuration changes in the first aspect. The device for processing configuration changes includes at least one module, and the at least one module is used to implement the method for processing configuration changes provided in the first aspect.

[0030] In a third aspect, a device for processing configuration changes is provided, wherein the structure of the device for processing configuration changes includes a processor and a memory, wherein the memory is used to store a program that supports the device for processing configuration changes to execute the method provided in the first aspect, and to store data involved in implementing the method for processing configuration changes described in the first aspect. The processor is configured to execute the program stored in the memory. The device for processing configuration changes may also include a communication bus, wherein the communication bus is used to establish a connection between the processor and the memory.

[0031] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer executes the method for processing configuration changes described in the first aspect.

[0032] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method for processing configuration changes described in the first aspect.

[0033] The technical effects obtained by the above-mentioned second, third, fourth and fifth aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0035] Figure 2 is a block diagram of a software system of an electronic device 100 provided in an embodiment of the present application;

[0036] Figure 3 This is a schematic diagram of a process of setting an application to support forced horizontal screen, provided in an embodiment of the present application;

[0037] Figure 4 This is another schematic diagram of a process for setting an application to support forced horizontal screen, provided in an embodiment of the present application;

[0038] Figure 5 It is a schematic diagram of a process of starting an abnormal interface when an electronic device is in a horizontal screen state provided by an embodiment of the present application;

[0039] Figure 6 It is a schematic diagram of a flashing interface when an abnormal interface is started when an electronic device is in a horizontal screen state, provided by an embodiment of the present application;

[0040] Figure 7 It is a logical schematic diagram of a cyclic restart process of an application interface provided in an embodiment of the present application;

[0041] Figure 8 It is a logical schematic diagram of processing configuration changes provided by an embodiment of the present application;

[0042] Fig. 9 This is a flow chart of another method for processing configuration changes provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0044] In the following description, specific details such as specific system structures and technologies are provided for illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details.

[0045] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0046] It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more than two; "and / or" describes the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B may be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0047] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", "fourth", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0048] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0049] Currently, when a user uses an electronic device in landscape mode, for applications in the electronic device that do not support landscape display but are configured to support forced landscape display, when the user opens the application interface of such application, the application interface may restart in a loop or flicker continuously, affecting the user experience.

[0050] In response to the above problems, this application example provides a method for processing configuration changes. When the electronic device is in landscape mode, if a system configuration change is detected during the application operation, it can first determine whether the current application interface of the application is in an activated state, whether the application requests to start the application interface in portrait orientation, and whether the application supports forced landscape. If the current application interface of the application is in an activated state, the application requests to start the application interface in portrait orientation, and the application supports forced landscape, then the operation of sending a configuration change message to the application is exited, that is, the configuration change message is not dispatched to the application.

[0051] When monitoring system configuration changes, if the current application interface of the application is in an activated state, the application requests to start the application interface in the portrait orientation, and the application supports forced landscape, it means that the current application interface is displayed in the foreground, the current application does not support landscape display but supports forced landscape. At this time, if a configuration change message is sent to the application, it may cause the application to cyclically restart the application interface according to the configuration change message. In this case, by exiting the operation of sending configuration change messages to the application, that is, not sending configuration change messages to the application, the application can be prevented from restarting the application interface according to the configuration change message, thereby interrupting the cyclic restart process of the application interface, preventing the application interface from continuously flickering, and improving the user experience.

[0052] The method for processing configuration changes provided in the embodiment of the present application is applied to electronic devices. Electronic devices may also be referred to as terminals, terminal devices, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. Electronic devices may be mobile phones, smart TVs, wearable devices, tablet computers (Pad), computers with wireless transceiver functions, virtual reality (VR) electronic devices, augmented reality (AR) electronic devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc. The embodiments of the present application do not limit the specific technologies and specific device forms used by electronic devices.

[0053] Before explaining in detail the method for processing configuration changes provided in the embodiment of the present application, the electronic device involved in the embodiment of the present application is first described.

[0054] Figure 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 1The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0055] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0056] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0057] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0058] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This prevents repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0059] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0060] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0061] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0062] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0063] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0064] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is an integer greater than 1.

[0065] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0066] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0067] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is an integer greater than 1.

[0068] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0069] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0070] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0071] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0072] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created by the electronic device 100 during use (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0073] The electronic device 100 can implement audio functions, such as music playback, recording, etc., through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D and the application processor.

[0074] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than a pressure threshold acts on a short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the pressure threshold acts on a short message application icon, an instruction to create a new short message is executed.

[0075] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor 180K can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0076] The electronic device provided in the embodiment of the present application may be a user equipment (UE), such as a mobile terminal (such as a user's mobile phone), a tablet computer, a desktop, a laptop, a handheld computer, a netbook, a personal digital assistant (PDA), a large-screen device, etc. The large-screen device may include a large-screen display, a large-screen TV, a large-screen all-in-one machine, and the mobile smart screen that has emerged in recent years.

[0077] Next, the software system of the electronic device 100 will be described.

[0078] An operating system runs on the above components, such as the iOS operating system developed by Apple, the Android open source operating system developed by Google, and the Windows operating system developed by Microsoft. Application programs can be installed and run on the operating system.

[0079] The operating system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0080] Figure 2 1 is a block diagram of a software system of an electronic device 100 provided in an embodiment of the present application. Figure 2 The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the Android runtime (Android Runtime) and the system layer, and the kernel layer.

[0081] The application layer can include a series of application packages. Figure 2As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0082] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 2 As shown, the application framework layer includes the activity manager service (AMS) and the window manager service (WMS).

[0083] AMS is a core system service that manages the life cycle of activities, task stacks, creation and destruction of processes, etc. in applications. It is a bridge between the application framework layer and the underlying system services. AMS includes activity and activity record modules. There can be one or more activity record modules. The activity record module is the key data structure for AMS to manage activities. It represents the history of activities and includes the identity information, startup information, process duration, status information, and control information of the activity. This information is used for system management and scheduling to ensure that the activity can run according to predetermined rules and processes. As an example, if Figure 2 As shown, AMS includes Activity, a first activity record module and a second activity record module. The first activity record module may be a native activity record in AMS, and the second activity record module may be a new activity record obtained by extending or encapsulating the native activity record, such as Honor activity record.

[0084] WMS is the core service in the Android system responsible for managing the display of windows and views. For example, it is responsible for managing and controlling the display, layout, interaction, and animation effects of all windows in the system.

[0085] As an example, AMS can receive a startup request initiated by an application and start the application interface according to the startup request. During the application running process, the system configuration may change. When the system configuration changes, WMS can monitor the system configuration change and send a configuration change message to AMS. The configuration change message is used to indicate that the system configuration has changed. System configuration changes can generally include changes in configurations such as screen orientation, language settings, depth mode, keyboard availability, etc.

[0086] It should be noted that in the embodiment of the present application, a judgment logic is added to the execution logic after the AMS receives the configuration change message, that is, after the AMS receives the configuration change message, it does not directly dispatch the configuration change message to the application, but first determines whether the application meets the preset conditions. If it does, the operation of sending the configuration change message to the application is exited. If it does not meet, the configuration change message is sent to the application.

[0087] The preset conditions may include that the current application interface of the application is in an activated state, the application requests an application interface in a vertical screen orientation, and the application supports forced horizontal screen. In addition, the preset conditions may include one or more of the following conditions: the display mode of the first application interface is full screen display; the number of times the first application interface triggers the activation state within a certain period of time reaches a first preset number of times; the number of times the first application interface changes its boundary within a certain period of time reaches a second preset number of times.

[0088] In addition, the application framework layer may also include a window manager, a content provider, a view system, a resource manager, a notification manager, etc., which is not limited in the embodiments of the present application. The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make these data accessible to applications. These data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build the display interface of the application, and the display interface can be composed of one or more views, for example, including a view for displaying a text message notification icon, including a view for displaying text, and including a view for displaying pictures. The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables the application to display notification information in the status bar, which can be used to convey notification type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc.

[0089] Android Runtime includes core libraries and virtual machines. Android Runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0090] The system library can include multiple functional modules, such as: surface manager, media library, 3D graphics processing library (such as: OpenGL ES), 2D graphics engine (such as: SGL), etc. The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.

[0091] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0092] It should be noted that Figure 2 The layers in the software structure shown and the components contained in each layer do not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more layers than shown in the figure, such as a system library (FWK LIB) layer, etc. In addition, each layer may include more or fewer components than shown in the figure, which is not limited in this application.

[0093] It should be noted that although the embodiments of the present application are described using the Android system as an example, its basic principles are also applicable to electronic devices based on operating systems such as iOS or Windows.

[0094] The following is a brief overview of the method for processing configuration changes provided by an embodiment of the present application in conjunction with the above software architecture.

[0095] When the electronic device is in a horizontal screen state, if the user opens the application interface of a certain application, in response to the user's operation, if the application does not support horizontal screen display, the application can initiate a first startup request to the AMS to request to start the application interface in the vertical screen direction. After receiving the first startup request, the AMS can first determine whether the application supports forced horizontal screen. If it does, the requested vertical screen direction is ignored, and then the boundary information corresponding to the application interface to be started is modified to the boundary information of the horizontal screen direction interface, and a boundary setting request is sent to the WMS, and the boundary setting request carries the boundary information of the horizontal screen direction boundary. After receiving the boundary setting request, the WMS can set the interface boundary according to the boundary setting request, trigger the system configuration change, and send a configuration change message to the AMS. After receiving the configuration change message, the AMS can first determine whether the application meets the preset conditions, such as whether the current application interface of the application is in an activated state, whether the application requests the application interface in the vertical screen direction, and whether the application supports forced horizontal screen. If the current application interface of the application is activated, the application requests an application interface in portrait orientation, and the application supports forced landscape orientation, then AMS can exit the original execution logic, that is, exit the operation of sending a configuration change message to the application, and thus not send a configuration change message to the application. In this way, the cyclic restart process of the application interface that does not support landscape display but supports forced landscape orientation can be interrupted, preventing the application interface from continuously flickering, thereby improving the user experience.

[0096] The following first introduces the method for processing configuration changes provided by the embodiment of the present application in conjunction with a specific application scenario.

[0097] In an exemplary application scenario, some applications are not suitable for landscape orientation, that is, they do not support landscape display, but when users use electronic devices, such as when the electronic devices are large-screen devices, users usually use the devices in landscape orientation. Therefore, users can set these applications in the device to support forced landscape orientation as needed, so that the system can force the applications to be displayed in landscape orientation according to the user's settings when the user uses the device in landscape orientation.

[0098] Taking the electronic device as a tablet computer as an example, please refer to Figure 3 and Figure 4 , Figure 3 and Figure 4 1 is a schematic diagram of a process for setting an application to support forced horizontal screen according to an embodiment of the present application. Figure 3 As shown in Figure (a) of FIG. 1 , the tablet computer displays a user interface, which includes an icon for setting an application and may also include icons for other applications. The user can click on the icon for setting an application, and in response to the user's operation, the tablet computer may display the following: Figure 3The setting interface is shown in Figure (b) of the figure. The setting interface includes a setting option area on the left and a content area on the right. The setting option area includes multiple setting options such as WLAN, Bluetooth, mobile network, smart interconnection, large screen features, desktop and personalization, display and brightness, etc. The content area is used to display the setting content corresponding to the selected option in the setting option area. Figure 3 As shown in Figure (b) in the figure, if the user clicks on the large screen feature option in the setting selection area on the left, in response to the user's operation, the content area on the right can display the setting content corresponding to the large screen feature. According to the setting content corresponding to the large screen feature, the user can set a specific application to support forced horizontal screen. For example, Figure 3 As shown in Figure (b) in the figure, the settings corresponding to the large-screen feature may include display prompt information and options for multiple applications. The prompt information may be "When the application is in landscape mode, some interfaces do not support landscape display and are still displayed in portrait mode. After turning on forced landscape mode, these interfaces can be forced to enter landscape mode and the display ratio can be changed. Since the application has not been adapted for layout, problems such as abnormal interface display may occur." The options for multiple applications may include options for applications such as Application A, Application B, Application C, and Application D.

[0099] Assume that the user clicks on an option of application A, such as clicking on the arrow after application A. In response to the user's click operation, Figure 4 As shown in Figure (a) in the figure, a forced horizontal screen setting window will pop up in the content area. The forced horizontal screen setting window includes options such as maintaining vertical display, horizontal display vertical screen ratio, horizontal screen 4:3 and horizontal full screen. By clicking options such as horizontal display vertical screen ratio, horizontal screen 4:3 or horizontal full screen, the user can set the corresponding application to support forced horizontal display and set the horizontal screen display ratio to the corresponding ratio. For example, the user can click the horizontal full screen option, and in response to the user's operation, application A can be set to support forced horizontal display and can be displayed in full screen when forced horizontal display. In addition, as Figure 4 As shown in Figure (b), after the setting is completed, a prompt message "horizontal full screen" can also be displayed near the option of application A to indicate that application A has been set to support forced horizontal screen and horizontal full screen display.

[0100] It should be understood that Figure 3 and Figure 4 The example of a user setting a certain application to support forced horizontal screen is used for explanation. In other implementations, the device can also configure certain applications to support forced horizontal screen. For example, the device is configured with a whitelist when it leaves the factory. The whitelist includes application identifiers of one or more applications, and the applications in the whitelist are configured to support forced horizontal screen. Of course, other methods can also be used to configure specific applications to support forced horizontal screen, and the embodiments of the present application do not limit this.

[0101] For an application that does not support landscape display, in one case, all application interfaces of the application do not support landscape display, and in another case, some application interfaces of the application do not support forced landscape display, that is, some application interfaces support landscape display, and other application interfaces do not support landscape display. For ease of explanation, the application interface that does not support landscape display in the application is referred to as an abnormal interface in the embodiment of the application.

[0102] When a user uses an electronic device in landscape mode, for applications in the electronic device that do not support landscape display but are configured to support forced landscape display, when the user opens the abnormal interface of such application (i.e., the application interface that does not support landscape display), the application interface may restart in a loop or flicker continuously, affecting the user experience.

[0103] Please refer to Figure 5 and Figure 6 , Figure 5 and Figure 6 The schematic diagram shows a process of flashing when the abnormal interface is started when the electronic device is in the horizontal screen state. When the electronic device is in the horizontal screen state, the electronic device can display the following Figure 4 The user interface shown in Figure (a) in FIG. 1 includes icons of application A and other applications. Assuming that application A is a video application, the user can enter the personal center interface of application A by clicking the icon of application A, such as Figure 5 As shown in Figure (b) of the figure, the personal center interface supports horizontal screen display. The personal center interface includes a chat list, and the chat list includes multiple contact information, such as Xiaohong and Xiaolu. If the user clicks Xiaohong in the chat list, in response to the user's operation, a chat interface for chatting with Xiaohong can be started, such as Figure 5 As shown in Figure (c) in the figure. If the chat interface does not support horizontal screen display, but application A supports forced horizontal screen display, the chat interface may restart cyclically after entering the chat interface for the first time. During the restart of the chat interface, the interface may flicker. For example, please refer to Figure 6 During the restart process, the interface will first go black and then display the new interface after restart. In this way, during the chat interface cyclic restart process, the interface will continuously go black and then display the new interface (such as black screen-display new interface-black screen-display new interface), causing the interface to flicker continuously.

[0104] It should be understood that Figure 6 The interface flickering form in which the screen goes black first and then a new interface is displayed during the interface restart process is taken as an example for explanation. In other embodiments, other interface flickering forms may also appear during the interface restart process, such as flickering of the status bar or flickering of part of the interface area. The embodiments of the present application do not limit the interface flickering form.

[0105] Next, the reasons why the application interface restarts cyclically and the interface flashes continuously when the abnormal interface is opened are analyzed in conjunction with the attached drawings.

[0106] Please refer to Figure 7 , Figure 7 1 is a logic diagram of a cyclic restart process of an application interface provided in an embodiment of the present application. The embodiment of the present application is illustrated by an example of a user opening an application interface of a first application that does not support horizontal screen display when using an electronic device in horizontal screen. Figure 7 As shown, the electronic device includes an application and a system (operating system), and the cyclic restart process of the application interface includes the following steps:

[0107] A1: When the electronic device is in a landscape mode, a user performs an operation of opening a first application interface of a first application.

[0108] The first application interface is an application interface that does not support horizontal screen display. The first application interface can be the main interface of the first application, or can be other interfaces, which is not limited in the embodiment of the present application. The operation of opening the first application interface can also be the operation of starting the first application interface.

[0109] In one embodiment, the user can click the icon of the first application to open the first application interface. For example, the first application interface is the main interface of the first application.

[0110] In another embodiment, when the first application has been launched, the user can open the first application interface through other application interfaces of the first application, for example, the user can click on the relevant controls in other application interfaces of the first application for triggering the first application interface to open the first application interface.

[0111] A2: In response to a user operation, the first application sends a first start request to the system, where the first start request is used to request to start a first application interface in a vertical orientation.

[0112] In response to the user opening the first application interface, the first application can send a first startup request to the system to request to start the first application interface in portrait orientation when the current electronic device is in landscape mode but the first application interface does not support landscape display.

[0113] A3: After receiving the first start request, the system determines whether the first application supports forced horizontal screen.

[0114] A4: If the first application supports forced horizontal screen, the system adjusts the boundary information corresponding to the first application interface to the boundary information of the horizontal screen interface.

[0115] If the first application supports forced landscape orientation, the system may ignore the portrait orientation requested by the first application, and modify the boundary corresponding to the first application interface from a portrait orientation boundary to a landscape orientation boundary to create the first application interface in a landscape orientation.

[0116] A5: After the boundary corresponding to the first application interface is adjusted to the boundary of the horizontal screen interface, the first application interface enters an activated (resume) state.

[0117] After adjusting the boundary, the first application interface may enter an activated state, that is, the electronic device may display the first application interface in a horizontal orientation on the display screen.

[0118] The first application interface enters the activated state to indicate that the first application interface is visible and interactive. The activated state is an important stage in the life cycle of the activity corresponding to the first application interface, and is one of the most active states in the activity life cycle. When the activity is in the activated state, it means that the activity is visible, in the foreground, has the user input focus, can receive user input and interact with the user.

[0119] A6: After the boundary corresponding to the first application interface is adjusted to the boundary of the horizontal screen interface, a system configuration change is triggered.

[0120] System configuration changes usually include changes in screen orientation, language settings, depth mode, keyboard availability, etc. Since the change of the border information from the vertical screen orientation border to the horizontal screen orientation border can indicate a change in screen orientation, which is a type of system configuration change, the change of the border information will trigger a system configuration change, such as triggering a configuration change message.

[0121] That is, after adjusting the boundary, on the one hand, the system configuration change can be triggered, and on the other hand, the corresponding application interface can enter the activation state. The two can occur in parallel or one after another in a very short time. The embodiments of the present application do not limit this.

[0122] A7: The system sends a configuration change message to the first application.

[0123] For a configuration change message triggered by the system side, the system usually dispatches the configuration change message to the application so that the application responds to the configuration change message, such as rebuilding the first application interface according to the changed system configuration.

[0124] As an example, after the first application is started, it will generally register a callback function with the system to monitor system configuration changes. Therefore, when the system configuration changes, the system will automatically call the callback function and send a configuration change message to the first application through the callback function, so that the first application will first notify the system configuration change.

[0125] After receiving the configuration change message, the first application will resend the first startup request to the system to restart the first application interface. That is, after receiving the configuration change message, the first application will re-go through the above flow, that is, re-execute steps A2 to A7, thereby restarting the first application interface, and the first application interface will be repeatedly restarted in a loop, and the application interface will appear to be continuously flashing.

[0126] A8: After the above step A3, if the first application does not support forced landscape orientation, the first application interface in portrait orientation is displayed.

[0127] According to the above Figure 7 It can be seen that in the system processing logic, when the system configuration changes, the system will automatically send configuration change messages to the application so that the application can respond to the changed system configuration and then adapt to the changed system configuration. However, if the first application does not support horizontal screen display but supports forced horizontal screen, the configuration change message sent to the application will cause the application to continuously restart the application interface, and the interface will flicker continuously.

[0128] In response to the above problems, an embodiment of the present application provides a method for processing configuration changes. When the electronic device is in a landscape state, during the operation of the first application, if a system configuration change is monitored, the operation of sending a configuration change message to the first application can be exited to prohibit the dispatch of configuration change messages to the first application when the preset conditions are met, that is, the current application interface of the first application is in an activated state, the first application requests an application interface in a portrait orientation, and the first application supports forced landscape. When a system configuration change is monitored, if the current application interface of the first application is in an activated state, the first application requests to start the application interface in a portrait orientation, and the first application supports forced landscape, it means that the current application interface is displayed in the foreground, the current application does not support landscape display but supports forced landscape. In this case, by exiting the operation of sending a configuration change message to the first application, the configuration change message may not be dispatched to the first application, so that the first application cannot restart the application interface according to the configuration change message, thereby interrupting the cyclic restart process of the application interface of the first application, preventing the application interface from continuously flickering, and improving the user experience.

[0129] In addition, during the running of the first application, if the system configuration changes are monitored, when the preset conditions are not met, such as when the current application interface of the first application is not in an activated state, and / or the first application requests an application interface in landscape orientation, and / or the first application does not support forced landscape orientation, the system can also dispatch a configuration change message to the first application, so that the first application cannot restart the application interface according to the configuration change message.

[0130] Next, the method for processing configuration changes provided by the example of this application is illustrated with reference to the accompanying drawings.

[0131] Please refer to Figure 8 , Figure 8 1 is a logic diagram of processing configuration changes provided by an embodiment of the present application. The embodiment of the present application takes the triggering of system configuration changes after the user opens the application interface of the first application when the user uses the electronic device in landscape mode as an example. Figure 8 As shown, the electronic device includes an application and a system, and the method includes the following steps:

[0132] B1: When the electronic device is in a horizontal state, a user performs an operation of opening a first application interface of a first application.

[0133] The first application interface may be the main interface of the first application, or may be other interfaces, which is not limited in the embodiments of the present application.

[0134] In one embodiment, the user can click the icon of the first application to open the first application interface. For example, the first application interface is the main interface of the first application.

[0135] In another embodiment, when the first application has been launched, the user can open the first application interface through other application interfaces of the first application, for example, the user can click on the relevant controls in other application interfaces of the first application for triggering the first application interface to open the first application interface.

[0136] B2: In response to the user's operation, the first application sends a first start request to the system, where the first start request is used to request to start the first application interface in the portrait orientation.

[0137] In response to the user opening the first application interface, the first application can send a first startup request to the system to request to start the first application interface in portrait orientation when the current electronic device is in landscape mode but the first application interface does not support landscape display.

[0138] In response to the user's operation of opening the first application interface, the first application can first determine the screen state of the current electronic device (landscape state or portrait state) and whether the first application interface to be launched supports landscape display. If the current electronic device is in landscape state and the first application interface does not support landscape display, a first launch request is sent to the system to request the launch of the first application interface in portrait orientation. In addition, if the current electronic device is in landscape state and the first application interface supports landscape display, a second launch request can also be sent to the system to request the first application interface in landscape orientation.

[0139] As an example, the operation of the first application sending a first start request to the system may include: the first application first calls a relevant interface of the system to start the interface, and then sends a direction setting request to the system, the direction setting request carries vertical screen direction indication information, and is used to request that the started interface be set to vertical screen direction. The relevant interface may be a startactivity method, etc.

[0140] B3: After receiving the first start request, the system determines whether the first application supports forced horizontal screen.

[0141] The system may first parse the relevant configuration information of the first application, and determine whether the first application supports forced horizontal screen according to the relevant configuration information. The relevant configuration information is used to indicate whether the first application is configured to support forced horizontal screen, for example, the relevant configuration information may be a specific whitelist, the specific whitelist includes one or more application identifiers, and the applications in the specific whitelist are configured to support forced horizontal screen.

[0142] B4: If the first application supports forced horizontal screen, the system adjusts the boundary information corresponding to the first application interface to the boundary information of the horizontal screen interface.

[0143] If the first application supports forced landscape orientation, the system may ignore the portrait orientation requested by the first application, and adjust the boundary corresponding to the first application interface from the portrait orientation boundary to the landscape orientation boundary to create the first application interface in landscape orientation.

[0144] B5: The first application interface enters the activated state.

[0145] After adjusting the border, the first application interface may enter an activated state, that is, the first application interface is visible and interactive. The electronic device may display the first application interface in a horizontal orientation on the display screen.

[0146] B6: After the system adjusts the boundary corresponding to the first application interface to the boundary information of the horizontal screen interface, the system configuration change is triggered.

[0147] System configuration changes usually include changes in screen orientation, language settings, depth mode, keyboard availability, etc. Since the border is adjusted from portrait orientation to landscape orientation, which indicates a change in screen orientation, it is a type of system configuration change. Therefore, changes in the border will trigger system configuration changes, such as triggering a configuration change message.

[0148] That is, after adjusting the boundary, on the one hand, the system configuration change can be triggered, and on the other hand, the corresponding application interface can enter the activation state. The two can occur in parallel or one after another in a very short time. The embodiments of the present application do not limit this.

[0149] B7: The system determines whether the first application meets preset conditions, where the preset conditions include that the application interface of the first application is in an activated state, the first application requests to start the application interface in a portrait orientation, and the first application supports forced landscape orientation.

[0150] In an embodiment of the present application, after the system configuration changes, the system does not directly send a configuration change message to the first application, but can first determine whether the first application meets preset conditions, such as whether the current application interface of the first application is in an activated state, whether the first application requests to start the application interface in the portrait orientation, and whether the first application supports forced landscape orientation, etc., and then determine whether to send a configuration change message to the first application based on the judgment result.

[0151] B8: If the first application meets the preset condition, the execution ends.

[0152] That is, if the first application meets the preset condition, the system exits the operation of sending the configuration change message to the first application, so that the subsequent steps are no longer executed, and thus the configuration change message is not dispatched to the first application.

[0153] If the current application interface of the first application is in an activated state, the first application requests to start the application interface in the portrait orientation, and whether the first application supports forced landscape, it means that the current application interface is displayed in the foreground, the current application does not support landscape display but supports forced landscape. At this time, if a configuration change message is sent to the application, it may cause the application to cyclically restart the application interface according to the configuration change message. In this case, by exiting the operation of sending a configuration change message to the application, that is, not sending a configuration change message to the application, the application can be prevented from restarting the application interface according to the configuration change message, thereby interrupting the cyclic restart process of the application interface, preventing the application interface from continuously flickering, and improving the user experience.

[0154] B9: If the first application does not meet the preset condition, the system sends a configuration change message to the first application.

[0155] That is, if the first application does not meet the preset condition, the system can normally send a configuration change message to the first application. After receiving the configuration change message, the first application can respond to the configuration change message, such as restarting the first application interface.

[0156] As an example, after the first application is started, it can register a callback function with the system to monitor system configuration changes. When the system configuration changes and the first application meets the preset conditions, the system can call the callback function and send a configuration change message to the first application through the callback function, so that the first application notifies the system configuration change.

[0157] For example, the callback function may be an onConfigurationChanged method or the like.

[0158] Among them, not meeting the preset conditions may include one or more of the following conditions: the application interface of the first application is not in an activated state; the first application requests to start the application interface in the horizontal screen direction; the first application does not support forced horizontal screen, etc.

[0159] Next, several scenarios that do not meet the preset conditions are illustrated.

[0160] Scenario 1: When the first application does not support landscape display and does not support forced landscape, a system configuration change occurs.

[0161] For example, when the first application does not support landscape display and does not support forced landscape display, when the electronic device is in landscape mode, a system configuration change is triggered during the startup of the application interface of the first application.

[0162] As an exemplary scenario, when the electronic device is in landscape mode, the user starts the first application interface of the first application. In response to the user's operation, when the first application interface does not support landscape display, the first application initiates a first start request to request to start the first application interface in portrait orientation. In response to the first start request, when the first application does not support forced landscape, an application interface in portrait orientation is displayed. An instruction to change the system configuration is received, the system configuration is changed according to the instruction, and a system configuration change message is triggered.

[0163] The instruction to change the system configuration is used to instruct the electronic device to change the system configuration, such as changing the screen orientation, language, light / dark mode (mode switching between dark mode and light mode), keyboard availability, etc. The instruction to change the system configuration can be triggered by the user through a specified operation, which can be a click operation, a key operation, a voice operation, or a gesture operation, etc., which is not limited in the embodiments of the present application.

[0164] Scenario 2: When the first application supports landscape display, a system configuration change occurs.

[0165] For example, when the first application supports horizontal screen display and the electronic device is in horizontal screen state, the system configuration change is triggered during the process of starting the application interface of the first application.

[0166] As an exemplary scenario, when the electronic device is in landscape mode, the user starts the first application interface of the first application. In response to the user's operation, when the first application interface supports landscape display, the first application initiates a second start request to request to start the first application interface in landscape orientation; in response to the second start request, the first application interface in landscape orientation is displayed; an instruction to change the system configuration is received; the system configuration is changed according to the instruction, and a configuration change message is triggered.

[0167] Scenario 3: When the application interface of the first application is not activated, a system configuration change occurs.

[0168] For example, when the application interface of the first application is not in an activated state, an instruction to change the system configuration is received; the system configuration is changed according to the instruction, and a configuration change message is triggered.

[0169] In the above scenarios, since the first application does not meet the preset conditions, when a system configuration change occurs, the system can normally dispatch (send) a configuration change message to the first application.

[0170] It should be noted that the embodiments of the present application only use the above-mentioned scenarios to illustrate the scenarios that do not meet the preset conditions. It should be understood that the above-mentioned scenarios do not constitute a limitation on the scenarios that do not meet the preset conditions. The scenarios that do not meet the preset conditions may also include other scenarios, which are not limited in the embodiments of the present application.

[0171] B10: After the above step B3, if the first application does not support forced landscape orientation, the first application interface in portrait orientation is displayed.

[0172] As an example, the pseudo code of the key steps (such as step B7-step B9) in the embodiment of the present application can be as follows:

[0173] If (the current application interface is activated && the current application requests a vertical screen orientation && the current application supports forced horizontal screen orientation) {

[0174] Return (exit operation);

[0175] }else {

[0176] Dispatching configuration change messages

[0177] }

[0178] In one embodiment, the preset condition may also include one or more of the following conditions: the display mode of the first application interface is full-screen display; the number of times the first application interface triggers the activation state within a certain period of time reaches a first preset number of times; the number of times the first application interface changes the boundary within a certain period of time reaches a second preset number of times.

[0179] The certain duration may be a pre-configured duration, and the first preset number of times and the second preset number of times may also be pre-set, for example, 2 times or 3 times.

[0180] By adding the display mode of the first application interface as full-screen display to the preset conditions, the accuracy of predicting the current scene as a scene in which the interface continuously flickers can be improved. By setting the condition that the number of times the first application interface triggers the activation state within a certain period of time reaches a first preset number of times, it can be limited to prohibiting the dispatch of configuration change messages to the application when the first application interface frequently triggers the activation state, thereby improving the accuracy of predicting the current scene as a scene in which the interface continuously flickers. By adding the condition that the number of times the first application interface changes its boundaries within a certain period of time reaches a second preset number of times to the preset conditions, it can be limited to prohibiting the dispatch of configuration change messages to the application when the first application interface frequently modifies its boundaries, thereby further improving the accuracy of predicting the current scene as a scene in which the interface continuously flickers.

[0181] Next, combine the attached Figure 2 The software framework shown provides a detailed description of the method for processing configuration changes involved in the embodiments of the present application.

[0182] Please refer to Fig. 9 , Fig. 9 This is another method flow chart for processing configuration changes provided by an embodiment of the present application. The method is applied to an electronic device. The electronic device includes a first application, an AMS and a WMS. The AMS includes an activity, a first activity record module and a second activity record module. The embodiment of the present application takes the first activity record module as a system native activity record and the second activity record module as an extended honor activity record as an example. Fig. 9 As shown, the method comprises the following steps:

[0183] Step 901: When the electronic device is in a horizontal state, a user performs an operation of opening a first application interface of a first application.

[0184] Step 902: In response to a user operation, the first application calls a startActivity function to start an Activity.

[0185] Activity is used to create or manage the application interface and handle interactive operations with the user. The application interface is the window for users to interact with the application, which is composed of the views and layouts in the Activity. Activity can be regarded as a container, and the interface is the content in this container. Activity is responsible for creating and managing this container, and the interface fills the specific content of the container. Therefore, in response to the user's operation of opening the first application interface, the first application needs to start an Activity first, so as to create or manage the first application interface through the Activity.

[0186] The first application can call the relevant interface of AWM to start the Activity. The embodiment of the present application takes the relevant interface as the start Actinity function as an example for explanation.

[0187] Step 903: When the first application does not support landscape display, the first application sends a direction setting request to the Activity. The direction setting request carries a portrait direction identifier for requesting a portrait direction.

[0188] As an example, the application may call a related interface of the AMS to send a request for setting a direction, for example, the related interface may be a setRguestOrientation (set requested direction) function.

[0189] Step 904: Activity sends the direction setting request to activity record.

[0190] That is, the Activity forwards the direction setting request to the activity record.

[0191] Step 905: After receiving the direction setting request, activity record parses first configuration information of the first application, where the first configuration information is used to indicate whether the first application supports forced horizontal screen.

[0192] As an example, the activity record can call the resolveOverrideConfiguration function to resolve the first configuration information.

[0193] Step 906: Activity record determines whether the first application supports forced horizontal screen according to the first configuration information, and obtains a determination result.

[0194] Step 907: Activity record sends the judgment result to honor activity record.

[0195] Step 908: When the judgment result of honor activity record indicates that the first application does not support forced landscape orientation, the boundary information is modified to the boundary information of the landscape orientation interface.

[0196] As an example, honor activity record can modify the boundary information of the first application interface to the boundary information of the landscape orientation interface during the process of setting the first application interface. For example, the boundary information can be modified to the boundary information of the landscape orientation interface through the apply appdisplay rect function.

[0197] Step 909, the honor activity record sends a set boundary request to the WMS, and the set boundary request carries the boundary information of the horizontal screen orientation interface.

[0198] Step 910: The WMS sets the boundary according to the boundary setting request.

[0199] The WMS can set the horizontal screen direction interface according to the boundary setting request, so as to display the first application interface in the horizontal screen direction. In this way, the first application interface can enter the activated state, that is, the Activity corresponding to the first application interface enters the activated state.

[0200] Step 911, WMS sends a response message to the honor activity record.

[0201] After receiving the boundary setting request or completing the boundary setting, WMS can return a response message to the honor activity record. At the same time, WMS can also send a configuration change message to the Activity.

[0202] That is, step 911 and the following step 914 can be executed in parallel, and of course can also be executed successively in a very short time, and the embodiment of the present application does not limit this.

[0203] After receiving the response message, honor activity record can make some preparations for the correct configuration of the Activity, such as executing the following steps 912 to 913.

[0204] Step 912, after receiving the response message, the honor activity record calls the EnsureAcitvityConfiguration method.

[0205] By calling the EnsureActivityConfiguration method, you can ensure that the Activity's configuration is set correctly or apply the correct function or method to ensure that the Activity is configured correctly.

[0206] Step 913, honor activity record calls the RelaunchActivityLocked method.

[0207] RelaunchActivityLocked is used to relaunch (or restart) an existing Activity under specific conditions.

[0208] Step 914: WMS sends a configuration change message to the Activity.

[0209] As an example, WMS can send a configuration change message to an Activity by calling the onConfigurationChanged (configuration state change) method of the Activity.

[0210] The onConfigurationChanged method is a callback function. After the Activity is started, the Activity can register a callback function with WMS to monitor changes in the system configuration. In this way, when WMS monitors changes in the system configuration, it can call the callback function and send a configuration change message to the Activity through the callback function.

[0211] Step 915: After receiving the configuration change message, the Activity determines whether the first application meets the preset condition.

[0212] The preset conditions include whether the current Activity corresponding to the first application is in an activated state, whether the first application requests an application interface in a vertical screen orientation, and whether the first application supports a forced horizontal screen orientation.

[0213] Step 916: If the judgment result is yes, the Activity ends execution.

[0214] Step 917: If the judgment result is no, the Activity sends a configuration change message to the first application.

[0215] As an example, the Activity may send a configuration change message to the first application by calling the onConfigurationChanged method.

[0216] After receiving the configuration change message, the first application may respond to the configuration change message, for example, returning to step 902 and restarting the Activity according to the changed system configuration, so that the electronic device repeats the above steps 903 to 915.

[0217] The present application also provides a chip, which is coupled to a memory and is used to read and execute computer programs or instructions stored in the memory to execute the methods in the above embodiments.

[0218] The present application also provides an electronic device, which includes a chip, and the chip is used to read and execute a computer program or instruction stored in a memory, so that the method in each embodiment is executed.

[0219] This embodiment further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the video processing method in the above-mentioned embodiment.

[0220] This embodiment further provides a computer program product, wherein the computer-readable storage medium stores program codes. When the computer program product is run on a computer, the computer executes the above-mentioned related steps to implement the video processing method in the above-mentioned embodiment.

[0221] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes the video processing method in the above-mentioned method embodiments.

[0222] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

[0223] The embodiments of the present application do not specifically limit the specific structure of the execution subject of the method provided in the embodiments of the present application, as long as the video processing can be performed according to the method provided in the embodiments of the present application by running a program that records the code of the method provided in the embodiments of the present application. For example, the execution subject of the method provided in the embodiments of the present application may be an electronic device, or a functional module in the electronic device that can call and execute the program.

[0224] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0225] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0226] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0227] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a computer software product, which is stored in a storage medium. The computer software product includes a number of instructions, which are used to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium may include, but is not limited to: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks or optical disks.

[0228] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for processing configuration changes, characterized in that: Applied in an electronic device, the electronic device includes a first application, and the method includes: When the electronic device is in a horizontal screen state, in response to a system configuration change occurring during the running of the first application, if the first application satisfies a preset condition, exiting the operation of sending a configuration change message to the first application; Among them, the configuration change message is used to indicate that the system configuration has changed, and the preset conditions include that the application interface of the first application is in an activated state, the first application requests to start the application interface in a vertical screen direction, and the first application supports forced horizontal screen.

2. The method according to claim 1, characterized in that Before the step of exiting the operation of sending the configuration change message to the first application when the first application meets a preset condition, the step further includes: In response to a user operation of starting a first application interface of the first application, if the first application interface does not support horizontal screen display, the first application initiates a first start request, where the first start request is used to request starting the first application interface in a vertical screen orientation; In response to the first start request, if the first application supports forced landscape orientation, the boundary corresponding to the first application interface is adjusted to the boundary of the landscape orientation interface, and the configuration change message is triggered.

3. The method according to claim 2, characterized in that The method further comprises: After the boundary of the first application interface is adjusted to the boundary of the horizontal screen interface, the first application interface is displayed in the horizontal screen direction, and the first application interface enters an activated state.

4. The method according to claim 2, characterized in that The method further comprises: In response to the first start request, if the first application does not support forced landscape orientation, display the first application interface in portrait orientation.

5. The method according to claim 2, characterized in that The method further comprises: In response to a user operation of starting the first application interface of the first application, if the first application interface supports horizontal screen display, the first application initiates a second start request, where the second start request is used to request starting the first application interface in horizontal screen direction; In response to the second startup request, the first application interface is displayed in a horizontal orientation.

6. The method according to claim 1, characterized in that The method further comprises: In response to a system configuration change occurring during the running of the first application, if the first application does not meet the preset condition, sending the configuration change message to the first application; The first application initiates a second start request according to the configuration change message, where the second start request is used to request restarting the application interface.

7. The method according to claim 6, characterized in that The first application does not meet the preset condition including one or more of the following situations: The application interface of the first application is not in an activated state; The first application requests to start an application interface in a horizontal orientation; The first application does not support forced landscape orientation.

8. The method according to claim 6, characterized in that Before sending the configuration change message to the first application when the first application does not meet the preset condition, the method further includes: In response to a user operation of launching a first application interface of the first application, if the first application interface supports horizontal screen display, the first application initiates a second launch request, where the second launch request is used to request launching the first application interface in horizontal screen orientation; In response to the second start request, displaying the first application interface in a horizontal orientation; receiving instructions to change system configuration; The system configuration is changed according to the instruction, and the configuration change message is triggered.

9. The method according to claim 6, characterized in that Before sending the configuration change message to the first application when the first application does not meet the preset condition, the method further includes: In response to a user operation of starting the first application interface of the first application, if the first application interface does not support horizontal screen display, the first application initiates a first start request, where the first start request is used to request starting the first application interface in a vertical screen orientation; In response to the first start request, displaying the application interface in a portrait orientation when the first application does not support forced landscape orientation; receiving instructions to change system configuration; The system configuration is changed according to the instruction, and the configuration change message is triggered.

10. The method according to claim 6, characterized in that When the first application does not meet the preset condition, before sending the configuration change message to the first application, the method further includes: When the application interface of the first application is not in an activated state, receiving an instruction to change the system configuration; The system configuration is changed according to the instruction, and the configuration change message is triggered.

11. The method according to any one of claims 1 to 10, characterized in that: The preset condition also includes at least one of the following conditions: The display mode of the application interface of the first application is full screen display; The number of times the first application interface triggers the activation state reaches a first preset number of times within a certain period of time; The number of times the first application interface changes its boundary reaches a second preset number of times within a certain period of time.

12. An electronic device, characterized in that: The electronic device includes: one or more processors, and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method according to any one of claims 1 to 11.

13. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method as described in any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises instructions, and when the instructions are executed on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Application program starting method and device, storage medium and terminal

    CN108958830A