Method and device for processing configuration change and storage medium
By monitoring system configuration changes and determining the application interface status in landscape mode, the system prevents applications that do not support landscape mode but do support forced landscape mode from restarting, thus resolving the issue of application interface flickering and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2026-03-10
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 CN121644730A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal, in particular to a method, device and storage medium for processing configuration change. BACKGROUND
[0002] With the continuous development of terminal technology, the function of terminal device is more and more powerful, and various applications can be installed 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 according to the needs, so as to force them to support landscape display.
[0003] For some applications that do not support landscape display but are configured to support forced landscape, when the device is in landscape mode, 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 start request of the application interface in portrait direction according to the user's start operation. After receiving the start request, the system can first judge whether the application interface supports forced landscape. If it supports forced landscape, the request in portrait direction is ignored, and the boundary information of the application interface is modified to the boundary information of the landscape interface to display the landscape application interface. In addition, the change of boundary information belongs to a kind of system configuration change, so the change of boundary information will also trigger a configuration change message. For the system side triggered configuration change message, the system will dispatch the configuration change message to the application. After the application receives the configuration change message, the application interface will be restarted 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 again, which will cause the application interface to restart repeatedly, resulting in continuous flickering of the application interface. SUMMARY
[0004] The present application provides a method, device and storage medium for processing configuration change, which can interrupt the repeated restart process of the application interface of the application that does not support landscape display but supports forced landscape when the device is in landscape mode, prevent the continuous flickering of the application interface, and improve the user experience.
[0005] The technical solution is as follows:
[0006] In a first aspect, a method for processing configuration change is provided, which is applied to an electronic device including a first application, and includes:
[0007] In a case where the electronic device is in the 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 the 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.
[0008] That is, in a case where the electronic device is in the landscape state, during running of an application, if a system configuration change is listened to, it can be first judged whether the 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 an active state, the application requests to start an application interface in a portrait direction, and the application supports forced landscape, the operation of sending a configuration change message to the application is exited, that is, the configuration change message is not dispatched to the application. When the system configuration change is listened to, if the current application interface of the application is in an active state, the application requests to start an application interface in a 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 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 cannot restart the application interface according to the configuration change message, so as to interrupt the cyclic restart process of the application interface of the application, prevent the application interface from flickering continuously, and improve the user experience.
[0009] 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 the user starting the 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 start request, the first start request is used to request to start the first application interface in a portrait direction; and in response to the first start request, in a case where the first application supports forced landscape, the boundary corresponding to the first application interface is adjusted to the boundary of the landscape direction interface, and the configuration change message is triggered.
[0010] In this way, in a case where the electronic device is in the landscape state and the first application in the electronic device does not support landscape display but supports forced landscape, after the application interface of the first application triggers the configuration change message for the first time, 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 started for the first time, thereby avoiding the problem of continuous flickering of the application interface caused by cyclic restart of the application interface.
[0011] In an embodiment of the present application, after the boundary of the first application interface is adjusted to the boundary of the interface in the landscape orientation, the first application interface in the landscape orientation 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.
[0012] 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 focus of user input, and can receive user input and interact with the user.
[0013] In an embodiment of the present application, in response to the first start request, if the first application does not support forced landscape, the first application interface in the portrait orientation is displayed. That is, if the first application does not support forced landscape, the system can directly display the first application interface in the portrait orientation without adjusting the boundary for forcing the first application interface to display in the landscape orientation.
[0014] In an embodiment of the present application, in response to the operation of the user starting the first application interface of the first application, if the first application interface supports landscape 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 the landscape orientation; and in response to the second start request, the first application interface in the landscape orientation is displayed.
[0015] That is, if the first application interface supports landscape display, the first application can directly request to start the first application interface in the landscape orientation, so that the electronic device displays the first application interface in the landscape orientation.
[0016] In an embodiment of the present application, in response to a system configuration change occurring during the running of the first application, if the first application does not meet the preset condition, a configuration change message is sent to the first application; and 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 the first application interface.
[0017] When the system configuration change occurs during the 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 under normal circumstances can be avoided.
[0018] In an embodiment of the present application, the first application not meeting the preset condition includes one or more of the following conditions:
[0019] 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.
[0020] 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 the user starting the first application interface of the first application, when the first application interface supports landscape display, the first application initiates a second start request, the second start request being used to request to start the first application interface in a landscape orientation; in response to the second start 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 the configuration change message is triggered.
[0021] In this way, when the first application supports landscape display, 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 electronic device can normally display the application interface in the landscape orientation.
[0022] 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 the user starting the first application interface of the first application, when 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 to start the first application interface in a portrait orientation; in response to the first start 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 the configuration change message is triggered.
[0023] In this way, when the first application does not support landscape display and does not support forced landscape, if a system configuration change occurs during the running of the first application, 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.
[0024] 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, 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.
[0025] 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.
[0026] In one embodiment of this application, the preset conditions also include at least one of the following conditions: the display mode of the first application interface is full-screen display; the number of times the first application interface triggers the activation state within a certain period of time reaches a first preset number; and the number of times the first application interface changes its boundaries within a certain period of time reaches a second preset number.
[0027] The duration can be a pre-configured duration, and the first and second preset number of times can also be preset, such as 2 or 3 times.
[0028] By adding a condition that the display mode of the first application interface is set to full-screen, the accuracy of predicting the current scenario as a continuously flickering scenario can be improved. By setting a condition that the number of times the first application interface triggers an activation state within a certain time period reaches a first preset number, the dispatch of configuration change messages to the application can be prohibited when the first application interface frequently triggers an activation state, which can also improve the accuracy of predicting the current scenario as a continuously flickering scenario. By adding a condition that the number of times the first application interface changes its boundaries within a certain time period reaches a second preset number, the dispatch of configuration change messages to the application can be prohibited when the first application interface frequently modifies its boundaries, which can further improve the accuracy of predicting the current scenario as a continuously flickering scenario.
[0029] Secondly, an apparatus for processing configuration changes is provided, the apparatus having the functionality to implement the method behavior for processing configuration changes described in the first aspect. The apparatus for processing configuration changes includes at least one module for implementing the method for processing configuration changes provided in the first aspect.
[0030] Thirdly, an apparatus for processing configuration changes is provided, the apparatus comprising a processor and a memory, the memory storing a program that supports the apparatus for processing configuration changes in executing the method provided in the first aspect, and storing data related to implementing the method for processing configuration changes as described in the first aspect. The processor is configured to execute the program stored in the memory. The apparatus for processing configuration changes may further include a communication bus for establishing a connection between the processor and the memory.
[0031] Fourthly, a computer-readable storage medium is provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform the method for processing configuration changes described in the first aspect.
[0032] Fifthly, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to perform the method for processing configuration changes described in the first aspect above.
[0033] The technical effects achieved by the second, third, fourth, and fifth aspects mentioned above are similar to those achieved by the corresponding technical means in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0034] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0035] Figure 2 This is a block diagram of a software system for an electronic device 100 provided in an embodiment of this application;
[0036] Figure 3 This is a schematic diagram illustrating the process of setting an application to support forced landscape mode, as provided in an embodiment of this application.
[0037] Figure 4 This is a schematic diagram illustrating another process for setting up an application to support forced landscape mode, provided in an embodiment of this application.
[0038] Figure 5 This is a schematic diagram illustrating the process of launching an abnormal interface when an electronic device is in landscape mode, as provided in an embodiment of this application.
[0039] Figure 6 This is a schematic diagram illustrating the screen flickering when an abnormal interface is launched in landscape mode, as provided in an embodiment of this application.
[0040] Figure 7 This is a logical diagram illustrating an application interface loop restart process provided in an embodiment of this application;
[0041] Figure 8 This is a logical diagram illustrating a method for handling configuration changes, provided in an embodiment of this application.
[0042] Figure 9 This is a flowchart of another method for handling configuration changes provided in an embodiment of this application. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0044] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limiting purposes, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details.
[0045] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0046] It should also be understood that in the embodiments of this application, "one or more" refers to one, two, or more; "and / or" describes the relationship between the associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following associated objects have an "or" relationship.
[0047] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," "fourth," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0048] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0049] Currently, when users use electronic devices in landscape mode, for applications that do not support landscape display but are configured to support forced landscape mode, the application interface may repeatedly restart or flicker when the user opens the application interface, affecting the user experience.
[0050] To address the aforementioned issues, this application provides a method for handling configuration changes. When the electronic device is in landscape mode, if a system configuration change is detected during application operation, the method first determines whether the application's current interface is active, whether the application requests to launch a portrait-oriented interface, and whether the application supports forced landscape mode. If the application's current interface is active, the application requests to launch a portrait-oriented interface, and the application supports forced landscape mode, then the operation of sending a configuration change message to the application is abandoned; that is, no configuration change message is dispatched to the application.
[0051] When a system configuration change is detected, if the application's current interface is active, the application requests to launch a portrait-oriented interface, and the application supports forced landscape mode, it means the current application interface is displayed in the foreground. The application doesn't currently support landscape mode but supports forced landscape mode. In this case, sending a configuration change message to the application might cause the application to repeatedly restart the interface based on the configuration change message. By disabling the operation of sending configuration change messages to the application (i.e., not sending configuration change messages), the application cannot restart based on the configuration change message, thus interrupting the application's repeated restart process, preventing continuous flickering of the application interface, and improving the user experience.
[0052] The method for handling configuration changes provided in this application is applied to electronic devices. Electronic devices can also be called terminals, terminal equipment, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. Electronic devices can be mobile phones, smart TVs, wearable devices, tablets, computers with wireless transceiver capabilities, virtual reality (VR) electronic devices, augmented reality (AR) electronic devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, and so on. The embodiments of this application do not limit the specific technologies or device forms used in the electronic devices.
[0053] Before providing a detailed explanation of the method for handling configuration changes provided in the embodiments of this application, the electronic equipment involved in the embodiments of this application will be described first.
[0054] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. See also... Figure 1The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 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 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0055] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0056] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0057] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0058] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from this memory. This prevents repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0059] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0060] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0061] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0062] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0063] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0064] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be 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 Mini LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is an integer greater than 1.
[0065] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0066] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's image sensor. The light signal is converted into an electrical signal, and the image sensor transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimizations on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be integrated into the camera 193.
[0067] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. 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, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is an integer greater than 1.
[0068] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP performs Fourier transforms on the frequency energy.
[0069] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.
[0070] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0071] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions, such as saving music, video, and other files on the external memory card.
[0072] Internal memory 121 can be used to store computer-executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created by electronic device 100 during use (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0073] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D and application processor.
[0074] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch operation intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example, when a touch operation with an intensity less than the pressure threshold is applied to the SMS application icon, a command to view an SMS message is executed. When a touch operation with an intensity greater than or equal to the pressure threshold is applied to the SMS application icon, a command to create a new SMS message is executed.
[0075] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch display." Touch sensor 180K detects touch operations applied to or near it. Touch sensor 180K can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.
[0076] The electronic devices provided in this application embodiment can be user equipment (UE), such as mobile terminals (e.g., mobile phones), tablet computers, desktop computers, laptops, handheld computers, netbooks, personal digital assistants (PDAs), large-screen devices, etc. Large-screen devices can include large-screen displays, large-screen TVs, large-screen all-in-one machines, and mobile smart screens that have emerged in recent years.
[0077] The software system of electronic device 100 will be described next.
[0078] An operating system runs on top of these components. Examples include Apple's iOS, Google's Android, and Microsoft's Windows. Applications can be installed and run on this operating system.
[0079] The operating system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.
[0080] Figure 2 This is a block diagram of a software system for an electronic device 100 provided in an embodiment of this application. See also... Figure 2 A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android Runtime, the system layer, and the kernel layer.
[0081] The application layer can include a series of application packages. For example... Figure 2As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0082] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 2 As shown, the application framework layer includes the Activity Manager Service (AMS) and the Window Manager Service (WMS).
[0083] Application Management System (AMS) is a core system service responsible for managing the lifecycle of Activities, task stacks, and process creation and destruction within an application. It acts as a bridge between the application framework layer and the underlying system services. AMS includes Activity and Activity Record modules, with one or more Activity Record modules per module. The Activity Record module is the key data structure for AMS's management of Activities, representing the historical record of an Activity. It contains information such as the Activity's identity, launch information, process duration, state information, and control information. This information is used for system management and scheduling, ensuring that Activities run according to predetermined rules and processes. As an example, such as... Figure 2 As shown, AMS includes Activity, a first activity record module, and a second activity record module. The first activity record module can be the native activity record in AMS, while the second activity record module can be a new activity record obtained by extending or encapsulating the native activity record, such as Honor Activity Record.
[0084] WMS is the core service in the Android system responsible for managing the display of windows and views. For example, it manages and controls the display, layout, interaction, and animation effects of all windows in the system.
[0085] As an example, AMS can receive a launch request from an application and launch the application interface accordingly. During application runtime, system configurations may change. When system configurations change, WMS can detect the change and send a configuration change message to AMS. This message indicates that the system configuration has changed. System configuration changes typically include changes to screen orientation, language settings, déjà vu mode, keyboard availability, and other configuration settings.
[0086] It should be noted that in this embodiment, a judgment logic is added to the execution logic after the AMS receives the configuration change message. That is, after receiving the configuration change message, the AMS does not directly dispatch the configuration change message to the application, but first determines whether the application meets the preset conditions. If it does, the operation of sending the configuration change message to the application is terminated. If it does not meet the conditions, the configuration change message is sent to the application.
[0087] The preset conditions may include the application's current interface being active, the application requesting a portrait orientation interface, and the application supporting forced landscape orientation. Additionally, the preset conditions may include one or more of the following: the first application interface is displayed in full-screen mode; the first application interface triggers an active state a certain number of times within a certain time period; or the first application interface changes its boundaries a certain number of times within a certain time period.
[0088] In addition, the application framework layer may also include a window manager, content provider, view system, resource manager, notification manager, etc., which are not limited in this embodiment. The window manager is used to manage window programs. The window manager can obtain the screen size, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and retrieve data and make this data accessible to the application. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to construct the application's display interface, which can consist of one or more views, such as a view for displaying SMS notification icons, a view for displaying text, and a view for displaying images. The resource manager provides the application with various resources, such as localized strings, icons, images, layout files, video files, etc. The notification manager enables the application to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short pause without user interaction. For example, the notification manager is used to notify of download completion, message reminders, etc.
[0089] The Android Runtime comprises the core libraries and the virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system. The core libraries consist of two parts: one part contains the functionalities that Java calls, and the other part is the core Android library itself. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0090] The system library can include multiple functional modules, such as: a surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), and 2D graphics engines (e.g., SGL). The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media libraries support playback and recording of various common audio and video formats, as well as still image files. The media libraries support various audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing libraries are used to implement 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D graphics.
[0091] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0092] It should be noted that, Figure 2 The layers in the illustrated software architecture and the components contained in each layer do not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more layers than illustrated, such as a system library (FWK LIB) layer. Furthermore, each layer may include more or fewer components than illustrated, which is not limited in this application.
[0093] It should be noted that although the embodiments of this application are described using the Android system as an example, the basic principles are also applicable to electronic devices based on operating systems such as iOS or Windows.
[0094] The following is a brief overview of the method for handling configuration changes provided in the embodiments of this application, based on the software architecture described above.
[0095] When an electronic device is in landscape mode, if a user opens an application, in response to the user's action, if the application does not support landscape display, it can send a first launch request to the Application Management System (AMS) to request the launch of the application interface in portrait orientation. Upon receiving the first launch request, the AMS first determines whether the application supports forced landscape mode. If it does, it ignores the requested portrait orientation and modifies the boundary information of the application interface to be launched to the boundary information of the landscape orientation interface. It then sends a boundary setting request to the Workspace Management System (WMS), which carries the boundary information of the landscape orientation. Upon receiving this boundary setting request, the WMS sets the interface boundary according to the request, triggers system configuration changes, and sends a configuration change message to the AMS. Upon receiving this configuration change message, the AMS first determines whether the application meets preset conditions, such as whether the application's current interface is active, whether the application requests a portrait orientation interface, and whether the application supports forced landscape mode. If the application's current interface is active, and the application requests a portrait-oriented interface, and the application supports forced landscape mode, then AMS can exit its original execution logic, i.e., it can stop sending configuration change messages to the application, thus preventing the dispatch of configuration change messages. This interrupts the looping restart process of applications that do not support landscape mode but support forced landscape mode, preventing continuous flickering of the application interface and improving the user experience.
[0096] The following section will introduce the method for handling configuration changes provided in the embodiments of this application, using specific application scenarios as examples.
[0097] In one exemplary application scenario, some applications are not natively compatible with landscape mode, meaning they do not support landscape display. However, users typically use electronic devices in landscape mode, such as large-screen devices. Therefore, users can configure these applications to support forced landscape mode as needed, so that the system can force the applications to display in landscape mode based on the user's settings.
[0098] Taking a tablet computer as an example, please refer to... Figure 3 and Figure 4 , Figure 3 and Figure 4 This is a schematic diagram illustrating a process for setting an application to support forced landscape mode, as provided in an embodiment of this application. Figure 3 As shown in Figure (a), the tablet displays a user interface that includes an icon for the settings application, and may also include icons for other applications. The user can click the settings application icon, and in response to the user's action, the tablet displays... Figure 3The settings interface is shown in Figure (b). This interface includes a settings options area on the left and a content area on the right. The settings options area includes various settings such as WLAN, Bluetooth, mobile network, smart connectivity, large screen features, desktop and personalization, display, and brightness. The content area displays the settings corresponding to the selected options in the settings options area. Figure 3 As shown in Figure (b), if a user clicks the "Large Screen Features" option in the settings selection area on the left, the content area on the right will display the settings corresponding to the large screen features in response to the user's action. Based on these settings, the user can configure specific applications to support forced landscape mode. For example... Figure 3 As shown in Figure (b), the settings corresponding to the large-screen special features can include displaying prompts and options for multiple applications. The prompt could be something like, "When an application is in landscape mode, some interfaces do not support landscape display and will still be displayed in portrait mode. Enabling 'Force Application Landscape' will force these interfaces to enter landscape mode and allow you to change the display ratio. Due to the lack of layout adaptation for the applications, issues such as abnormal interface display may occur." The options for multiple applications can include options for applications A, B, C, and D.
[0099] Suppose a user clicks an option in application A, such as clicking the arrow following application A. In response to the user's click action, such as... Figure 4 As shown in Figure (a), a forced landscape setting window will pop up in the content area. This forced landscape setting window includes options such as maintaining portrait display, displaying portrait aspect ratio in landscape mode, 4:3 landscape mode, and full-screen landscape mode. By clicking on the options such as displaying portrait aspect ratio in landscape mode, 4:3 landscape mode, or full-screen landscape mode, users can set the corresponding application to support forced landscape mode and set the landscape aspect ratio to the corresponding ratio. For example, by clicking the full-screen landscape mode option, application A will be set to support forced landscape mode and will be displayed in full-screen mode when forced into landscape mode. In addition, as... Figure 4 As shown in Figure (b), after the settings are completed, a prompt message “Landscape Fullscreen” can be displayed near the options of application A to indicate that application A has been set to support forced landscape and landscape fullscreen display.
[0100] It should be understood that Figure 3 and Figure 4 This example illustrates how a user can configure a specific application to support forced landscape mode. In other implementations, the device can also configure certain applications to support forced landscape mode. For instance, the device may have a whitelist configured at the factory, containing application identifiers for one or more applications. Applications on the whitelist are configured to support forced landscape mode. Of course, other methods can also be used to configure specific applications to support forced landscape mode, and this embodiment does not limit this approach.
[0101] For applications that do not support landscape mode, in one scenario, all application interfaces of the application do not support landscape mode; in another scenario, some application interfaces of the application do not support forced landscape mode, that is, some application interfaces support landscape mode while others do not. For ease of explanation, the application interfaces that do not support landscape mode in this application embodiment are referred to as abnormal interfaces.
[0102] When users use electronic devices in landscape mode, for applications that do not support landscape display but are configured to support forced landscape mode, the application interface may repeatedly restart or flicker when the user opens the abnormal interface of such an application (i.e., the application interface that does not support landscape display), which affects the user experience.
[0103] Please refer to Figure 5 and Figure 6 , Figure 5 and Figure 6 This diagram illustrates a process where an abnormal interface flickers when an electronic device is in landscape mode. When the electronic device is in landscape mode, it can display something like... Figure 4 The user interface shown in Figure (a) includes icons for application A and other applications. Assuming application A is a video application, the user can access application A's profile interface by clicking its icon, as shown below. Figure 5 As shown in Figure (b), this user center interface supports landscape mode. The interface includes a chat list containing information on multiple contacts, such as Xiaohong and Xiaolü. If the user clicks on Xiaohong in the chat list, the chat interface with Xiaohong will be launched in response to the user's action, as shown in Figure (b). Figure 5 As shown in Figure (c). If this chat interface does not support landscape mode, but application A supports forced landscape mode, the chat interface may repeatedly restart upon first entry. During this restart process, the interface may flicker; please refer to [reference needed]. Figure 6 During the restart process, the screen goes black first and then displays the new screen. As a result, during the repeated restarts of the chat interface, the screen will continuously exhibit a black screen followed by a new screen (e.g., black screen - new screen - black screen - new screen), causing the screen to flicker constantly.
[0104] It should be understood that Figure 6 This example illustrates the interface flickering pattern where the screen goes black before displaying a new screen during the interface restart process. In other embodiments, other interface flickering patterns may occur during the interface restart process, such as status bar flickering or flickering of parts of the interface. This application does not limit the interface flickering pattern.
[0105] Next, we will analyze the reasons for the application interface repeatedly restarting and constantly flickering when opening the abnormal interface, with reference to the attached diagram.
[0106] Please refer to Figure 7 , Figure 7 This is a logical diagram illustrating a loop restart process of an application interface provided in an embodiment of this application. This embodiment uses the example of a user opening the interface of a first application that does not support landscape display when using an electronic device in landscape mode. Figure 7 As shown, electronic devices include applications and systems (operating systems). The cyclic restart process of the application interface includes the following steps:
[0107] A1: When the electronic device is in landscape mode, the user performs the operation of opening the first application interface.
[0108] The first application interface is one that does not support landscape display. The first application interface can be the main interface of the first application, or it can be any other interface; this embodiment does not limit this. Opening the first application interface can also be considered launching the first application interface.
[0109] In one embodiment, a user can click the icon of the first application to open the first application interface. For example, the first application interface is the main interface of the first application.
[0110] In another embodiment, when the first application has been launched, the user can open the first application interface through other application interfaces of the first application. For example, the user can click on the relevant control used to trigger the first application interface in other application interfaces of the first application to open the first application interface.
[0111] A2: In response to the user's operation, the first application sends a first startup request to the system. The first startup request is used to request the startup of the first application interface in portrait orientation.
[0112] In response to the user's operation of opening the first application interface, the first application may send a first launch request to the system to request the launch of the first application interface in portrait orientation, even if the current electronic device is in landscape mode but the first application interface does not support landscape display.
[0113] A3: After receiving the first launch request, the system determines whether the first application supports forced landscape mode.
[0114] A4: If the first application supports forced landscape mode, the system will adjust the boundary information of the first application's interface to the boundary information of the landscape orientation interface.
[0115] If the first application supports forced landscape mode, the system can ignore the portrait orientation requested by the first application and then change the boundary of the first application interface from the portrait orientation boundary to the landscape orientation boundary to create the first application interface in landscape mode.
[0116] A5: After adjusting the boundary of the first application interface to the boundary of the landscape orientation interface, the first application interface enters the active (resume) state.
[0117] After adjusting the boundaries, the first application interface can be activated, meaning the electronic device can display the first application interface in landscape orientation on the display screen.
[0118] The activation state of the first application interface indicates that it is visible and interactive. The activation state is an important stage in the lifecycle of the Activity corresponding to the first application interface, and is one of the most active states in the Activity lifecycle. When an Activity is in the activation state, it means that the Activity is visible, in the foreground, and has user input focus, and can receive user input and interact with the user.
[0119] A6: After adjusting the boundary of the first application interface to the boundary of the landscape orientation interface, a system configuration change is triggered.
[0120] System configuration changes typically include changes to screen orientation, language settings, shading / light mode, keyboard availability, etc. Since changing the boundary information from portrait to landscape orientation indicates a change in screen orientation, which is a type of system configuration change, altering the boundary information will trigger system configuration changes, such as by sending a configuration change message.
[0121] In other words, after adjusting the boundary, on the one hand, the system configuration can be changed, and on the other hand, the corresponding application interface can be activated. These two can occur in parallel or one after the other in a very short time. This application does not limit this.
[0122] A7: The system sends a configuration change message to the first application.
[0123] For configuration change messages triggered by the system, the system will usually dispatch the configuration change message to the application so that the application can respond to the configuration change message, such as rebuilding the first application interface based on the changed system configuration.
[0124] As an example, after the first application starts, it will typically register a callback function with the system to listen for changes in system configuration. Therefore, when the system configuration changes, the system will automatically call the callback function and send a configuration change message to the first application in order to notify the first application that the system configuration has changed.
[0125] After receiving the configuration change message, the first application will resend the first startup request to the system to restart the first application interface. That is, after receiving the configuration change message, the first application will repeat the above process, that is, re-execute steps A2-A7, thereby restarting the first application interface. This process is repeated in a loop, and the first application interface will restart cyclically, which will cause the application interface to continuously flicker.
[0126] A8: After step A3 above, if the first application does not support forced landscape mode, then the interface of the first application in portrait mode will be displayed.
[0127] According to the above Figure 7 As can be seen, in the system's processing logic, when the system configuration changes, the system will automatically send a configuration change message to the application so that the application can respond to and adapt to the changed system configuration. However, in the case where the first application does not support landscape display but supports forced landscape mode, the configuration change message sent to the application will cause the application interface to continuously restart, resulting in a flickering screen.
[0128] To address the aforementioned issues, this application provides a method for handling configuration changes. When an electronic device is in landscape mode, if a system configuration change is detected during the operation of a first application, the method can exit the operation of sending a configuration change message to the first application if preset conditions are met: the current application interface of the first application is active, the first application requests a portrait-oriented application interface, and the first application supports forced landscape mode. This prevents the dispatch of configuration change messages to the first application. When a system configuration change is detected, if the current application interface of the first application is active, the first application requests to launch a portrait-oriented application interface, and the first application supports forced landscape mode, it indicates that the current application interface is displayed in the foreground, and while the current application does not support landscape display, it does support forced landscape mode. In this case, by exiting the operation of sending configuration change messages to the first application, the configuration change message is not dispatched to the first application, preventing the first application from restarting its application interface based on the configuration change message. This interrupts the cyclic restart process of the first application's application interface, prevents continuous flickering of the application interface, and improves the user experience.
[0129] In addition, if a system configuration change is detected during the operation of the first application, and if preset conditions are not met, such as the first application's current application interface not being active, and / or the first application requesting a landscape orientation application interface, and / or the first application not supporting forced landscape orientation, the system can also send a configuration change message to the first application, preventing the first application from restarting the application interface based on the configuration change message.
[0130] Next, the method for handling configuration changes provided in this application will be illustrated with reference to the accompanying drawings.
[0131] Please refer to Figure 8 , Figure 8 This is a logical diagram illustrating a configuration change processing method provided in an embodiment of this application. The embodiment uses the example of a system configuration change triggered after the user opens the application interface of a first application while the user is using the electronic device in landscape mode. Figure 8 As shown, the electronic device includes applications and systems, and the method includes the following steps:
[0132] B1: When the electronic device is in landscape mode, the user performs the operation of opening the first application interface of the first application.
[0133] The first application interface can be the main interface of the first application or other interfaces; this application embodiment does not limit this.
[0134] In one embodiment, a user can click the icon of the first application to open the first application interface. For example, the first application interface is the main interface of the first application.
[0135] In another embodiment, when the first application has been launched, the user can open the first application interface through other application interfaces of the first application. For example, the user can click on the relevant control used to trigger the first application interface in other application interfaces of the first application to open the first application interface.
[0136] B2: In response to the user's operation, the first application sends a first startup request to the system. The first startup request is used to request the startup of the first application interface in portrait orientation.
[0137] In response to the user's operation of opening the first application interface, the first application may send a first launch request to the system to request the launch of the first application interface in portrait orientation, even if the current electronic device is in landscape mode but the first application interface does not support landscape display.
[0138] In response to a user opening the first application interface, the first application can first determine the current screen state of the electronic device (landscape or portrait) and whether the first application interface to be launched supports landscape display. If the current electronic device is in landscape mode and the first application interface does not support landscape display, it sends a first launch request to the system to request the launch of the portrait-oriented first application interface. Alternatively, if the current electronic device is in landscape mode and the first application interface supports landscape display, it can also send a second launch request to the system to request the landscape-oriented first application interface.
[0139] As an example, the operation of the first application sending the first launch request to the system may include: the first application first calling the relevant system interface to launch the interface, and then sending an orientation setting request to the system. This orientation setting request carries portrait orientation information to request that the launched interface be set to portrait orientation. The relevant interface can be the startActivity method, etc.
[0140] B3: After receiving the first launch request, the system determines whether the first application supports forced landscape mode.
[0141] The system can first parse the relevant configuration information of the first application and determine whether the first application supports forced landscape mode based on this configuration information. The relevant configuration information indicates whether the first application is configured to support forced landscape mode. For example, the relevant configuration information can be a specific whitelist, which includes the identifiers of one or more applications. Applications in this specific whitelist are configured to support forced landscape mode.
[0142] B4: If the first application supports forced landscape mode, the system will adjust the boundary information of the first application's interface to the boundary information of the landscape orientation interface.
[0143] If the first application supports forced landscape mode, the system can ignore the portrait orientation requested by the first application and adjust the boundary of the first application interface from the portrait orientation boundary to the landscape orientation boundary to create the first application interface in landscape mode.
[0144] B5: The first application interface enters the active state.
[0145] After adjusting the boundaries, the first application interface can enter an active state, meaning it is visible and interactive. The electronic device can then display the first application interface in landscape orientation on the screen.
[0146] B6: The system triggers a system configuration change after adjusting the boundary of the first application interface to the boundary information of the landscape orientation interface.
[0147] System configuration changes typically include changes to screen orientation, language settings, décor, keyboard availability, etc. Since changing the screen orientation from portrait to landscape indicates a change in screen orientation, which is a type of system configuration change, such changes will trigger system configuration changes, for example, by sending a configuration change message.
[0148] In other words, after adjusting the boundary, on the one hand, the system configuration can be changed, and on the other hand, the corresponding application interface can be activated. These two can occur in parallel or one after the other in a very short time. This application does not limit this.
[0149] B7: The system determines whether the first application meets the preset conditions. The preset conditions include that the application interface of the first application is active, the first application requests to launch the application interface in portrait mode, and the first application supports forced landscape mode.
[0150] In this embodiment of the application, after the system configuration changes, the system will not directly send a configuration change message to the first application. Instead, it can first determine whether the first application meets the preset conditions, such as whether the current application interface of the first application is active, whether the first application requests to start the application interface in portrait orientation, and whether the first application supports forced landscape orientation. Then, it will determine whether to send a configuration change message to the first application based on the judgment result.
[0151] B8: If the first application meets the preset conditions, then execution will end.
[0152] In other words, if the first application meets the preset conditions, the system will exit the operation of sending configuration change messages to the first application, so that subsequent steps will no longer be executed, and thus no configuration change messages will be sent to the first application.
[0153] If the first application's current interface is active, the first application requests to launch its portrait-oriented interface, and the first application does not support forced landscape mode, it means the current application interface is displayed in the foreground, the current application does not support landscape display but supports forced landscape mode. In this case, sending a configuration change message to the application may cause the application to repeatedly restart its interface based on the configuration change message. By exiting the operation of sending configuration change messages to the application (i.e., not sending configuration change messages), the application cannot restart its interface based on the configuration change message, thus interrupting the application's repeated restart process, preventing continuous flickering of the application interface, and improving the user experience.
[0154] B9: If the first application does not meet the preset conditions, the system sends a configuration change message to the first application.
[0155] In other words, if the first application does not meet the preset conditions, the system can still send a configuration change message to the first application normally. After receiving the configuration change message, the first application can respond to it, such as by restarting the first application interface.
[0156] As an example, after the first application starts, it can register a callback function with the system to listen for changes in system configuration. When the system configuration changes and the first application meets the preset conditions, the system can call the callback function to send a configuration change message to the first application, so as to notify the first application of the system configuration change.
[0157] For example, the callback function could be the onConfigurationChanged method, etc.
[0158] The conditions that are not met may include one or more of the following: the application interface of the first application is not in an active state; the first application requests to launch the application interface in landscape mode; the first application does not support forced landscape mode, etc.
[0159] Next, we will provide examples of several scenarios where the preset conditions are not met.
[0160] Scenario 1: A system configuration change occurs when the first application does not support landscape mode and does not support forced landscape mode.
[0161] For example, if the first application does not support landscape mode and does not support forced landscape mode, system configuration changes may be triggered during the startup process of the first application's interface while the electronic device is in landscape mode.
[0162] As an example scenario, when the electronic device is in landscape mode, the user launches the first application interface of a first application. In response to the user's action, if the first application interface does not support landscape display, the first application initiates a first launch request to request the launch of the first application interface in portrait mode. In response to the first launch request, if the first application does not support forced landscape mode, the first application interface in portrait mode is displayed. An instruction to change system configuration is received, the system configuration is changed according to the instruction, and a system configuration change message is triggered.
[0163] The instruction to change system configuration is used to instruct the electronic device to change its system configuration, such as changing screen orientation, language, light / dark mode (mode switching between dark and light modes), keyboard availability, etc. The instruction to change 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, etc., and this application embodiment does not limit this.
[0164] Scenario 2: When the first application supports landscape mode, a system configuration change occurs.
[0165] For example, if the first application supports landscape mode and the electronic device is in landscape mode, system configuration changes are triggered during the startup of the first application's interface.
[0166] As an example scenario, when the electronic device is in landscape mode, the user launches the first application interface of the first application. In response to the user's operation, if the first application interface supports landscape display, the first application initiates a second launch request to request the launch of the first application interface in landscape mode; in response to the second launch request, the first application interface in landscape mode is displayed; an instruction to change the system configuration is received; the system configuration is changed according to the instruction, and a configuration change message is triggered.
[0167] Scenario 3: A system configuration change occurs when the application interface of the first application is not inactive.
[0168] For example, when the application interface of the first application is not in an active state, a command to change the system configuration is received; the system configuration is changed according to the command, and a configuration change message is triggered.
[0169] In the above scenarios, since the first application does not meet the preset conditions, the system can normally send configuration change messages to the first application when system configuration changes occur.
[0170] It should be noted that the embodiments of this application are merely examples of scenarios that do not meet the preset conditions. It should be understood that the above-mentioned scenarios do not constitute a limitation on scenarios that do not meet the preset conditions. Scenarios that do not meet the preset conditions may also include other scenarios, which are not limited in this application embodiment.
[0171] B10: After step B3 above, if the first application does not support forced landscape mode, then the interface of the first application in portrait mode will be displayed.
[0172] As an example, the pseudocode for key steps (such as steps B7-B9) in the embodiments of this application can be as follows:
[0173] If (the current application is active && the current application requests portrait orientation && the current application supports forced landscape orientation) {
[0174] Return (exit operation);
[0175] }else{
[0176] Dispatch configuration change message
[0177] }
[0178] In one embodiment, the preset conditions may further include one or more of the following conditions: the display mode of the first application interface is full-screen display; the number of times the first application interface triggers the activation state within a certain period of time reaches a first preset number; the number of times the first application interface changes its boundaries within a certain period of time reaches a second preset number.
[0179] The duration can be a pre-configured duration, and the first and second preset number of times can also be preset, such as 2 or 3 times.
[0180] By adding a condition that the first application interface's display mode is set to full-screen, the accuracy of predicting the current scenario as a continuously flickering scenario can be improved. By setting a condition that the first application interface triggers an activation state a certain number of times within a certain time period reaches a first preset number, the dispatch of configuration change messages to the application can be prohibited when the first application interface frequently triggers an activation state, thus improving the accuracy of predicting the current scenario as a continuously flickering scenario. By adding a condition that the first application interface changes its boundaries a certain number of times within a certain time period reaches a second preset number, the dispatch of configuration change messages to the application can be prohibited when the first application interface frequently modifies its boundaries, further improving the accuracy of predicting the current scenario as a continuously flickering scenario.
[0181] Next, in conjunction with the appendix Figure 2 The software framework shown provides a detailed description of the method for handling configuration changes involved in the embodiments of this application.
[0182] Please refer to Figure 9 , Figure 9 This is a flowchart illustrating another method for handling configuration changes provided in this application embodiment. This method is applied to an electronic device, which includes a first application, an Activity Management System (AMS), and a Web Management System (WMS). The AMS includes an Activity, a first activity record module, and a second activity record module. This application embodiment uses the system's native activity record as the first activity record module and the extended Honor Activity Record module as the second activity record module for illustration. Figure 9 As shown, the method includes the following steps:
[0183] Step 901: When the electronic device is in landscape mode, the user performs the operation of opening the first application interface of the first application.
[0184] Step 902: In response to the user's action, the first application calls the startActivity function to start the Activity.
[0185] Activities are used to create or manage application interfaces and handle user interactions. An application interface is the window through which the user interacts with the application, consisting of views and layouts within an Activity. An Activity can be viewed as a container, while the interface is the content within that container. The Activity is responsible for creating and managing the container, while the interface populates the container's content. Therefore, in response to a user opening the first application interface, the first application needs to launch an Activity to create or manage that interface.
[0186] The first application can call the relevant interface of AWM to start the Activity. In this embodiment of the application, the startActivity function is used as an example for illustration.
[0187] Step 903: If the first application does not support landscape display, the first application sends an orientation setting request to the Activity. This orientation setting request carries a portrait orientation identifier to request the portrait orientation.
[0188] As an example, an application can call the relevant AMS interface to send a direction setting request, such as the setRguestOrientation (set the direction of the request) function.
[0189] Step 904: The Activity sends the orientation setting request to the activity record.
[0190] In other words, the Activity forwards the direction setting request to the activity record.
[0191] Step 905: After receiving the orientation setting request, the activity record parses the first configuration information of the first application. The first configuration information is used to indicate whether the first application supports forced landscape mode.
[0192] As an example, the activity record can call the `resolveOverrideConfiguration` function to parse the first configuration information.
[0193] Step 906: The activity record determines whether the first application supports forced landscape mode based on the first configuration information, and obtains the determination result.
[0194] Step 907: The activity record sends the judgment result to the honor activity record.
[0195] Step 908: If the judgment result indicates that the first application does not support forced landscape mode, the honor activity record modifies the boundary information to the boundary information of the landscape orientation interface.
[0196] As an example, the honor activity record can modify the boundary information of the first application interface to the boundary information of the landscape orientation interface during the setup process. For example, the boundary information can be modified to the landscape orientation interface boundary information by using the apply appdisplay rect (application display rectangle) function.
[0197] Step 909: The honor activity record sends a boundary setting request to the WMS, which carries the boundary information of the landscape orientation interface.
[0198] Step 910: WMS sets the boundary based on the boundary setting request.
[0199] WMS can set the landscape orientation of the interface based on the setting boundary request, thereby displaying the first application interface in landscape orientation. In this way, the first application interface can enter the active state, that is, the Activity corresponding to the first application interface enters the active state.
[0200] Step 911: WMS sends a response message to the honor activity record.
[0201] Upon receiving the boundary setting request or after setting the boundary, WMS can return a response message to the honor activity record. Simultaneously, WMS can also send configuration change messages to the Activity.
[0202] That is, step 911 and step 914 below can be executed in parallel, or they can be executed sequentially in a very short time. This application embodiment does not limit this.
[0203] After receiving the response message, the honor activity record can perform some preparatory work for the correct configuration of the Activity, such as executing steps 912-913 below.
[0204] In step 912, after the honor activity record receives the response message, it calls the EnsureActivityConfiguration method.
[0205] By calling the EnsureActivityConfiguration method, you can ensure that the Activity's configuration is set correctly or that the correct functions or methods are applied, thus ensuring that the Activity is configured correctly.
[0206] Step 913: The honor activity record calls the RelaunchActivityLocked method (restart the activity lock).
[0207] RelaunchActivityLocked is used to relaunch (or restart) an existing Activity under certain conditions.
[0208] Step 914: WMS sends a configuration change message to the Activity.
[0209] As an example, WMS can send a configuration change message to an Activity by calling the Activity's onConfigurationChanged method.
[0210] The `onConfigurationChanged` method is a callback function. After an Activity starts, the Activity can register a callback function with WMS to listen for changes in system configuration. When WMS detects a change in system configuration, it can call this callback function to send a configuration change message to the Activity.
[0211] Step 915: After receiving the configuration change message, the Activity determines whether the first application meets the preset conditions.
[0212] The preset conditions include whether the current Activity corresponding to the first application is active, whether the first application requests a portrait orientation application interface, and whether the first application supports forced landscape orientation.
[0213] Step 916: If the judgment result is yes, then the Activity ends execution.
[0214] Step 917: If the judgment result is negative, the Activity sends a configuration change message to the first application.
[0215] As an example, an Activity can send a configuration change message to the first application by calling the onConfigurationChanged method.
[0216] After receiving the configuration change message, the first application can respond to the configuration change message. For example, it can return to step 902 and restart the Activity according to the changed system configuration, so that the electronic device can repeat the above steps 903-915.
[0217] This application also provides a chip coupled to a memory, which is used to read and execute computer programs or instructions stored in the memory to perform the methods in the above embodiments.
[0218] This application also provides an electronic device including a chip for reading and executing computer programs or instructions stored in a memory, causing the methods in the various embodiments to be performed.
[0219] This embodiment 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 aforementioned method steps to implement the video processing method described above.
[0220] This embodiment also provides a computer program product. The computer-readable storage medium stores program code. When the computer program product is run on a computer, it causes the computer to perform the above-mentioned related steps to implement the video processing method in the above embodiment.
[0221] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component, or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the video processing methods in the above-described method embodiments.
[0222] In this embodiment, the electronic device, computer-readable storage medium, computer program product or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0223] This application does not specifically limit the structure of the execution subject of the method provided in this application embodiment. As long as a program containing the code of the method provided in this application embodiment can be run to perform video processing according to the method provided in this application embodiment, it is acceptable. For example, the execution subject of the method provided in this application embodiment can be an electronic device, or a functional module in an electronic device that can call and execute a program.
[0224] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0225] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0226] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0227] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium and includes several instructions that cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0228] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the 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 landscape state, in response to a user starting an operation of a first application interface of the first application, in a case where the first application interface does not support landscape display but the first application has been configured to support forced landscape, displaying the first application interface in a landscape direction, and triggering a first configuration change message for indicating that the interface boundary of the first application interface changes; Quitting the operation of sending the first configuration change message to the first application.
2. The method of claim 1, wherein, The operation of displaying the first application interface in a landscape direction in a case where the first application interface does not support landscape display but the first application has been configured to support forced landscape in response to a user starting an operation of a first application interface of the first application comprises: In a case where the first application interface does not support landscape display, the first application initiates a first start request for requesting to start the first application interface in a portrait direction in response to a user starting an operation of a first application interface of the first application; In a case where the first application has been configured to support forced landscape, adjusting the boundary corresponding to the first application interface to the boundary of the interface in a landscape direction to display the first application interface in a landscape direction, and triggering the first configuration change message in response to the first start request.
3. The method of claim 1 or 2, wherein, The operation of quitting the operation of sending the first configuration change message to the first application comprises: In a case where the first application meets a preset condition, quitting the operation of sending the first configuration change message to the first application; The preset condition comprises that the application interface of the first application is in an active state, the first application requests to start the application interface in a portrait direction, and the first application has been configured to support forced landscape.
4. The method of claim 3, wherein, The preset condition further comprises 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 of triggering the active state of the first application interface reaches a first preset number within a certain time length; The number of times of changing the boundary of the first application interface reaches a second preset number within a certain time length.
5. The method according to any one of claims 1 to 4, characterized in that, The method further comprises: In a case where the first application interface does not support landscape display and the first application does not support forced landscape, displaying the first application interface in a portrait direction in response to a user starting an operation of the first application interface of the first application.
6. The method of claim 5, wherein, The operation of displaying the first application interface in a portrait direction in a case where the first application interface does not support landscape display and the first application does not support forced landscape in response to a user starting an operation of the first application interface of the first application comprises: In a case where the first application interface does not support landscape display, the first application initiates a first start request for requesting to start the first application interface in a portrait direction in response to a user starting an operation of the first application interface of the first application; In response to the first start request, the first application interface in the portrait direction is displayed when the first application does not support forced landscape.
7. The method of any one of claims 1-4, wherein, The method further includes: In response to a user starting the first application interface of the first application, the first application interface in the landscape direction is displayed when the first application interface supports landscape display.
8. The method of claim 7, wherein, The response to the user starting the first application interface of the first application, the first application interface in the landscape direction is displayed when the first application interface supports landscape display, includes: In response to a user starting the first application interface of the first application, the first application initiates a second start request when the first application interface supports landscape display, the second start request being used to request starting the first application interface in the landscape direction; In response to the second start request, the first application interface in the landscape direction is displayed.
9. The method of any one of claims 1-8, wherein, The method further includes: In response to a system configuration change occurring during running of the first application, a second configuration change message is sent to the first application when the first application does not meet a preset condition, the second configuration change message being used to indicate the system configuration change, the preset condition including that the application interface of the first application is in an active state, the first application requests starting an application interface in the portrait direction, and the first application has been configured to support forced landscape; The first application initiates a third start request according to the second configuration change message, the third start request being used to request restarting an application interface.
10. The method of claim 9, wherein, Before the second configuration change message is sent to the first application when 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, the first application interface in the landscape direction is displayed when the first application interface supports landscape display; An instruction to change a system configuration is received; The system configuration is changed according to the instruction, and the second configuration change message is triggered.
11. The method of claim 9, wherein, Before the second configuration change message is sent to the first application when 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, the first application interface in the portrait direction is displayed when the first application interface does not support landscape display and the first application does not support forced landscape; An instruction to change a system configuration is received; The system configuration is changed according to the instruction, and the second configuration change message is triggered.
12. The method of claim 8, wherein, Before the second configuration change message is sent to the first application when the first application does not meet the preset condition, the method further includes: When the application interface of the first application is not in an active state, an instruction to change a system configuration is received; The system configuration is changed according to the instruction, and the second configuration change message is triggered.
13. An electronic device, comprising: The electronic device includes one or more processors, and a memory; The memory is coupled with the one or more processors, and is configured to store computer program codes including computer instructions, which are invoked by the one or more processors to cause the electronic device to perform the method according to any one of claims 1-12.
14. A chip system, characterized by The chip system is applied to an electronic device, and the chip system includes one or more processors configured to invoke computer instructions to cause the electronic device to perform the method according to any one of claims 1-12.
15. 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 according to any one of claims 1-12.