Configuration change processing method, device and storage medium
By listening to and judging the state and needs of the application interface in landscape mode, configuration change messages are avoided from being sent to applications that do not support landscape mode but support forced landscape mode. This solves the flickering problem caused by the application interface restarting repeatedly and improves the user experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2026-03-12
AI Technical Summary
When users use their devices in landscape mode, some applications are not adapted to landscape display, causing the application interface to repeatedly restart in landscape mode, resulting in continuous flickering and affecting the user experience.
When the electronic device is in landscape mode, and the system configuration changes are monitored, it is determined whether the application interface is active, whether it requests a portrait orientation, and whether it supports forced landscape mode. If the conditions are met, the configuration change message is not sent to prevent the application interface from restarting.
It interrupted the application interface's cyclic restart process, preventing continuous flickering and improving the user experience.
Smart Images

Figure CN2025113704_12032026_PF_FP_ABST
Abstract
Description
Method, device and storage medium for processing configuration change
[0001] The present application claims priority to the Chinese patent application No. 202411223215.X, filed on September 03, 2024, and entitled "Method, device and storage medium for processing configuration change", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the technical field of terminals, and in particular to a method, device and storage medium for processing configuration change. BACKGROUND
[0003] With the continuous development of terminal technology, terminal devices are becoming more and more powerful, and can install a variety of applications for users to use. However, when the user uses the device in landscape mode, some applications may not be adapted to landscape mode and do not support landscape display. For these applications, the user or the system can set them to support forced landscape mode according to the needs, so as to force them to support landscape display.
[0004] For an application that does not support landscape display but is configured to support forced landscape mode, when the device is in a landscape state, when the user first starts an application interface (or part of the application interface that does not support landscape display) of the application, the application can initiate a request to start an application interface in portrait mode according to the user's starting operation. After receiving the starting request, the system can first determine whether the application interface supports forced landscape mode. If the application interface supports forced landscape mode, the system ignores the request for the application interface in portrait mode and modifies the boundary information of the application interface to the boundary information of the application interface in landscape mode to display the application interface in landscape mode. In addition, the change of the boundary information belongs to a system configuration change, so the change of the boundary information will also trigger a configuration change message. For the configuration change message triggered by the system, 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. The restart of the application interface will cause the interface to flicker. When the application interface is restarted, the above process will be repeated, which will cause the application interface to restart in a loop, causing the application interface to flicker continuously. SUMMARY
[0005] The present application provides a method, device and storage medium for processing configuration change, which can interrupt the loop restart process of an application interface that does not support landscape display but supports forced landscape mode when the device is in a landscape state, prevent the application interface from flickering continuously, and improve the user experience.
[0006] The technical solution is as follows:
[0007] In a first aspect, a method for handling configuration changes is provided. The method is applied in an electronic device including a first application, and includes:
[0008] In a case where the electronic device is in a landscape state, in response to a system configuration change occurring during running of the first application, in a case where the first application meets a preset condition, an 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 an application interface of the first application is in an active state, the first application requests to start an application interface in a portrait direction, and the first application supports forced landscape.
[0009] That is, in a case where the electronic device is in a landscape state, during running of an application, if a system configuration change is listened to, it can be first judged whether a current application interface of the application is in an active state, whether the application requests to start an application interface in a portrait direction, and whether the application supports forced landscape. If the current application interface of the application is in the active state, the application requests to start the application interface in the portrait direction, and the application supports forced landscape, an operation of sending a configuration change message to the application is exited, that is, the configuration change message is not dispatched to the application. When the system configuration change is listened to, if the current application interface of the application is in the active state, the application requests to start the application interface in the portrait direction, and the application supports forced landscape, it indicates 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 the configuration change message is dispatched to the application, the application interface may be restarted by the application according to the configuration change message. In this case, by exiting the operation of sending the configuration change message to the application, that is, the configuration change message is not dispatched to the application, the application interface cannot be restarted by the application according to the configuration change message, so as to interrupt the cyclic restarting process of the application interface of the application, prevent the application interface from flickering continuously, and improve user experience.
[0010] In an embodiment of the present application, before the operation of sending the configuration change message to the first application is exited in a case where the first application meets the preset condition, in response to an operation of a user starting a first application interface of the first application, in a case where the first application interface does not support landscape display, the first application initiates a first starting request, and the first starting request is used to request to start the first application interface in the portrait direction. In response to the first starting request, in a case where the first application supports forced landscape, a boundary corresponding to the first application interface is adjusted to a boundary of a landscape direction interface, and a configuration change message is triggered.
[0011] In this way, in the case that the electronic device is in the horizontal screen state, the first application in the electronic device does not support the horizontal screen display but supports the forced horizontal screen, after the application interface of the first application is first started to trigger the configuration change message, the configuration change message can be prohibited 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 being first started, thereby avoiding the interface flickering problem caused by the cyclic restarting of the application interface.
[0012] In an embodiment of the present application, after the boundary of the first application interface is adjusted to the boundary of the horizontal screen direction interface, the first application interface in the horizontal screen direction is displayed, and the first application interface enters an active state. That is, after the boundary is adjusted, the first application interface can enter the active state.
[0013] The first application interface entering the active state is used to indicate that the first application interface is visible and interactive. The active state is an important stage of the Activity life cycle 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 active state, it means that the Activity is visible, located in the foreground, and has the user input focus, and can receive the input of the user and interact with the user.
[0014] In an embodiment of the present application, in response to the first starting request, in the case that the first application does not support the forced horizontal screen, the first application interface in the vertical screen direction is displayed. That is, in the case that the first application does not support the forced horizontal screen, the system can directly display the first application interface in the vertical screen direction, without adjusting the boundary for forcing the first application interface to display in the horizontal screen.
[0015] In an embodiment of the present application, in response to the operation of the user starting the first application interface of the first application, in the case that the first application interface supports the horizontal screen display, the first application initiates a second starting request, and the second starting request is used to request to start the first application interface in the horizontal screen direction; and in response to the second starting request, the first application interface in the horizontal screen direction is displayed.
[0016] That is, in the case that the first application interface supports the horizontal screen display, the first application can directly request to start the first application interface in the horizontal screen direction, so that the electronic device displays the first application interface in the horizontal screen direction.
[0017] In an embodiment of the present application, in response to the system configuration change occurring in the running process of the first application, in the case that the first application does not satisfy the preset condition, a configuration change message is sent to the first application; and the first application initiates a second starting request according to the configuration change message, and the second starting request is used to request to restart the first application interface.
[0018] When a system configuration change occurs during running of the first application, if the first application does not meet the preset condition, the configuration change message can be normally processed, that is, the configuration change message can be normally dispatched to the first application, so that the normal running of the application in a normal case can be avoided.
[0019] In an embodiment of the present application, the first application not meeting the preset condition includes one or more of the following cases:
[0020] The application interface of the first application is not in an active state; the first application requests to start an application interface in a landscape orientation; the first application does not support forced landscape.
[0021] In an embodiment of the present application, before the configuration change message is sent to the first application when the first application does not meet the preset condition, in response to an operation of a user starting a first application interface of the first application, when the first application interface supports landscape display, the first application initiates a second starting request, the second starting request being used to request to start the first application interface in a landscape orientation; in response to the second starting request, the first application interface in the 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.
[0022] In this way, when the first application supports landscape display, if a system configuration change occurs during running of the first application, the configuration change message can be normally dispatched to the first application, so that the electronic device can normally display the application interface in the landscape orientation.
[0023] In an embodiment of the present application, before the configuration change message is sent to the first application when the first application does not meet the preset condition, in response to an operation of a user starting a first application interface of the first application, when the first application interface does not support landscape display, the first application initiates a first starting request, the first starting request being used to request to start the first application interface in a portrait orientation; in response to the first starting request, when the first application does not support forced landscape, an application interface in the 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.
[0024] 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 running of the first application, the configuration change message can be normally dispatched to the first application, so that the electronic device can normally display the application interface in the portrait orientation.
[0025] In an embodiment of the present application, when the first application does not meet the preset condition, before the configuration change message is sent to the first application, when the application interface of the first application is not in an active state, an instruction to change the system configuration is received; the system configuration is changed according to the instruction, and the configuration change message is triggered.
[0026] In this way, when the application interface of the first application is not in an active state, such as in a paused or stopped state, if a system configuration change occurs during the running of the first application, the configuration change message can be normally dispatched to the first application, so that the first application can be correctly configured.
[0027] In an embodiment of the present application, the preset condition further includes at least one of the following conditions: the display mode of the first application interface is full-screen display; the number of times that the first application interface triggers an active state in a certain time length reaches a first preset number of times; the number of times that the first application interface changes the boundary in a certain time length reaches a second preset number of times.
[0028] The certain time length can be a preconfigured time length, and the first preset number of times and the second preset number of times can also be preconfigured, such as 2 or 3 times, etc.
[0029] By adding the display mode of the first application interface as full-screen display in the preset condition, the accuracy of predicting that the current scenario is the interface continuous flickering scenario can be improved. By adding the condition that the number of times that the first application interface triggers an active state in a certain time length reaches a first preset number of times, when the first application interface frequently triggers an active state, the dispatch of the configuration change message to the application is prohibited again, and the accuracy of predicting that the current scenario is the interface continuous flickering scenario can be improved. By adding the condition that the number of times that the first application interface changes the boundary in a certain time length reaches a second preset number of times in the preset condition, when the first application interface frequently modifies the boundary, the dispatch of the configuration change message to the application is prohibited again, and the accuracy of predicting that the current scenario is the interface continuous flickering scenario can be further improved.
[0030] In a second aspect, a device for processing configuration changes is provided, which has the function of implementing the method for processing configuration changes in the first aspect described above. The device for processing configuration changes includes at least one module for implementing the method for processing configuration changes provided in the first aspect.
[0031] In a third aspect, a device for processing configuration changes is provided. The device for processing configuration changes includes a processor and a memory. The memory is configured to store a program supporting the device for processing configuration changes to execute the method for processing configuration changes of the first aspect, and store data used in the method for processing configuration changes of the first aspect. The processor is configured to execute the program stored in the memory. The device for processing configuration changes can further include a communication bus configured to connect the processor and the memory.
[0032] In a fourth aspect, a computer readable storage medium is provided. The computer readable storage medium stores instructions which, when executed on a computer, cause the computer to perform the method for processing configuration changes of the first aspect.
[0033] In a fifth aspect, a computer program product is provided. The computer program product includes instructions which, when executed on a computer, cause the computer to perform the method for processing configuration changes of the first aspect.
[0034] The second aspect, the third aspect, the fourth aspect and the fifth aspect have similar technical effects as the first aspect, and thus are not described here. BRIEF DESCRIPTION OF DRAWINGS
[0035] FIG. 1 is a structural schematic diagram of an electronic device according to an embodiment of the present application;
[0036] FIG. 2 is a block diagram of a software system of an electronic device 100 according to an embodiment of the present application;
[0037] FIG. 3 is a process schematic diagram of setting an application to support forced landscape according to an embodiment of the present application;
[0038] FIG. 4 is another process schematic diagram of setting an application to support forced landscape according to an embodiment of the present application;
[0039] FIG. 5 is a process schematic diagram of starting an abnormal interface when an electronic device is in a landscape state according to an embodiment of the present application;
[0040] FIG. 6 is a schematic diagram of interface flashing when an abnormal interface is started when an electronic device is in a landscape state according to an embodiment of the present application;
[0041] FIG. 7 is a logic schematic diagram of an application interface loop restart process according to an embodiment of the present application;
[0042] FIG. 8 is a logic schematic diagram of a process for processing configuration changes according to an embodiment of the present application;
[0043] FIG. 9 is a flowchart of another method for processing configuration changes according to an embodiment of the present application. DETAILED DESCRIPTION
[0044] For the purpose of clarity, technical and scientific terms used in the present application may be similarly described in the following description.
[0045] In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular sequences of steps, techniques, etc., in order to provide a thorough understanding of the present application. However, it will be apparent to one skilled in the art that the present application can be practiced in other embodiments that depart from these specific details.
[0046] It should be understood that the term "comprises" when used in this specification and the appended claims specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0047] It should also be understood that, in the application, "one or more" refers to one, two, or more than two; "and / or" describes the association relationship of associated objects, which means that there can be three relationships; for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it.
[0048] In addition, in the description of the specification and the appended claims, the terms "first", "second", "third", "fourth", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0049] In the present application, the reference to "one embodiment" or "some embodiments" means that the specific features, structures, or characteristics described in connection with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in further some embodiments" and the like appearing in different places in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "include", "contain", "have" and their variants mean "include but not limited to", unless otherwise specifically emphasized.
[0050] Currently, when a user uses an electronic device in a landscape mode, for an application in the electronic device that does not support landscape display but is configured to support forced landscape, when the user opens an application interface of the application, the application interface may be restarted in a loop and the application interface may flicker, affecting the user experience.
[0051] To address the above problems, an example of the present application provides a method for processing configuration changes. When an electronic device is in a landscape mode, if a system configuration change is detected during application running, it is first determined whether a current application interface of the application is in an active state, whether the application requests to start an application interface in a portrait mode, and whether the application supports forced landscape. If the current application interface of the application is in the active state, the application requests to start the application interface in the portrait mode, and the application supports forced landscape, an operation of sending a configuration change message to the application is exited, i.e., the configuration change message is not dispatched to the application.
[0052] When the system configuration change is detected, if the current application interface of the application is in the active state, the application requests to start the application interface in the portrait mode, and the application supports forced landscape, it indicates that the current application interface is displayed in the foreground and the current application does not support landscape display but supports forced landscape. At this time, if the configuration change message is dispatched to the application, the application interface may be restarted in a loop according to the configuration change message. In this case, by exiting the operation of sending the configuration change message to the application, i.e., the configuration change message is not dispatched to the application, the application cannot restart the application interface according to the configuration change message, thereby breaking the loop of restarting the application interface of the application, preventing the application interface from flickering continuously, and improving the user experience.
[0053] The method for processing configuration change provided by the embodiments of the present application is applied to an electronic device. The electronic device can also be referred to as a terminal, a terminal device, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The electronic device can be a mobile phone, a smart television, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiments of the present application do not limit the specific technology and specific device form of the electronic device.
[0054] Before the method for processing configuration change provided by the embodiments of the present application is explained in detail, the electronic device related to the embodiments of the present application is first described.
[0055] FIG. 1 is a structural schematic diagram of an electronic device according to an embodiment of the present application. Referring to FIG. 1, the electronic device 100 can 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, a headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric 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.
[0056] It can be understood that the structure illustrated in the embodiments 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 can include more or fewer components than those illustrated, or combine certain components, or split certain components, or different arrangement of components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
[0057] The processor 110 can include one or more processing units, such as: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (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 can be independent devices, or can be integrated into one or more processors.
[0058] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals to complete the control of fetching instructions and executing instructions.
[0059] The processor 110 can also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can hold instructions or data that the processor 110 has just used or is using repeatedly. If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. This prevents repeated access and reduces the waiting time of the processor 110, thus improving the efficiency of the system.
[0060] 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, etc.
[0061] The antenna 1 and the 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 multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.
[0062] The mobile communication module 150 can provide a solution including 2G / 3G / 4G / 5G wireless communication applied to the electronic device 100. The mobile communication module 150 can 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 perform filtering, amplification, etc. on the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves radiated through the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be arranged in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be arranged in the same device as at least part of the modules of the processor 110.
[0063] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, frequency-modulate them, amplify them, and radiate them as electromagnetic waves via the antenna 2.
[0064] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.
[0065] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device 100 can include 1 or N display screens 194, N being an integer greater than 1.
[0066] The electronic device 100 can implement a photographing function through an ISP, a camera 193, a video codec, a GPU, a display 194, and an application processor, etc.
[0067] The ISP is used to process data fed back by the camera 193. For example, when taking a photo, the shutter is opened, 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 the ISP for processing to convert it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be disposed in the camera 193.
[0068] The camera 193 is used to capture still images or videos. Objects generate optical images through lenses and project them onto photosensitive elements. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it 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 the like format. In some embodiments, the electronic device 100 can include one or N cameras 193, where N is an integer greater than 1.
[0069] The digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0070] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as moving picture experts group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.
[0071] The NPU is a neural-network (NN) calculation processor, which can quickly process input information by drawing on the structure of a biological neural network, such as the transmission mode between human brain neurons, and can also continuously self-learn. Through the NPU, the electronic device 100 can implement intelligent cognitive applications such as image recognition, face recognition, voice recognition, and text understanding, etc.
[0072] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to extend 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. For example, files such as music and videos are stored in the external memory card.
[0073] The internal memory 121 can be used to store computer-executable program code including 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 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required for a function (such as a sound play function, an image play function, etc.), and the like. The data storage area can store data (such as audio data, a phonebook, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 121 can include a high-speed random access memory, and can further include a nonvolatile memory such as at least one of a disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
[0074] The electronic device 100 can implement an audio function such as music play, recording, etc. through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, the application processor, and the like.
[0075] The pressure sensor 180A is used to sense a pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. There are many types of pressure sensors 180A, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor can include at least two parallel plates having a conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but having different touch operation intensities can correspond to different operation instructions. For example, when a touch operation having a touch operation intensity less than a pressure threshold is applied to a short message application icon, an instruction to view a short message is executed. When a touch operation having a touch operation intensity greater than or equal to the pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.
[0076] Touch sensor 180K, also referred to as "touch panel". Touch sensor 180K can be disposed on display screen 194, and touch screen, also referred to as "touch panel", is formed by touch sensor 180K and display screen 194. Touch sensor 180K is configured to detect a touch operation applied thereto or in the vicinity thereof. Touch sensor 180K can transmit the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation can be provided through display screen 194. In some embodiments, touch sensor 180K can also be disposed on the surface of electronic device 100, which is different from the position of display screen 194.
[0077] The electronic device provided by the embodiments of the present application can be a user equipment (UE), for example, a mobile terminal (such as a user mobile phone), a tablet computer, a desktop computer, a laptop computer, a handheld computer, a netbook, a personal digital assistant (PDA), a large-screen device, and the like. The large-screen device can include a large-screen display, a large-screen television, a large-screen all-in-one machine, and a mobile smart screen that has emerged in recent years.
[0078] Next, the software system of electronic device 100 is described.
[0079] On the above components, an operating system is running. For example, the iOS operating system developed by Apple Inc., the Android open source operating system developed by Google Inc., the Windows operating system developed by Microsoft Corporation, and the like. Application programs can be installed and run on the operating system.
[0080] The operating system of electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present application take the Android system with a layered architecture as an example to exemplarily describe the software structure of electronic device 100.
[0081] FIG. 2 is a block diagram of a software system of an electronic device 100 according to an embodiment of the present application. Referring to FIG. 2, the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, and from top to bottom, they are the application layer, the application framework layer, the Android runtime (Android Runtime) and the system layer, and the kernel layer.
[0082] The application layer can include a series of application packages. As shown in FIG. 2, the application packages can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, and the like.
[0083] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications of the application layer. The application framework layer includes some pre-defined functions. As shown in FIG. 2, the application framework layer includes an activity manager service (AMS) and a window manager service (WMS).
[0084] The AMS is a core system service responsible for managing the life cycle of activities (Activities) in an application, task (Task) stacks, creation and destruction of processes (Processes), and the like. It is a bridge between the application framework layer and underlying system services. The AMS includes an activity (Activity) and an activity record module, which can be one or more. The activity record module is a key data structure for the AMS to manage the Activity, representing the historical record of the Activity, containing the identity information, start information, process time consumption, state information, and control information of the Activity, and the like, which are used for system management and scheduling to ensure that the Activity can run according to the predetermined rules and processes. As an example, as shown in FIG. 2, the AMS includes an Activity, a first activity record module, and a second activity record module. The first activity record module can be a native activity record in the AMS, and the second activity record module can be a new activity record obtained by extending or encapsulating the native activity record, such as a glory activity record.
[0085] The WMS is a 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.
[0086] As an example, the AMS can receive a start request initiated by an application, and start an application interface according to the start request. During the running of the application, the system configuration can change, and when the system configuration changes, the WMS can listen to the system configuration change and send a configuration change message to the AMS. The configuration change message is used to indicate that the system configuration has changed. The system configuration change can usually include changes in configurations such as screen orientation, language settings, dark mode, keyboard availability, and the like.
[0087] It should be noted that in the embodiments of the present application, a judgment logic is added in the execution logic after the AMS receives the configuration change message, that is, after the AMS receives the configuration change message, the configuration change message is not directly dispatched to the application, but first it is judged whether the application meets the preset condition. If it meets, 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.
[0088] The preset condition can include that the current application interface of the application is in an active state, the application requests a portrait application interface, and the application supports forced landscape. In addition, the preset condition further includes one or more of the following conditions: the display mode of the first application interface is full-screen display; the number of times that the first application interface triggers the active state in a certain time length reaches a first preset number; and the number of times that the first application interface changes the boundary in a certain time length reaches a second preset number.
[0089] In addition, the application framework layer can further include a window manager, a content provider, a view system, a resource manager, a notification manager, etc., which are not limited by the embodiments of the present application. The window manager is used to manage the window program. The window manager can obtain the size of the display screen, judge whether there is a status bar, lock the screen, and intercept the screen, etc. The content provider is used to store and obtain data, and enable the data to be accessed by the application program. The data can include video, image, audio, dialed and received calls, browsing history and bookmarks, phonebook, etc. The view system includes visual controls, such as a control for displaying text, a control for displaying pictures, etc. The view system can be used to build the display interface of the application program. The display interface can be composed of one or more views, such as a view for displaying a short message notification icon, a view for displaying text, and a view for displaying pictures. The resource manager provides various resources for the application program, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables the application program to display notification information in the status bar. The notification manager can be used to convey the notification type of message, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloading, message reminders, etc.
[0090] The Android Runtime includes the core library and the virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system. The core library contains two parts: one part is the function function required to be called by the java language, and the other part is the core library of the Android. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java file of the application layer and the application framework layer into a binary file. The virtual machine is used to perform the management of the object life cycle, the stack management, the thread management, the security and exception management, and the garbage collection, etc.
[0091] The system library can include a plurality of functional modules, such as a surface manager, media libraries, a three-dimensional graphics processing library (such as OpenGL ES), a 2D graphics engine (such as SGL), and the like. The surface manager is used to manage a display subsystem and provides fusion of 2D and 3D layers for a plurality of application programs. The media libraries support playback and recording of a plurality of commonly used audio, video formats, and still image files. The media libraries can support a plurality of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, and the like. The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.
[0092] The kernel layer is a layer between hardware and software. The kernel layer at least includes display drivers, camera drivers, audio drivers, and sensor drivers.
[0093] It should be noted that the layers in the software structure shown in FIG. 2 and the components included in each layer do not constitute a specific limitation on the electronic device. In other embodiments, the electronic device can include more layers than shown, such as a system library (FWK LIB) layer, and the like. In addition, each layer can include more or fewer components than shown, and the present application is not limited in this regard.
[0094] It should be noted that although the embodiments of the present application are described by taking the Android system as an example, the basic principles are also applicable to electronic devices based on the iOS or Windows operating system.
[0095] The method for processing configuration changes provided by the embodiments of the present application will be briefly described below in combination with the above software architecture.
[0096] In a case where the electronic device is in a landscape state, if a user opens an application interface of a certain application, in response to the operation of the user, if the application does not support landscape display, the application can initiate a first start request to the AMS to request to start an application interface in a portrait direction. After the AMS receives the first start request, it can first determine whether the application supports forced landscape, if it supports, it ignores the requested portrait direction, and then modifies the boundary information of the application interface to be started to the boundary information of the landscape direction interface, and sends a boundary setting request to the WMS, the boundary setting request carries the boundary information of the landscape direction boundary. After the WMS receives the boundary setting request, it 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 the AMS receives the configuration change message, it can first determine whether the application meets the preset conditions, such as whether the current application interface of the application is in an active state, whether the application requests an application interface in a portrait direction, and whether the application supports forced landscape. If the current application interface of the application is in an active state, the application requests an application interface in a portrait direction, and the application supports forced landscape, the AMS can exit the original execution logic, that is, exit the operation of sending a configuration change message to the application, so as to not dispatch the configuration change message to the application. In this way, the loop restart process of the application interface which does not support landscape display but supports forced landscape can be interrupted, the phenomenon of continuous flicker of the application interface is prevented, and the user experience is improved.
[0097] The method for processing configuration changes provided by the embodiments of the present application will be described below in combination with specific application scenarios.
[0098] In an exemplary application scenario, some applications are not adapted to landscape, that is, they do not support landscape display, but when the user uses the electronic device, such as when the electronic device is a large-screen device, the user usually uses the device in a landscape state. Therefore, the user can set these applications to support forced landscape in the device as needed, so that the system side can force the application to display in a landscape state according to the user's setting when the user uses the device in a landscape state.
[0099] Taking a tablet computer as an example, referring to FIG. 3 and FIG. 4, which are process diagrams of setting an application to support forced landscape screen provided by an embodiment of the present application. As shown in (a) of FIG. 3, the tablet computer displays a user interface, which includes an icon of a setting application and icons of other applications. The user can click the icon of the setting application. In response to the operation of the user, the tablet computer displays a setting interface as shown in (b) of FIG. 3. The setting interface includes a setting option area on the left and a content area on the right. The setting option area includes setting options such as WLAN, Bluetooth, mobile network, smart interconnection, large screen characteristic function, desktop and personalization, display and brightness, and the content area is used to display setting content corresponding to a selected option in the setting option area. As shown in (b) of FIG. 3, if the user clicks the large screen characteristic function option in the setting option area on the left, in response to the operation of the user, the content area on the right displays setting content corresponding to the large screen characteristic function. According to the setting content corresponding to the large screen characteristic function, the user can set a specific application to support forced landscape screen. For example, as shown in (b) of FIG. 3, the setting content corresponding to the large screen characteristic function can include a prompt information and options of multiple applications. The prompt information can be "When the application is in landscape screen, some interfaces do not support landscape screen display and are still displayed in portrait screen. After the forced application landscape screen is enabled, these interfaces can be forced to enter landscape screen and the display ratio can be changed. Because the application is not layout adapted, some interface display abnormalities and other problems may occur". The options of multiple applications can include options of application A, application B, application C and application D.
[0100] Suppose the user clicks the option of application A, for example, the arrow after application A. In response to the click operation of the user, as shown in (a) of FIG. 4, the content area pops up a forced landscape screen setting window, which includes options such as keep portrait screen display, landscape screen portrait screen ratio, landscape screen 4:3 and landscape screen full screen. The user can set the corresponding application to support forced landscape screen and set the landscape screen display ratio to the corresponding ratio by clicking the options such as landscape screen portrait screen ratio, landscape screen 4:3 or landscape screen full screen. For example, the user can click the landscape screen full screen option. In response to the operation of the user, application A is set to support forced landscape screen and can be displayed in full screen when displayed in forced landscape screen. In addition, as shown in (b) of FIG. 4, after the setting is completed, a prompt information "landscape screen full screen" can be displayed near the option of application A, indicating that application A has been set to support forced landscape screen and display in landscape screen full screen.
[0101] It should be understood that FIG. 3 and FIG. 4 are only used as an example to illustrate that the user sets a certain application to support forced landscape, and in other implementations, the device can also be configured to support forced landscape for certain applications, for example, the device is configured with a whitelist when it is shipped, the whitelist includes the application identifier of one or more applications, and the applications in the whitelist are configured to support forced landscape. Of course, other ways can also be used to configure a specific application to support forced landscape, and the embodiments of the present application do not limit this.
[0102] 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, part of the application interfaces of the application do not support forced landscape, that is, part of the application interfaces support landscape display and part of the application interfaces do not support landscape display. For ease of description, the application interface of the application that does not support landscape display in the application is referred to as an abnormal interface in the embodiments of the present application.
[0103] When the user uses the electronic device in landscape, for an application in the electronic device that does not support landscape display but is configured to support forced landscape, when the user opens the abnormal interface (i.e., the application interface that does not support landscape display) of such an application, the application interface may be restarted in a loop and the application interface may flicker, affecting the user experience.
[0104] Please refer to FIG. 5 and FIG. 6, which show a process diagram of interface flickering when an abnormal interface is started when the electronic device is in a landscape state. When the electronic device is in a landscape state, the electronic device can display a user interface as shown in (a) of FIG. 4, which includes the 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, as shown in (b) of FIG. 5, which supports landscape display. The personal center interface includes a chat list, and the chat list includes multiple contact information, such as Xiaohong and Xiaolü. If the user clicks Xiaohong in the chat list, in response to the user's operation, a chat interface for chatting with Xiaohong is started, as shown in (c) of FIG. 5. In the case where the chat interface does not support landscape display but application A supports forced landscape, after entering the chat interface for the first time, the chat interface may be restarted in a loop. During the restart process of the chat interface, the interface may flicker, for example, please refer to FIG. 6, the interface is black before displaying the new interface after restart. Thus, during the restart process of the chat interface, the interface will continuously appear black and then display a new interface (e.g., black-new interface-black-new interface), resulting in flickering of the interface.
[0105] It should be understood that FIG. 6 is only used as an example to illustrate the interface flicker form of black screen first and then display a new interface in the interface restart process, and in other embodiments, other interface flicker forms can also occur in the interface restart process, such as status bar flicker or partial area flicker in the interface, and the interface flicker form is not limited in the embodiments of the present application.
[0106] Next, the reason for the application interface cycle restart and the interface flicker phenomenon when opening an abnormal interface is analyzed in combination with the drawings.
[0107] Please refer to FIG. 7, which is a logic schematic diagram of an application interface cycle restart process provided by an embodiment of the present application. The embodiments of the present application take the opening of the application interface of a first application that does not support horizontal screen display by a user using an electronic device in a horizontal screen as an example. As shown in FIG. 7, the electronic device includes an application and a system (operating system), and the cycle restart process of the application interface includes the following steps:
[0108] A1: In the case that the electronic device is in a horizontal screen state, the user performs an operation of opening a first application interface of a first application.
[0109] The first application interface is an application interface that does not support horizontal screen display. The first application interface can be a main interface of the first application or other interfaces, and the embodiments of the present application are not limited thereto. The operation of opening the first application interface can also be an operation of starting the first application interface.
[0110] 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.
[0111] In another embodiment, in the case that the first application has been started, the user can open the first application interface through other application interfaces of the first application, such as clicking a related control for triggering the first application interface in other application interfaces of the first application to open the first application interface.
[0112] A2: In response to the operation of the user, the first application sends a first start request to the system, and the first start request is used to request to start the first application interface in a vertical screen direction.
[0113] In response to the operation of the user opening the first application interface, the first application can send a first start request to the system to request to start the first application interface in a vertical screen direction in the case that the current electronic device is in a horizontal screen state, but the first application interface does not support horizontal screen display.
[0114] A3: After the system receives the first start request, it is determined whether the first application supports forced horizontal screen.
[0115] A4: If the first application supports forced landscape, the system adjusts the boundary information corresponding to the first application interface to the boundary information of the landscape interface.
[0116] If the first application supports forced landscape, the system can ignore the portrait direction requested by the first application, and further modify the boundary corresponding to the first application interface from the boundary of the portrait interface to the boundary of the landscape interface, to create a first application interface in the landscape direction.
[0117] A5: After adjusting the boundary corresponding to the first application interface to the boundary of the landscape interface, the first application interface enters the resume state.
[0118] After adjusting the boundary, the first application interface can enter the active state, that is, the electronic device can display the first application interface in the landscape direction on the display screen.
[0119] The first application interface entering the active state is used to indicate that the first application interface is visible and interactive. The active state is an important stage of the Activity lifecycle corresponding to the first application interface, and is one of the most active states in the Activity lifecycle. When the Activity is in the active state, it means that the Activity is visible, in the foreground, and has the user input focus, and can receive user input and interact with the user.
[0120] A6: After adjusting the boundary corresponding to the first application interface to the boundary of the landscape interface, a system configuration change is triggered.
[0121] The system configuration change usually includes changes in screen orientation, language settings, light and dark mode, keyboard availability, etc. Since the modification of the boundary information from the boundary of the portrait interface to the boundary of the landscape interface can indicate a change in the screen orientation, it belongs to a system configuration change, so the change of the boundary information will trigger a system configuration change, such as a configuration change message.
[0122] That is, after adjusting the boundary, on the one hand, a system configuration change can be triggered, and on the other hand, the corresponding application interface can enter the active state. The two can occur in parallel or in a very short time, and the embodiments of the present application do not limit this.
[0123] A7: The system sends a configuration change message to the first application.
[0124] For the 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.
[0125] As an example, after the first application is started, it generally registers a callback function for listening to system configuration changes with the system, so that when the system configuration changes, the system will automatically call the callback function to send a configuration change message to the first application to notify the first application of the change in system configuration.
[0126] After the first application receives the configuration change message, it will send a first start request to the system again to restart the first application interface. That is, after the first application receives the configuration change message, it will re-run the above flow, i.e., re-perform steps A2-A7, to restart the first application interface, and this repeated cycle will restart the first application interface, which appears to flicker continuously.
[0127] A8: After step A3, if the first application does not support forced landscape, the first application interface in portrait orientation is displayed.
[0128] As shown in FIG. 7, in the processing logic of the system, when the system configuration changes, the system will automatically dispatch a configuration change message to the application to enable the application to respond to the changed system configuration and adapt to the changed system configuration. However, in the case where the first application does not support landscape display but supports forced landscape, the configuration change message dispatched to the application will cause the application to restart the application interface continuously, resulting in flickering of the interface.
[0129] To address the above problem, embodiments of the present application provide a method for processing configuration changes. When the electronic device is in a landscape state, if a system configuration change is detected during the running of the first application, the operation of sending a configuration change message to the first application can be exited to prohibit dispatching of the configuration change message to the first application, if a preset condition is met, i.e., the current application interface of the first application is in an active state, the first application requests an application interface in portrait orientation, and the first application supports forced landscape. When a system configuration change is detected, if the current application interface of the first application is in an active state, the first application requests an application interface in portrait orientation, and the first application supports forced landscape, it indicates that the current application interface is displayed in the foreground and 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 can not be dispatched to the first application, so that the first application cannot restart the application interface according to the configuration change message, thereby breaking the cycle of restarting the application interface of the first application and preventing the application interface from flickering continuously, and improving the user experience.
[0130] In addition, during running of the first application, if a system configuration change is monitored, the system can dispatch a configuration change message to the first application in a case where preset conditions are not met, such as a case where the current application interface of the first application is not in an active state, and / or the first application requests an application interface in a landscape direction, and / or the first application does not support forced landscape, so that the first application cannot restart the application interface according to the configuration change message.
[0131] Next, the method for processing the configuration change provided by the example of the present application is exemplified in combination with the accompanying drawings.
[0132] Please refer to FIG. 8, which is a logic diagram of a method for processing a configuration change provided by an embodiment of the present application. The embodiment of the present application is exemplified in a case where a system configuration change is triggered after a user opens an application interface of a first application when the user uses an electronic device in a landscape direction. As shown in FIG. 8, the electronic device includes an application and a system, and the method includes the following steps:
[0133] B1: In a case where the electronic device is in a landscape state, a user performs an operation of opening a first application interface of a first application.
[0134] The first application interface can be a main interface of the first application, or can be another interface, which is not limited in the embodiment of the present application.
[0135] In an embodiment, the user can click an icon of the first application to open the first application interface. For example, the first application interface is a main interface of the first application.
[0136] In another embodiment, in a case where the first application has been started, the user can open the first application interface through another application interface of the first application, such as that the user can click a related control in the other application interface of the first application for triggering the first application interface to open the first application interface.
[0137] B2: In response to the operation of the user, the first application sends a first start request to the system, and the first start request is used to request to start a first application interface in a portrait direction.
[0138] In response to the operation of the user of opening the first application interface, the first application can send a first start request to the system in a case where the current electronic device is in a landscape state, but the first application interface does not support landscape display, to request to start a first application interface in a portrait direction.
[0139] In response to the operation of the user opening the first application interface, the first application can first determine the screen state (landscape state or portrait state) of the current electronic device, and whether the first application interface to be started supports landscape display. If the current electronic device is in a landscape state and the first application interface does not support landscape display, a first start request is sent to the system to request starting the first application interface in a portrait direction. In addition, if the current electronic device is in a landscape state and the first application interface supports landscape display, a second start request can also be sent to the system to request the first application interface in a landscape direction.
[0140] As an example, the operation of the first application sending the first start request to the system can include: the first application first calls a related interface of the system to start an interface, and then sends a direction setting request to the system, the direction setting request carrying portrait direction indication information, for requesting to set the started interface to a portrait direction. The related interface can be a start activity method, etc.
[0141] B3: After the system receives the first start request, it is judged whether the first application supports forced landscape.
[0142] The system can first parse the related configuration information of the first application, and determine whether the first application supports forced landscape according to the related configuration information. The related configuration information is information for indicating whether the first application is configured to support forced landscape, such as a specific whitelist. The specific whitelist includes the identification of one or more applications, and the applications in the specific whitelist are configured to support forced landscape.
[0143] B4: If the first application supports forced landscape, the system adjusts the boundary information corresponding to the first application interface to the boundary information of the landscape direction interface.
[0144] If the first application supports forced landscape, the system can ignore the portrait direction requested by the first application, and then adjust the boundary corresponding to the first application interface from the boundary of the portrait direction to the boundary of the landscape direction to create the first application interface in the landscape direction.
[0145] B5: The first application interface enters an active state.
[0146] After adjusting the boundary, the first application interface can enter an active state, that is, the first application interface is visible and interactive. The electronic device can display the first application interface in the landscape direction on the display screen.
[0147] B6: After the system adjusts the boundary corresponding to the first application interface to the boundary information of the landscape direction interface, the system configuration change is triggered.
[0148] The system configuration change usually includes changes of screen orientation, language setting, dark mode, keyboard availability, etc. Since the boundary is adjusted from the portrait orientation to the landscape orientation, which can indicate a change of screen orientation, which belongs to the system configuration change, the change of the boundary will trigger the system configuration change, such as the configuration change message.
[0149] 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 active state, and the two can occur in parallel or in a very short time. The embodiments of the present application do not limit this.
[0150] B7: The system determines whether the first application meets the preset condition, and the preset condition includes that the application interface of the first application is in the active state, the first application requests to start the application interface in the portrait orientation, and the first application supports forced landscape.
[0151] In the embodiments of the present application, after the system configuration changes, the system does not directly dispatch the configuration change message to the first application, but can first determine whether the first application meets the preset condition, such as whether the current application interface of the first application is in the active state, whether the first application requests to start the application interface in the portrait orientation, and whether the first application supports forced landscape, and then determines whether to dispatch the configuration change message to the first application according to the determination result.
[0152] B8: If the first application meets the preset condition, the execution ends.
[0153] 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 the configuration change message is not dispatched to the first application.
[0154] If the current application interface of the first application is in the active state, the first application requests to start the application interface in the portrait orientation, and the first application supports forced landscape, it means that the current application interface is displayed in the foreground, and the current application does not support landscape display but supports forced landscape. At this time, if the configuration change message is dispatched to the application, it may cause the application to 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, i.e. not dispatching the configuration change message to the application, the application cannot restart the application interface according to the configuration change message, thereby breaking the cyclic restart process of the application interface of the application, preventing the application interface from flickering continuously, and improving the user experience.
[0155] B9: If the first application does not meet the preset condition, the system sends the configuration change message to the first application.
[0156] That is, if the first application does not meet the preset condition, the system can normally send the configuration change message to the first application. After the first application receives the configuration change message, the first application can respond to the configuration change message, such as restarting the first application interface.
[0157] As an example, after the first application is started, the first application can register a callback function for listening to system configuration changes with the system. When the system configuration changes and the first application meets the preset condition, the system can call the callback function to send the configuration change message to the first application through the callback function to notify the first application of the system configuration change.
[0158] For example, the callback function can be an onConfigurationChanged method or the like.
[0159] For example, the condition that the first application does not meet the preset condition can include one or more of the following conditions: the application interface of the first application is not in an active state; the first application requests to start an application interface in a landscape orientation; the first application does not support forced landscape, and the like.
[0160] Next, several scenarios in which the first application does not meet the preset condition are described by way of example.
[0161] Scenario one: in the case where the first application does not support landscape display and does not support forced landscape, a system configuration change occurs.
[0162] For example, in the case where the first application does not support landscape display and does not support forced landscape, a system configuration change occurs during the process of starting the application interface of the first application in the case where the electronic device is in a landscape state.
[0163] As an example, in the case where the electronic device is in a landscape state, a user starts the first application interface of the first application. In response to the operation of the user, in the case where 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 a portrait orientation. In response to the first start request, in the case where the first application does not support forced landscape, an application interface in a 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.
[0164] 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, depth mode (mode switching between dark mode and light mode), keyboard availability, and the like. The instruction to change the system configuration can be triggered by a user through a specified operation, which can be a click operation, a key operation, a voice operation, or a gesture operation, and the like, which is not limited in the embodiments of the present application.
[0165] Scenario two: the system configuration changes when the first application supports landscape display.
[0166] For example, when the first application supports landscape display and the electronic device is in a landscape state, the system configuration changes during the process of starting the application interface of the first application.
[0167] As an example, when the electronic device is in a landscape state, a user starts the first application interface of the first application. In response to the operation of the user, when the first application interface supports landscape display, the first application initiates a second starting request to request starting the first application interface in a landscape direction; in response to the second starting request, the first application interface in the landscape 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.
[0168] Scenario three: the system configuration changes when the application interface of the first application is not in an active state.
[0169] For example, when the application interface of the first application is not in an active 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.
[0170] In the above scenarios, because the first application does not meet the preset condition, when the system configuration changes, the system can normally dispatch (send) the configuration change message to the first application.
[0171] It should be noted that the embodiments of the present application only exemplify the scenarios that do not meet the preset condition by using the above scenarios, and it should be understood that the above scenarios do not constitute a limitation on the scenarios that do not meet the preset condition, and the scenarios that do not meet the preset condition can also include other scenarios, and the embodiments of the present application do not limit this.
[0172] B10: After step B3, if the first application does not support forced landscape, the first application interface in a portrait direction is displayed.
[0173] As an example, the pseudo code of the key steps (such as steps B7-B9) in the embodiments of the present application can be as follows:
[0174] In an embodiment, the preset condition can 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 that the first application interface triggers an active state within a certain time length reaches a first preset number; and the number of times that the first application interface changes the boundary within a certain time length reaches a second preset number.
[0175] The certain time length can be a preconfigured time length, and the first preset number and the second preset number can also be preconfigured, such as 2 or 3 times, etc.
[0176] By adding the full-screen display mode of the first application interface in the preset condition, the accuracy of predicting that the current scene is the interface continuous flickering scene can be improved. By adding the condition that the number of times that the first application interface triggers the active state within a certain time length reaches the first preset number, the application can be prohibited from being dispatched with the configuration change message when the first application interface frequently triggers the active state, and thus the accuracy of predicting that the current scene is the interface continuous flickering scene can be improved. By adding the condition that the number of times that the first application interface changes the border within a certain time length reaches the second preset number in the preset condition, the application can be prohibited from being dispatched with the configuration change message when the first application interface frequently modifies the border, and thus the accuracy of predicting that the current scene is the interface continuous flickering scene can be further improved.
[0177] Next, the method for processing the configuration change related to the embodiments of the present application will be described in detail in combination with the software framework shown in FIG. 2.
[0178] Please refer to FIG. 9, which is a flowchart of another method for processing the configuration change provided by the embodiments of the present application. The method is applied to an electronic device, and 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 embodiments of the present application take the first activity record module as the system original activity record and the second activity record module as the extended honor activity record as an example. As shown in FIG. 9, the method includes the following steps:
[0179] Step 901, in the case that the electronic device is in a horizontal screen state, a user performs an operation of opening a first application interface of a first application.
[0180] Step 902, in response to the operation of the user, the first application calls a startActivity function to start the Activity.
[0181] An Activity is used to create or manage an application interface, and to handle the interaction with the user. The application interface is a window for the user to interact with the application, which is composed of views and layouts in the Activity. The Activity can be regarded as a container, and the interface is the content in the container. The Activity is responsible for creating and managing the container, and the interface fills the specific content of the container. Therefore, in response to the operation of the user 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.
[0182] The first application can call the relevant interface of the AWM to start the Activity, and the embodiment of the application takes the start Actinity function as an example to illustrate the relevant interface.
[0183] Step 903, in the case that the first application does not support landscape display, the first application sends a direction setting request to the Activity, and the direction setting request carries a portrait direction identifier, which is used to request a portrait direction.
[0184] As an example, the application can call the relevant interface of the AMS to send the direction setting request, and the relevant interface can be the setRguestOrientation (set the direction of the request) function.
[0185] Step 904, the Activity sends the direction setting request to the activity record.
[0186] That is, the Activity forwards the direction setting request to the activity record.
[0187] Step 905, after the activity record receives the direction setting request, the activity record parses the first configuration information of the first application, and the first configuration information is used to indicate whether the first application supports forced landscape.
[0188] As an example, the activity record can call the resolveOverrideConfiguration (resolve override configuration) function to parse the first configuration information.
[0189] Step 906, the activity record determines whether the first application supports forced landscape according to the first configuration information, and obtains a determination result.
[0190] Step 907, the activity record sends the determination result to the honor activity record.
[0191] Step 908, the honor activity record modifies the boundary information to the boundary information of the landscape interface in the case that the judgment result indicates that the first application does not support forced landscape.
[0192] As an example, the honor activity record can modify the boundary information of the first application interface to the boundary information of the landscape interface in the process of setting the first application interface, such as modifying the boundary information to the boundary information of the landscape interface through the apply app display rect function.
[0193] 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 landscape interface.
[0194] Step 910, the WMS sets the boundary according to the set boundary request.
[0195] The WMS can set the landscape interface according to the set boundary request, so as to display the first application interface in the landscape direction, and thus the first application interface can enter the active state, that is, the Activity corresponding to the first application interface enters the active state.
[0196] Step 911, the WMS sends a response message to the honor activity record.
[0197] After the WMS receives the set boundary request or completes the setting of the boundary, the WMS can return a response message to the honor activity record. At the same time, the WMS can also send a configuration change message to the Activity.
[0198] That is, step 911 and step 914 described below can be executed in parallel, and of course, they can also be executed in succession in a very short time, and the embodiments of the present application do not limit this.
[0199] After the honor activity record receives the response message, it can make some preparations for the correct configuration of the Activity, such as executing steps 912-913 described below.
[0200] Step 912, the honor activity record receives the response message and calls the EnsureAcitvityConfiguration method.
[0201] By calling the EnsureAcitvityConfiguration method, it can be ensured that the configuration of the Activity is correctly set or the correct function or method is applied to ensure that the Activity is configured correctly.
[0202] At step 913, the honor activity record calls the RelaunchActivityLocked method.
[0203] The RelaunchActivityLocked is used to relaunch (or restart) an existing Activity under certain conditions.
[0204] At step 914, the WMS sends a configuration change message to the Activity.
[0205] As an example, the WMS can send a configuration change message to the Activity by calling the onConfigurationChanged method of the Activity.
[0206] The onConfigurationChanged method is a callback function. After the Activity is started, the Activity can register a callback function with the WMS for listening to changes in system configuration, so that when the WMS detects a change in system configuration, it can call the callback function to send a configuration change message to the Activity through the callback function.
[0207] At step 915, after receiving the configuration change message, the Activity determines whether the first application meets the preset condition.
[0208] The preset condition includes whether the current Activity corresponding to the first application is in an active state, whether the first application requests an application interface in a portrait orientation, and whether the first application supports forced landscape.
[0209] At step 916, if the determination result is yes, the Activity ends execution.
[0210] At step 917, if the determination result is no, the Activity sends a configuration change message to the first application.
[0211] As an example, the Activity can send a configuration change message to the first application by calling the onConfigurationChanged method.
[0212] After receiving the configuration change message, the first application can respond to the configuration change message, such as returning to step 902, restarting the Activity according to the changed system configuration, so that the electronic device repeatedly performs steps 903-915 described above.
[0213] The present application also provides a chip coupled with the memory, the chip being configured to read and execute the computer program or instructions stored in the memory to perform the method in each of the embodiments.
[0214] The present application also provides an electronic device comprising a chip configured to read and execute the computer program or instructions stored in the memory so that the method in each of the embodiments is performed.
[0215] The present application also provides a computer readable storage medium storing computer instructions, when the computer instructions are executed on an electronic device, the electronic device performs the related method steps to implement the video processing method in the embodiments.
[0216] The present application also provides a computer program product, the computer readable storage medium storing program codes, when the computer program product is executed on a computer, the computer executes the related steps to implement the video processing method in the embodiments.
[0217] In addition, the embodiments of the present application also provide an apparatus, which can be a chip, a component or a module, and the apparatus can comprise a processor and a memory connected to each other; wherein the memory is configured to store computer execution instructions, and when the apparatus is running, the processor can execute the computer execution instructions stored in the memory to enable the chip to perform the video processing method in each of the method embodiments.
[0218] The electronic device, the computer readable storage medium, the computer program product or the chip provided by the embodiments of the present application are all configured to perform the corresponding method provided above, and thus the beneficial effects achieved thereby can refer to the beneficial effects of the corresponding method provided above, which will not be described herein again.
[0219] The embodiments of the present application do not particularly limit the specific structure of the subject performing the method provided by the embodiments of the present application, as long as the subject can perform video processing according to the method provided by the embodiments of the present application by running the program recording the code of the method provided by the embodiments of the present application. For example, the subject performing the method provided by the embodiments of the present application can be an electronic device, or a functional module in the electronic device capable of calling and executing the program.
[0220] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other manners. For example, the apparatus embodiments described above are merely illustrative, for example, the division of the modules or units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another apparatus, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, apparatuses or units, and can be electrical, mechanical or other forms.
[0221] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place or can be distributed to a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0222] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0223] If the integrated unit is realized 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 solutions of the present application, or the part of the present application that essentially contributes to the prior art, or part of the technical solutions, can be embodied in the form of a computer software product stored in a storage medium, and the computer software product includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The storage medium mentioned above can include, but is not limited to: U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, and various media that can store program codes.
[0224] The above is merely 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 can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of handling configuration changes, characterized by, The method is applied to an electronic device including a first application, and the method comprises: In a case where the electronic device is in a horizontal screen state, in response to a system configuration change occurring during running of the first application, in a case where the first application meets a preset condition, an 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 comprises that an application interface of the first application is in an active state, the first application requests to start an application interface in a vertical screen direction, and the first application supports forced horizontal screen.
2. The method of claim 1, wherein, Before the operation of sending the configuration change message to the first application in the case where the first application meets the preset condition, the method further comprises: In response to an operation of a user starting a first application interface of the first application, in a case where the first application interface does not support horizontal screen display, the first application initiates a first start request, and the first start request is used to request to start the first application interface in a vertical screen direction; In response to the first start request, in a case where the first application supports forced horizontal screen, a boundary corresponding to the first application interface is adjusted to a boundary of a horizontal screen direction interface, and the configuration change message is triggered.
3. The method of claim 2, wherein, The method further comprises: After the boundary of the first application interface is adjusted to the boundary of the horizontal screen direction interface, the first application interface in the horizontal screen direction is displayed, and the first application interface enters the active state.
4. The method of claim 2, wherein, The method further comprises: In response to the first start request, in a case where the first application does not support forced horizontal screen, the first application interface in the vertical screen direction is displayed.
5. The method of claim 2, wherein, The method further comprises: In response to an operation of a user starting the first application interface of the first application, in a case where 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 a horizontal screen direction; In response to the second start request, the first application interface in the horizontal screen direction is displayed.
6. The method of claim 1, wherein, The method further comprises: In response to a system configuration change occurring during running of the first application, in a case where the first application does not meet the preset condition, the configuration change message is sent to the first application; The first application initiates a second start request according to the configuration change message, and the second start request is used to request to restart an application interface.
7. The method of claim 6, wherein, The first application not meeting the preset condition comprises one or more of the following conditions: The application interface of the first application is not in the active state; The first application requests to start an application interface in a horizontal screen direction; The first application does not support forced horizontal screen.
8. The method of claim 6, wherein, Before the configuration change message is sent to the first application in the case where the first application does not meet the preset condition, the method further comprises: In response to an operation of a user starting a first application interface of the first application, in a case where 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 a horizontal screen direction; In response to the second start request, display the first application interface in a landscape orientation; receive an instruction to change a system configuration; change the system configuration according to the instruction, and trigger the configuration change message.
9. The method of claim 6, wherein, Before sending the configuration change message to the first application in the case that the first application does not meet the preset condition, the method further includes: In response to a user starting the first application interface of the first application, in the case that the first application interface does not support landscape display, the first application initiates a first start request, the first start request being used to request starting the first application interface in a portrait orientation; In response to the first start request, in the case that the first application does not support forced landscape, display the first application interface in a portrait orientation; receive an instruction to change a system configuration; change the system configuration according to the instruction, and trigger the configuration change message.
10. The method of claim 6, wherein, Before sending the configuration change message to the first application in the case that the first application does not meet the preset condition, the method further includes: In the case that the application interface of the first application is not in an active state, receive an instruction to change a system configuration; change the system configuration according to the instruction, and trigger the configuration change message.
11. The method of any one of claims 1-10, wherein, The preset condition further 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 that the first application interface triggers an active state within a certain time length reaches a first preset number of times; The number of times that the first application interface changes a boundary within a certain time length reaches a second preset number of times.
12. An electronic device, comprising: 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 code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method of any one of claims 1 to 11.
13. A chip system, characterized by The chip system is applied to an electronic device, and the chip system includes one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method of any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, The computer readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the method of any one of claims 1 to 11.
Citation Information
Patent Citations
Application program starting method and device, storage medium and terminal
CN108958830A
An application display method and electronic equipment
CN109814766A
Screen display method, electronic equipment and storage medium
CN114442870A
Method and device for processing configuration change and storage medium
CN118740971A
Input method and apparatus, and electronic device
WO2022089411A1