CN116860420B - Event processing method, readable storage medium, and electronic device - Google Patents

Event processing method, readable storage medium, and electronic device Download PDF

Info

Publication number
CN116860420B
CN116860420B CN202311134459.6A CN202311134459A CN116860420B CN 116860420 B CN116860420 B CN 116860420B CN 202311134459 A CN202311134459 A CN 202311134459A CN 116860420 B CN116860420 B CN 116860420B
Authority
CN
China
Prior art keywords
input event
thread
priority
event
electronic device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311134459.6A
Other languages
Chinese (zh)
Other versions
CN116860420A (en
Inventor
王洪烛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202311134459.6A priority Critical patent/CN116860420B/en
Publication of CN116860420A publication Critical patent/CN116860420A/en
Application granted granted Critical
Publication of CN116860420B publication Critical patent/CN116860420B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application relates to the technical field of terminals and discloses an event processing method, a readable storage medium and electronic equipment. The electronic device may establish a first thread independent of the main thread of the system service process to run the input event filtering module when the auxiliary service function is turned on, wherein the first thread has a priority higher than that of the main thread of the system service process. According to the method, the priority of the first thread is higher than that of the main thread in the system service process, and even if other high-priority tasks are operated in the system service process, the input event filtering module in the first thread can be operated in preference to the system service process, so that the influence of the high-priority tasks in the system service process on the filtering tasks is avoided, and the situation that the response of the electronic equipment to the input event is too high in delay is avoided.

Description

Event processing method, readable storage medium, and electronic device
Technical Field
The present application relates to the field of terminal technologies, and in particular, to an event processing method, a readable storage medium, and an electronic device.
Background
The auxiliary service function is a service provided by the operating system of the electronic device, by which a developer can create custom barrier-free functions to help a visually, hearing or physically impaired user to better use the device and applications. In the case where the auxiliary service function is turned on, the application in the electronic device may respond differently or not respond to a partial input event. Therefore, in the case that the auxiliary service function is turned on, after the electronic device detects the input event, the input event may be filtered by running an input event filtering module (for example, inputfilter) in the main thread of the service process of the system, so as to filter the input event that the application program does not need to respond, and distribute the filtered input event to the corresponding application program.
That is, the processing of the input event by the electronic device after the auxiliary service is turned on adds a process of filtering the input event between reading the input event and distributing the input event, as compared to when the auxiliary service function is not turned on. For example, referring to fig. 1A, when the auxiliary service is not started, an input event reading module (e.g. inputprocess) in an operating system of the electronic device reads an input event at time t01 and then directly transmits the input event to an input event distributing module (e.g. inputstispatcher) in the operating system of the electronic device to distribute the input event. Referring to fig. 1B, in the case of the auxiliary service being turned on, after the input event reading module finishes reading the input event before the time t02, the input event filtering module running in the main thread of the system service process needs to filter the input event during the period from the time t02 to the time t03, and then the input event distributing module distributes the filtered input event to the corresponding application program after the time t 03.
Because the priority of the input event filtering module is too low, the tasks that need to be processed by the main thread of the system service process are usually more. Under the condition that other tasks with higher priority are in the main thread of the system service process, the main thread of the system service process can firstly execute the tasks with higher priority and then operate the input event filtering module, so that the filtering of the input event is delayed, and delay and blocking occur in the receiving and responding of the input event of the application program.
Disclosure of Invention
In view of this, the present application provides an event processing method, a readable storage medium, and an electronic device.
In a first aspect, the present application provides an event processing method, applied to an electronic device, where the method includes:
detecting that an auxiliary service function of the electronic equipment is started, and establishing a first thread, wherein the first thread is independent of a main thread of system service of the electronic equipment, and the processing priority of the first thread is higher than that of the main thread of the system service; the first input event is detected, and filtering processing is performed on the first input event based on the first thread.
In this method, since the first thread (e.g., a HandlerThread thread hereinafter) is independent of and has a higher priority than the main thread of the system service process of the electronic device, the operation of the first thread is not affected even if the main thread of the system service process is operated with other high-priority tasks. Thus, the first thread can timely filter the first input event, and delay of the electronic equipment responding to the first input event is reduced.
In one possible implementation of the first aspect, the first thread is a thread in a first process or a thread in a second process corresponding to a system service.
In a possible implementation of the first aspect, the operating system of the electronic device includes an input event filtering module; and, filtering the first input event based on the first thread, including: and operating an input event filtering module through a first thread to filter the first input event.
Alternatively, in some implementations, the input event filtering module may be an inputfilter.
In a possible implementation manner of the first aspect, the filtering the first input event based on the first thread includes: the processing priority of the first thread is increased from the first priority to the second priority corresponding to the first input event being a press down event.
That is, the electronic device may further increase the priority of the first thread when the first input event is a press down event, so as to further reduce the delay of the electronic device responding to the first input event.
In a possible implementation of the first aspect, the method further includes: and detecting a second input event, and restoring the processing priority of the first thread from the second priority to the first priority, wherein the second input event is a lifting event.
That is, the electronic device may restore the processing priority of the first thread from the second priority to the first priority upon detection of the lift-off event. In this way, it may be avoided that the first thread runs with a higher priority for a long time affecting other threads or processes.
In a possible implementation manner of the first aspect, the filtering processing of the first input event based on the first thread further includes: and improving the priority of the first input event message corresponding to the first input event.
That is, the electronic device may further increase the priority of the first INPUT EVENT message (e.g., the msg_input_event message hereinafter) corresponding to the first INPUT EVENT to further reduce the delay of the electronic device responding to the first INPUT EVENT.
In one possible implementation manner of the first aspect, the increasing the priority of the first input event message corresponding to the first input event includes: a synchronization barrier is set in a message queue of an operating system of the electronic device and the first incoming event message is set as an asynchronous message.
In a possible implementation manner of the first aspect, the filtering processing of the first input event based on the first thread further includes: after the first input event message processing is completed, the synchronization barrier in the message queue of the operating system of the electronic device is removed.
That is, after the first input event message processing is completed, the electronic device may remove the synchronization barrier in the message queue of the operating system of the electronic device to avoid affecting the delivery of other messages.
In a possible implementation of the first aspect, the method further includes: and detecting that the auxiliary service function is closed, and exiting the first thread.
In a second aspect, the present application provides a readable storage medium having stored therein instructions that, when executed by an electronic device, cause the electronic device to implement the first aspect and any one of the possible implementations of the first aspect.
In a third aspect, the present application provides an electronic device, comprising: a memory for storing instructions; and a processor, configured to execute instructions to cause the electronic device to implement the first aspect and any possible implementation of the first aspect.
In a fourth aspect, the present application provides a program product which, when run on an electronic device, causes the electronic device to implement the first aspect described above and any one of the possible implementations of the first aspect described above to provide an event processing method.
It should be appreciated that the advantages of the second aspect to the fourth aspect may refer to the advantages of the first aspect, and are not described herein.
Drawings
FIG. 1A illustrates a timing diagram of an electronic device reading and distributing input events with an auxiliary service function turned off, according to some embodiments of the present application;
FIG. 1B illustrates a timing diagram of an electronic device reading and distributing input events with an auxiliary service function turned on, according to some embodiments of the present application;
FIG. 2A illustrates a timing diagram of an electronic device delaying a response to an input event with an auxiliary service function turned on, according to some embodiments of the present application;
FIG. 2B illustrates a timing diagram of an electronic device delaying a response to an input event with another auxiliary service function turned on, according to some embodiments of the present application;
FIG. 3 illustrates a timing diagram of an electronic device running an input event filtering module through a HandlerThread thread independent of a system service main thread, according to some embodiments of the present application;
FIG. 4 illustrates a flow diagram of an event processing method, according to some embodiments of the present application;
FIG. 5 illustrates an interface diagram relating to auxiliary service functions displayed by an electronic device, according to some embodiments of the present application;
FIG. 6 illustrates a software architecture diagram of an electronic device 10, according to some embodiments of the present application;
FIG. 7 illustrates a process diagram of an event processing method, according to some embodiments of the present application;
FIG. 8 illustrates a process schematic of another event processing method, according to some embodiments of the present application;
FIG. 9 illustrates a flow diagram for an input event filtering module to manage the establishment and exit of a HandlerThread thread, according to some embodiments of the present application;
FIG. 10 illustrates a flow diagram for adjusting the priority of a HandlerThread thread, according to some embodiments of the present application;
FIG. 11 illustrates a flow diagram of a process of adjusting the priority of incoming event messages, according to some embodiments of the present application;
FIG. 12 illustrates a timing diagram for an electronic device to establish and exit a HandlerThread thread, according to some embodiments of the present application;
FIG. 13 illustrates a timing diagram for adjusting the priority of a HandlerThread thread and an incoming event message, according to some embodiments of the present application;
Fig. 14 illustrates a schematic structural diagram of an electronic device 10, according to some embodiments of the present application.
Detailed Description
Illustrative embodiments of the present application include, but are not limited to, event processing methods, readable storage media, and electronic devices.
The technical scheme of the application is described below with reference to the accompanying drawings. As mentioned above, the input event filtering module has too low priority, and the main thread of the system service process needs to process more tasks. Under the condition that other tasks with higher priority are in the main thread of the system service process, the main thread of the system service process can firstly execute the tasks with higher priority and then operate the input event filtering module, so that the filtering of the input event is delayed, and delay and blocking occur in the receiving and responding of the input event of the application program.
For example, FIG. 2A shows a timing diagram of an electronic device reading, filtering, and distributing input events.
As shown in fig. 2A, the process of the electronic device reading, filtering and distributing input events includes the following stages:
before time t11, the input event reading module reads the input event.
When there are a plurality of tasks (hereinafter referred to as high-priority tasks) having higher priorities than the input event filtering module from time t11 to time t13, the main thread of the system_server process (as a system service process) runs the input event filtering module to filter the input event after the high-priority tasks are run.
Wherein, the main thread of the system_server process runs a plurality of high priority tasks from time T11 to time T12, the time used is T1, t1=250ms is available from fig. 2A; the input event filtering module filters the input events from the time t12 to the time t13 and transmits the filtered events to the input event distribution module.
After time t13, the input event distribution module distributes the filtered input event.
As such, the input event has a 250ms delay from reading to distribution, resulting in the electronic device being stuck in response to the input event.
For another example, FIG. 2B shows a timing diagram of another electronic device reading, filtering, and distributing input events.
As shown in fig. 2B, the process of the electronic device reading, filtering and distributing input events includes the following stages:
before time t14, the input event reading module reads the input event.
And from the time t14 to the time t16, under the condition that a certain high-priority task exists, the main thread of the system_server process runs the input event filtering module to filter the input event after the high-priority task is run.
The main thread of the system_server process runs a certain high-priority task from time T14 to time T15, and the time used is T2, and t2=300 ms is obtained from fig. 2B; the input event filtering module filters the input events from the time t15 to the time t16 and transmits the filtered events to the input event distribution module.
After time t16, the input event distribution module distributes the filtered input event.
As such, the input event has a 250ms delay from reading to distribution, resulting in the electronic device being stuck in response to the input event.
In order to solve the problem of delay of input event response caused by too low priority of an input event filtering module under the condition that an auxiliary service function is started, the embodiment of the application provides an event processing method. In the case where the auxiliary service function is on, the electronic device may establish a first thread independent of the main thread of the system service process to run the input event filtering module, where the first thread has a higher priority than the main thread of the system service process.
According to the method, the priority of the first thread is higher than that of the main thread in the system service process, and even if other high-priority tasks are operated in the system service process, the input event filtering module in the first thread can be operated in preference to the system service process, so that the influence of the high-priority tasks in the system service process on the filtering tasks is avoided, and the situation that the response of the electronic equipment to the input event is too high in delay is avoided.
It should be appreciated that in some embodiments, the first thread may run in a system service process or may be a thread in a process other than the system service process. For convenience of description, the technical solution of the present application is described below by taking a system service process as a system_server process and a first thread as a thread running in the system_server process as an example.
For example, FIG. 3 shows a timing diagram of an electronic device reading, filtering, and distributing input events.
As shown in fig. 3, the process of the electronic device reading, filtering and distributing input events includes the following stages:
before time t20, the input event is read by the input event reading module.
the input event filtering module in the HandlerThread thread filters the input event from the time t20 to the time t21, and transmits the filtered event to the input event distribution module.
After time t21, the input event distribution module distributes the filtered input event.
In the whole process of reading, filtering and distributing the input events by the electronic equipment, the main thread of the system_server process can run other high-priority tasks in parallel, so that the influence of the high-priority tasks in the main thread of the system_server process on the filtering tasks is avoided.
Optionally, in some embodiments, the electronic device may also adjust the priority of the INPUT EVENT message (e.g., msg_input_event message) in the message queue for communicating the INPUT EVENT so that the operating system of the electronic device may prioritize the INPUT EVENT message. In this way, the delay of the electronic device in responding to an input event may be reduced. For example, the electronic device may increase the priority of the msg_input_event by setting the msg_input_event message to an asynchronous (asynchronous) message in a message queue and opening a synchronization barrier (sync barrier).
It should be appreciated that in the case of a synchronization barrier being opened, the operating system of the electronic device will preferentially process asynchronous messages, and thus after setting the msg_input_event message to an asynchronous message, the priority of the electronic device to distribute and process the msg_input_event message will be increased, and the duration of msg_input_event message delivery will be shortened.
For another example, the electronic device may increase the efficiency of the electronic device processing the msg_input_event message by setting a separate priority for each message task in the message queue and setting the msg_input_event message to the highest priority.
In some embodiments, the electronic device may further increase or restore the priority of the handlemthread thread according to the type of msg_input_event message, so as to further shorten the time for the electronic device to process the INPUT EVENT.
For example, the electronic device may raise the priority of the handler thread to be higher than the original priority when creating the handler thread when the INPUT EVENT corresponding to the msg_input_event message is a press EVENT; restoring the HandlerThread thread priority to the original priority when the input event is a lift event.
For example, the electronic device may adjust the handlethread thread scheduling policy to a first-in-first-out scheduling policy (sched_fifo) when the INPUT EVENT corresponding to the msg_input_event message is a press-down EVENT.
It should be appreciated that tasks with priority sched_fifo run once they occupy the CPU until higher priority tasks arrive or are discarded by themselves.
The technical solution of the present application is described below in connection with the situation shown in fig. 3.
Fig. 4 illustrates a flow diagram of an event processing method, according to some embodiments of the present application. The main body of the execution of the process is an electronic device, as shown in fig. 4, and the process includes the following steps:
s401, under the condition that an auxiliary service function is started, a HandlerThread thread for running an input event filtering module is established.
For example, referring to fig. 5, the electronic device may display the auxiliary function interface U0 shown in fig. 5 after the user selects the auxiliary function option in the setup application, where the auxiliary function interface U0 includes a selection related to the auxiliary function in the electronic device, such as the unobstructed option U01. When the user selects the unobstructed option U01 in the auxiliary function interface U0, the electronic device may display an unobstructed interface U02, where the unobstructed interface U02 includes options related to the unobstructed, such as a screen reading option U03, a touch adjustment option U04, and so on.
When the user selects any at least one of the options in the barrier-free interface U02 (e.g., turn on the screen read option U03 and/or the touch adjustment option U04), the electronic device may determine that the auxiliary service function is turned on, and establish a handler thread independent of the system_server process main thread to run the input event filtering module.
It should be appreciated that the priority of the HandlerThread thread may be a first priority that is higher than the priority of the main thread in the system_server process.
S402, detecting a pressing event, and increasing the priority of a HandlerThread thread and/or increasing the priority of an input event message.
For example, the electronic device may increase the HandlerThread thread priority and/or increase the priority of incoming event messages when a push event is detected.
For example, in the case shown in fig. 3, when the INPUT EVENT reading module detects that the INPUT EVENT corresponding to the msg_input_event message is a press EVENT before the time t20, the electronic device may increase the priority of the handlemthread thread to a second priority higher than the first priority, and/or increase the priority of the INPUT EVENT message.
In some embodiments, the electronic device may increase the priority of the HandlerThread thread by a function or instruction defined by an operating system or processor of the electronic device for adjusting the priority of the thread.
In some embodiments, the electronic device may increase the priority of the incoming EVENT message by setting the msg_input_event message to an asynchronous message and opening a synchronous barrier, or by setting a separate priority for each message task in the message queue and setting the msg_input_event message to the highest priority.
It should be appreciated that in some embodiments, the HandlerThread thread priority and/or the priority of the incoming event message may be increased by the incoming event reading module or the incoming event filtering module or the auxiliary service upon detection of a push event. In other embodiments, the priority of the HandlerThread thread and/or the priority of the incoming event message may be increased by other threads, processes, or services upon detection of a push event, without limitation.
It should be appreciated that in other embodiments, the electronic device may also increase the priority of the HandlerThread thread and the priority of the incoming event message in other ways, without limitation.
S403, filtering the input event message by using the input event filtering module in the HandlerThread thread.
The electronic device may filter the INPUT EVENT message by using the INPUT EVENT filtering module after the INPUT EVENT reading module transmits the msg_input_event message corresponding to the INPUT EVENT filtering module in the handlersthread thread.
For example, for the scenario shown in fig. 3, the electronic device filters the incoming event message using the incoming event filtering module in the HandlerThread from time t20 to time t21, for example, to determine if the incoming event needs to be processed by the application. If the input event information has the event meeting the filtering condition, the event information is transmitted to the input event distribution module, and if the event information does not have the event information, the event information is not transmitted to the input event distribution module.
S404, the event filtered by the input event filtering module is distributed to the corresponding application program by utilizing the input event distribution module.
For example, after the input event distribution module receives the filtered event transmitted by the input event filtering module, the electronic device may distribute the event filtered by the input event filtering module to the corresponding application program by using the input event distribution module.
For example, referring to FIG. 3, after time t21, the input event distribution module distributes the filtered events.
S405, detecting a lifting event, and recovering the priority of the HandlerThread thread and/or the priority of the input event.
The electronic device may resume the HandlerThread thread priority and/or the incoming event message when the incoming event reading module reads a lift event.
For example, in the case shown in fig. 3, when the INPUT EVENT reading module detects that the INPUT EVENT corresponding to the msg_input_event message is a lift EVENT before the time t20, the electronic device may restore the priority of the handlemthread thread to the first priority and/or restore the priority of the INPUT EVENT message.
In some embodiments, the electronic device may restore the priority of the HandlerThread thread through a function predefined by the operating system or processor of the electronic device.
In some embodiments, the electronic device may restore the priority of the incoming EVENT message by removing the synchronization barrier in the message queue, or canceling the high priority of the msg_input_event message.
It should be appreciated that in some embodiments, the HandlerThread thread priority may be restored and/or the high priority of the input event may be cancelled by the input event reading module or the input event filtering module or the auxiliary service upon detection of a lift event. In other embodiments, the priority of the HandlerThread thread may be restored and/or the high priority of the input event may be canceled by other threads, processes, or services upon detection of a lift event, without limitation.
S406, detecting that the auxiliary service function is closed, and exiting the HandlerThread thread.
For example, for the interface shown in fig. 5, when the user closes all the options that have been opened in the barrier-free interface U02, the electronic device may determine that the auxiliary service function is closed, exiting the HandlerThread.
By the event processing method provided by the embodiment of the application, the problem of too high input response delay of the electronic equipment under the condition that the auxiliary service function is started can be avoided.
The technical scheme of the application is described below in conjunction with the software architecture of the electronic device.
Fig. 6 illustrates a software architecture diagram of an electronic device, according to some embodiments of the present application.
As shown in fig. 6, the software architecture includes an application layer, an application framework layer, a system library, a kernel layer, and a hardware layer.
The application packages may include telephone, information, calendar, gallery, etc. applications.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in fig. 6, the application framework layer may include a Window Manager (WM), a Content Provider (CP), a telephony manager (telephony manager, TM), a Resource Manager (RM), a View System (VS), an input management service (inputmanager service, IMS), a system service (system_server), an auxiliary service, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The telephony manager is for providing communication functions of the electronic device. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The IMS comprises the input event reading module, the input event filtering module and the input event distributing module, and is responsible for the service of input event management corresponding to the external input equipment.
In some embodiments, the input event filtering module may further filter the input event read by the input event reading module if the electronic device turns on the auxiliary service function.
In some embodiments, the input event filtering module may be further configured to increase the priority of the HandlerThread thread when the received input event is a push event, or to restore the priority line of the HandlerThread when the received input event is a lift event.
In some embodiments, the input event filtering module may also be used to increase/restore priority of the input event messages.
The system_server process is an important process in the operating system of the electronic device in which the main services reside (e.g., window management service (window manager server, WMS), activity management service (activitymanager service, AMS), etc.).
The auxiliary service is used to provide unobstructed user interaction functionality to disabled users or users who are temporarily unable to interact completely with the device. Such as interactive functions of screen reading, text-to-speech, etc.
In some embodiments, the auxiliary service may be further configured to, when the auxiliary service function is started, operate the input event filtering module by using a handlemthread thread after the input event is read by the input event reading module of the electronic device, where the handlemthread thread has a higher priority than the main thread in the system_server process. Therefore, the interference of the complex environment of the main thread in the system_server process can be avoided, the priority of the filtering task of the input event filtering module is improved, and the input response delay is reduced.
For example, referring to fig. 7, when an input event task is detected in the input event reading module thread under the condition of starting the auxiliary service function, an input event filtering module in the HandlerThread thread is triggered to filter the input event preferentially, and the filtered event is handed over to the input event distributing module thread.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), three-dimensional graphics library (e.g., openGL ES), 2D graphics engine (e.g., SGL).
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The SurfaceFlinger is used for managing and rendering graphic displays of application programs in the Android system.
The kernel layer is a layer between hardware and software. Including display driving, etc.
The hardware layer contains the basic hardware facilities of the electronic device, such as a display screen.
It should be appreciated that in some embodiments, other modules may also be included in the kernel layer, such as camera drivers, audio drivers, sensor drivers, etc., without limitation.
It should be understood that the software architecture shown in fig. 6 is only an example, and in other embodiments, the software architecture suitable for the source device and/or the destination device may be other architectures, which are not limited herein.
The technical scheme of the present application is described below with reference to the software architecture schematic diagram shown in fig. 6.
Fig. 8 illustrates a process diagram of an event processing method, according to some embodiments of the present application.
After detecting that the user starts the auxiliary service function, for example, after the user starts at least one application program related to the auxiliary service function at will, and under the condition that the scheme characteristic switch is started, the input event filtering module management in the auxiliary service function can establish a HandlerThread thread for running the input event filtering module. In the EVENT that a press EVENT or a lift EVENT is detected and the scheme feature switch is on, the INPUT EVENT filtering module in the HandlerThread thread may adjust the priority of the HandlerThread thread by the thread priority control module, the priority of the INPUT EVENT message (e.g., MSG_INPUT_EVENT message) by the message priority control module.
It should be understood that the above scheme feature switch is a switch that a developer sets when setting a related program for an electronic device. When the scheme characteristic switch is in an on state, the electronic device can implement the event processing method provided by the embodiment of the application.
The following describes the technical solution of the present application in connection with the procedure shown in fig. 8 and fig. 9 to 11.
First, an input event filtering module in the auxiliary service is introduced to manage the process of establishing and exiting the HandlerThread thread.
FIG. 9 illustrates a flow diagram for an input event filtering module to manage the establishment and exit of a HandlerThread thread, according to some embodiments of the present application. The execution subject of the flow is the input event filtering module management, as shown in fig. 9, and the flow includes the following steps:
s901: the auxiliary service function is detected to be turned on.
Illustratively, the input event filtering module management may proceed to step S902 in the event that the auxiliary function is detected to be turned on. The manner in which the input event filtering module manages and detects that the auxiliary service function is turned on may refer to the aforementioned step S401, which is not described herein.
S902: and judging whether the scheme is started or not.
Illustratively, the input event filtering module manages determining whether the scheme is on if the auxiliary function is detected to be on. If the scheme is on, it indicates that the HandlerThread thread needs to be managed (e.g., set up or exited), and the process goes to step S903; otherwise, the flow is ended.
In some embodiments, the input event filtering module management may determine that the scheme is on when the aforementioned scheme feature switch is on, and go to step S903.
It should be understood that the scheme opening means that a developer of the electronic device sets an instruction of the event processing method provided by the embodiment of the application in the electronic device, and enables the instruction to be invoked by a related module to implement the event processing method provided by each embodiment of the application.
In some embodiments, the step S903 may be directly performed without determining whether the scheme is started, which is not limited herein.
S903: a handlersthread thread is established for running the input event filtering module.
The input event filtering module manages establishing a HandlerThread thread for running the input event filtering module if the auxiliary service function is detected to be on and the scheme is detected to be on.
It should be appreciated that the HandlerThread thread corresponds to a first priority that is higher than the priority of the main thread of the system service.
S904: the auxiliary service function is detected to be turned off.
Illustratively, the input event filtering module management may proceed to step S905 in the event that the auxiliary function is detected to be turned off. The manner in which the input event filtering module manages and detects that the auxiliary service function is turned off can refer to the aforementioned step S406, which is not described herein.
S905: and judging whether the scheme is started or not.
Illustratively, the input event filtering module manages determining whether the scheme is on if the auxiliary function is detected to be off. If the scheme is on, it indicates that the HandlerThread thread needs to be managed (e.g., set up or exited), and the process goes to step S906; otherwise, the flow is ended.
S906: the HandlerThread thread for running the input event filtering module is exited.
The input event filtering module manages exiting the HandlerThread thread for running the input event filtering module if the auxiliary service function is detected to be off and the scheme is on.
Then, a thread priority control module in the input event filter module is introduced to adjust the priority process of the HandlerThread thread.
FIG. 10 illustrates a flow diagram for adjusting the priority of a HandlerThread thread, according to some embodiments of the present application. The execution subject of the flow is a thread priority control module, as shown in fig. 10, and the flow includes the following steps:
s1001: a press down event is detected.
Illustratively, the thread priority control module may detect a press event when the aforementioned input event reading module reads the press event, and proceeds to step S1002.
S1002: and judging whether the scheme is started or not.
Illustratively, the thread priority control module determines whether the scheme is on. If the scheme is started, the priority of the HandlerThread thread needs to be adjusted, and the process goes to step S1003; otherwise, the flow is ended.
In some embodiments, the thread priority control module may determine that the scheme is on when the scheme characteristics switch is on, and go to step 1003.
It should be understood that the scheme opening means that a developer of the electronic device sets an instruction of the event processing method provided by the embodiment of the application in the electronic device, and enables the instruction to be invoked by a related module to implement the event processing method provided by each embodiment of the application.
In some embodiments, the step S1003 may be directly performed without determining whether the scheme is started, which is not limited herein.
S1003: the priority of the HandlerThread thread is increased.
For example, the thread priority control module may increase the HandlerThread thread from a first priority to a second priority if a press event is detected. In this manner, the delay in the response of the electronic device to an input event may be reduced by increasing the priority of the HandlerThread thread.
S1004: a lift-off event is detected.
Illustratively, the thread priority control module may detect a lift event when the aforementioned input event reading module reads the lift event, and proceeds to step S1005.
S1005: and judging whether the scheme is started or not.
The thread priority control module judges whether the scheme is started or not. If the scheme is started, the priority of the HandlerThread thread needs to be adjusted, and the step S1006 is performed; otherwise, the flow is ended.
In some embodiments, step S1006 may be directly performed without determining whether the scheme is started, which is not limited herein.
S1006: the priority of the HandlerThread thread is restored.
For example, the thread priority control module may restore the HandlerThread thread from the second priority to the first priority if a lift event is detected. In this way, the influence of the too high priority of the HandlerThread thread on the operation of other tasks can be avoided.
Next, a process in which the message priority control module in the input event filtering module adjusts the priority of the input event message is described.
Fig. 11 illustrates a flow diagram of a process of adjusting the priority of incoming event messages, according to some embodiments of the present application. The execution body of the flow is a message priority control module, as shown in fig. 11, and the flow includes the following steps:
s1101: an input event is detected.
The message priority control module detects an input event, for example, receives an input event sent by the input event reading module, and triggers adjustment of the priority of the input event message.
S1102: and judging whether the scheme is started or not.
After the message priority control module detects an input event, judging whether the scheme is started or not. If the scheme is started, the priority of the input event message needs to be adjusted, and the step is transferred to step S1103; otherwise, the flow is ended.
In some embodiments, the message priority control module may determine that the scheme is on when the scheme feature switch is on, and go to step 1103.
In some embodiments, the step S1103 may be directly executed without determining whether the scheme is started, which is not limited herein.
S1103: a synchronization barrier is provided.
The message priority control module sets a synchronization barrier in the message queue in the event that an input event is detected and the scheme is open.
S1104: an asynchronous incoming event message is delivered.
After the message priority control module sets the synchronous barrier in the message queue, the input event message can be set as an asynchronous message, and the input event message with asynchronous type is transmitted to other modules.
In some embodiments, step S1103 and step S1104 may also be performed synchronously, which is not limited herein.
S1105: the input event filtering module is preferentially operated.
It should be appreciated that after setting the synchronization barrier in the message queue and setting the incoming event message as an asynchronous message, the incoming event filtering module may be preferentially operated such that the delay of the electronic device responding to the incoming event message is reduced.
S1106: the synchronization barrier is removed at the end of the task.
And the message priority control module removes the synchronous barrier after the task corresponding to the input event message is finished. In this way, it is possible to avoid affecting the delivery of other messages.
Next, the technical solution of the present application will be described with reference to the foregoing embodiments shown in fig. 5 to 11.
FIG. 12 illustrates a timing diagram for an electronic device to establish and exit a HandlerThread thread, according to some embodiments of the present application.
As shown in fig. 12, the process of the electronic device establishing and exiting the HandlerThread thread includes the steps of:
s1201: the auxiliary service detects that the auxiliary service function is turned on.
For example, referring to fig. 5, when the user selects the barrier-free option U01 at the auxiliary function interface U0, the electronic device may display the barrier-free interface U02. When the auxiliary service detects that the user opens at least one option in the barrier-free interface U02 interface, for example, when the user opens the screen reading option U03, the auxiliary service function is detected to be opened, and the method provided by the embodiment of the application is triggered.
It should be appreciated that in other embodiments, the auxiliary service may detect that the auxiliary service function is turned on in other ways, which is not limited herein.
S1202: the auxiliary service process establishes and starts the HandlerThread thread.
After the auxiliary service function is turned on, the auxiliary service may set up a HandlerThread thread independent of the system_server process main thread and start the HandlerThread through a star () function.
It should be appreciated that the first priority corresponding to the HandlerThread thread may be a higher priority than the system_Server process main thread.
S1203: the auxiliary service obtains the message loop queue of the HandlerThread thread.
Illustratively, after the HandlerThread thread is started, the auxiliary service may obtain the Looper object corresponding to the HandlerThread thread through the getLooper () function.
It should be appreciated that each thread in the electronic device has and only has a unique one corresponding Looper, where the Looper may be used to send a new incoming event message to a corresponding target (target) as the new incoming event message is received by the loop-through message queue.
It should be appreciated that, in other embodiments, the electronic device may also obtain the Looper corresponding to the HandlerThread through other functions or other manners, which is not limited herein.
S1204: the auxiliary service maintains a message circular queue for the HandlerThread thread.
After servicing the message circulation queue of the HandlerThread thread, the acquired message circulation queue may be saved.
S1205: the auxiliary service establishes an unobstructed input event filtering module.
Illustratively, the auxiliary service may build an unobstructed input event filter module (accessibilitiyinputfilter) through a new function.
It should be appreciated that the barrier-free input event filtering module is a component inherited from the input event filtering module (InputFilter) for filtering input events
S1206: the auxiliary service passes the message loop queue of the HandlerThread thread to the barrier-free input event filtering module.
After the auxiliary service establishes the barrier-free input event filtering module, the cyclic message queue (e.g. looper object) stored in the step S1204 may be transferred to the barrier-free input event filtering module, so that the barrier-free input event filtering module may implement a corresponding function based on the cyclic message queue.
S1207: the auxiliary service invokes the input event filtering module.
Illustratively, since the unobstructed input event filtering module is a sub-class of the input event filtering module, the auxiliary service may call the input event filtering module through the super () function.
S1208: the auxiliary service passes the message cycle queue in the unobstructed input event filtering module to the input event filtering module.
The auxiliary service may pass the message cycle queue in the unobstructed input event filter module to the input event filter module after invoking the input event filter module.
S1209: an auxiliary service setup message processor.
Illustratively, the auxiliary service may build a message processor (handler) through a new handler () function to process the messages in the aforementioned message circular queue.
It should be appreciated that after the auxiliary service establishes the message processor, the HandlerThread thread may run the input event filtering module to filter the input events.
It should be understood that the establishment of the HandlerThread thread shown in the above steps S1201 to S1209 is just one example. In other embodiments, the HandlerThread thread for running the input event filtering module may be established in other ways supported by the operating system of the electronic device, as not limited herein.
S1210: the auxiliary service detects that the auxiliary service function is turned off.
Illustratively, referring to FIG. 5, when the user closes all of the opened options in the unobstructed interface U02, the auxiliary service may detect that the auxiliary service function is closed.
S1211: the auxiliary service exits the HandlerThread thread.
Upon detecting that the auxiliary service function is turned off, the auxiliary service may exit the HandlerThread thread.
Illustratively, in some embodiments, the auxiliary service may exit the HandlerThread thread through a quick () function.
The following describes a solution for adjusting the priority of the HandlerThread thread and the incoming event message.
FIG. 13 illustrates a timing diagram for adjusting the priority of a HandlerThread thread and an incoming event message, according to some embodiments of the present application.
As shown in fig. 13, the process of the electronic device adjusting the priority of the handlersthread thread and the input event message may include the steps of:
s1301: the input event filtering module receives an input event message.
Illustratively, referring to FIG. 3, the input event reading module reads the input event before time t20 and passes the read input event to the input event filtering module, at which point the input event filtering module may receive the input event message.
S1302: the input event filtering module obtains an input event.
The input event filtering module may obtain the input event after receiving the input event message. For example, in some embodiments, the input event filtering module may obtain input events through a getAction () function.
S1303: the input event filtering module determines the input event type as a press event or a lift event.
Illustratively, the input event filtering module may determine whether the type of the input event is a press event (action_down) or a lift event (action_up) from the event code acquired by the getAction () function.
S1304: the input event filtering module adjusts the priority of the HandlerThread thread according to the type of the input event.
In some embodiments, the input event filtering module may increase the priority of the HandlerThread thread from a first priority to a second priority in the event that the received input event is a push event. In this way, the processing time of the input event message can be shortened.
In some embodiments, in the event that the received input event is a lift event, the input event filtering module may revert to the first priority with the priority of the HandlerThread thread.
For example, in some embodiments, the input event filtering module may adjust the priority of the HandlerThread thread by an electronic device defined function (e.g., setThreadScheduler function) that sets the priority of the thread.
S1305: the input event filtering module sets a synchronization barrier in the message queue in case the type of the input event is a press event.
For example, in the event that the received input event is a press down event, the input event filtering module may ensure preferential processing of the input event message by setting a synchronization barrier in the message queue.
For example, the input event filtering module may set a synchronization barrier in the message queue through a postsyncb carrier () function. After setting the synchronization barrier, the message queue prioritizes asynchronous messages.
It should be understood that the manner of setting the synchronization barrier is not particularly limited, so long as it is ensured that the barrier message is issued.
S1306: the input event filtering module sets the input event message to an asynchronous message.
Illustratively, after setting the synchronization barrier in the message queue, the input event filtering module may set the input event message to an asynchronous message through the function setasynchroous (), to ensure the priority of the input event message.
It should be appreciated that after inserting a synchronization barrier in the message queue and setting the incoming event message asynchronous, the HandlerThread thread will ignore other synchronous messages when traversing the message queue, prioritizing the incoming event message.
It should be appreciated that in some embodiments, step S1305 and step S1306 may be performed simultaneously, without limitation.
S1307: the input event filtering module acquires the input event message in the message queue and sends the input event message to the target.
After the input event filtering module obtains the input event message in the message queue, the input event message may be sent to a target (e.g., an input event distribution module).
S1308: the input event filtering module determines that the processing of the input event message is complete.
For example, the input event filtering module may filter the received input event message, and if the filtering condition is met, send the input event to the target (e.g., the input event distribution module), otherwise, do not process. The input event filtering module may complete processing of the input event message when the input event is sent to a target or it is determined that the input event is not to be processed.
It should be understood that, for the filtering conditions of the input event filtering module described above, the filtering conditions may be changed according to application conditions with different application targets, and in the embodiments provided in this application, the input event meeting the filtering conditions refers to an input event that the application needs to respond to, and the filtering conditions of the input event filtering module in other embodiments are not specifically limited herein.
S1309: the input event filtering module removes the synchronization barrier in the message queue.
Illustratively, after the input event message processing is complete, the input event filtering module may remove the synchronization barrier in the message queue through a removeSyncBArrier () function.
It will be appreciated that after the synchronization barrier is removed, the message queue will resume processing synchronous messages, at which time asynchronous messages are no longer preferentially processed, and the Looper corresponding to the handlethread thread will process all messages in the message queue in sequence in the order in which the respective messages entered the message queue. In this way, it is possible to avoid affecting the processing of other messages.
Further, the embodiment of the present application provides an electronic device 10 for implementing the event processing method provided in the foregoing embodiments.
In particular, fig. 14 illustrates a schematic structural diagram of an electronic device 10, according to some embodiments of the present application.
As shown in fig. 14, the electronic device 10 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a user identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration 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, and the like.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digitalsignal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may invoke and execute the event processing method corresponding instructions provided in the embodiments of the present application and stored in the memory, so as to implement the event processing method provided in the embodiments of the present application. For example, the process 110 may be used to execute instructions to establish/exit a first thread for running an input event filter module, to execute instructions to raise/restore a first thread priority, to execute instructions to raise/restore an input event message priority, and so on.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 10, or may be used to transfer data between the electronic device 10 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices.
The charge management module 140 is configured to receive a charge input from a charger. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like.
The wireless communication function of the electronic device 10 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc. applied to the electronic device 10. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (globalnavigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication (near field communication, NFC), infrared (IR), etc., as applied on the electronic device 10. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emittingdiode), a flexible light-emitting diode (FLED), a mini-LED, a micro-OLED, a quantum dot light-emitting diode (quantumdot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 10 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 10 implements display functions via a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The camera 193 is used to capture still images or video.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 10. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code that includes instructions. The internal memory 121 may include a program memory area and a data memory area. The program storage area may store an operating system, application programs required for at least one function, and the like. The data storage area may store data created during use of the electronic device 10, etc. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 executes various functional applications of the electronic device 10 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor 110.
The electronic device 10 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals.
The earphone interface 170D is used to connect a wired earphone.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 10 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 10.
The motor 191 may generate a vibration cue.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card.
It is to be understood that the structure of the electronic device 10 illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 10. In other embodiments of the present application, the electronic device 10 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
It should be understood that the configuration of the electronic device 10 shown in fig. 14 is merely an example, and in other embodiments, the electronic device 10 may include more or fewer modules, and may incorporate or split portions of the modules, which are not limited herein.
It should be appreciated that electronic device 10 may be any electronic device that includes auxiliary service functionality, including, but not limited to
Embodiments of the mechanisms disclosed herein may be implemented in hardware, software, firmware, or a combination of these implementations. Embodiments of the present application may be implemented as a computer program or program code or program product that is executed on a programmable system including at least one processor, a storage system (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device.
Program code may be applied to input instructions to perform the functions described herein and generate output information. The output information may be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor, a microcontroller, an application specific integrated circuit, or a microprocessor.
The program code may be implemented in a high level procedural or object oriented programming language to communicate with a processing system. Program code may also be implemented in assembly or machine language, if desired. Indeed, the mechanisms described in the present application are not limited in scope to any particular programming language. In either case, the language may be a compiled or interpreted language.
In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed over a network or through other computer-readable storage media. Thus, a machine-readable storage medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including but not limited to floppy diskettes, optical disks, magneto-optical disks, random access memories, erasable programmable read-only memories, electrically erasable programmable read-only memories, magnetic or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signal digital signals, etc.) using the internet in an electrical, optical, acoustical or other form of propagated signal. Thus, a machine-readable storage medium includes any type of machine-readable storage medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).
In the drawings, some structural, module, or method features may be shown in a particular arrangement and/or order. However, it should be understood that such a particular arrangement and/or ordering may not be required. Rather, in some embodiments, these features may be arranged in a different manner and/or order than shown in the illustrative figures. Additionally, the inclusion of structural or methodological features in a particular figure is not meant to imply that such features are required in all embodiments, and in some embodiments, may not be included or may be combined with other features.
It should be noted that in the examples and descriptions of this patent, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Furthermore, the term "comprises/comprising" means that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
While the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.

Claims (9)

1. An event processing method applied to an electronic device, comprising the following steps:
detecting that an auxiliary service function of the electronic equipment is started, and establishing a first thread by the auxiliary service of the electronic equipment, wherein the first thread is independent of a main thread of system service of the electronic equipment, and the processing priority of the first thread is higher than that of the main thread of the system service;
the auxiliary service establishes an input event filtering module;
and detecting a first input event, wherein the first thread runs the input event filtering module, and filtering the first input event.
2. The method of claim 1, wherein the first thread runs the input event filtering module to filter the first input event, comprising:
and the processing priority of the first thread is increased from the first priority to the second priority corresponding to the first input event being a pressing event.
3. The method according to claim 2, wherein the method further comprises:
and detecting a second input event, and recovering the processing priority of the first thread from the second priority to the first priority, wherein the second input event is a lifting event.
4. A method according to any one of claims 1 to 3, wherein the first thread runs the input event filtering module to filter the first input event, further comprising:
and improving the priority of the first input event message corresponding to the first input event.
5. The method of claim 4, wherein the increasing the priority of the first input event message corresponding to the first input event comprises:
setting a synchronization barrier in a message queue of an operating system of the electronic device and setting the first input event message as an asynchronous message.
6. The method of claim 5, wherein the first thread runs the input event filtering module to filter the first input event, further comprising:
after the first input event message processing is completed, removing a synchronization barrier in a message queue of an operating system of the electronic device.
7. The method according to claim 1, wherein the method further comprises:
and detecting that the auxiliary service function is closed, and exiting the first thread.
8. A readable storage medium having stored therein instructions that, when executed by an electronic device, cause the electronic device to implement the event processing method of any of claims 1 to 7.
9. An electronic device, comprising:
a memory for storing instructions;
a processor for executing the instructions to cause the electronic device to implement the event processing method of any of claims 1 to 7.
CN202311134459.6A 2023-09-05 2023-09-05 Event processing method, readable storage medium, and electronic device Active CN116860420B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311134459.6A CN116860420B (en) 2023-09-05 2023-09-05 Event processing method, readable storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311134459.6A CN116860420B (en) 2023-09-05 2023-09-05 Event processing method, readable storage medium, and electronic device

Publications (2)

Publication Number Publication Date
CN116860420A CN116860420A (en) 2023-10-10
CN116860420B true CN116860420B (en) 2024-03-01

Family

ID=88222053

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311134459.6A Active CN116860420B (en) 2023-09-05 2023-09-05 Event processing method, readable storage medium, and electronic device

Country Status (1)

Country Link
CN (1) CN116860420B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2347405A1 (en) * 1998-09-25 2000-04-06 William Martin Snelgrove Connection manager for telecommunications
CN106886721A (en) * 2016-10-08 2017-06-23 阿里巴巴集团控股有限公司 A kind of method and device for realizing miscellaneous function in the application
CN107273130A (en) * 2017-06-20 2017-10-20 深圳市万普拉斯科技有限公司 Method, device and the terminal for accelerating interface to draw
CN109710338A (en) * 2018-12-24 2019-05-03 努比亚技术有限公司 A kind of searching method of mobile terminal, mobile terminal and storage medium
CN110496395A (en) * 2019-08-22 2019-11-26 阿里巴巴集团控股有限公司 It is a kind of for the assembly operating method of illusory engine, system and equipment
CN110989888A (en) * 2019-12-13 2020-04-10 广州华多网络科技有限公司 Touch event distribution method and device
CN111443957A (en) * 2020-03-24 2020-07-24 华为技术有限公司 Application stuck processing method and device and electronic equipment
CN112306297A (en) * 2020-10-30 2021-02-02 浪潮金融信息技术有限公司 Method for realizing low delay of handwriting input of conference whiteboard
CN115016713A (en) * 2021-11-30 2022-09-06 荣耀终端有限公司 Travel event subscription method and electronic equipment

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2347405A1 (en) * 1998-09-25 2000-04-06 William Martin Snelgrove Connection manager for telecommunications
CN106886721A (en) * 2016-10-08 2017-06-23 阿里巴巴集团控股有限公司 A kind of method and device for realizing miscellaneous function in the application
WO2018064938A1 (en) * 2016-10-08 2018-04-12 阿里巴巴集团控股有限公司 Method and device for realizing supporting function in application
CN107273130A (en) * 2017-06-20 2017-10-20 深圳市万普拉斯科技有限公司 Method, device and the terminal for accelerating interface to draw
CN109710338A (en) * 2018-12-24 2019-05-03 努比亚技术有限公司 A kind of searching method of mobile terminal, mobile terminal and storage medium
CN110496395A (en) * 2019-08-22 2019-11-26 阿里巴巴集团控股有限公司 It is a kind of for the assembly operating method of illusory engine, system and equipment
CN110989888A (en) * 2019-12-13 2020-04-10 广州华多网络科技有限公司 Touch event distribution method and device
CN111443957A (en) * 2020-03-24 2020-07-24 华为技术有限公司 Application stuck processing method and device and electronic equipment
CN112306297A (en) * 2020-10-30 2021-02-02 浪潮金融信息技术有限公司 Method for realizing low delay of handwriting input of conference whiteboard
CN115016713A (en) * 2021-11-30 2022-09-06 荣耀终端有限公司 Travel event subscription method and electronic equipment

Also Published As

Publication number Publication date
CN116860420A (en) 2023-10-10

Similar Documents

Publication Publication Date Title
CN110471639B (en) Display method and related device
WO2020238874A1 (en) Vr multi-screen display method and electronic device
WO2020156230A1 (en) Method for presenting video on electronic device when incoming call comes, and electronic device
CN113553130B (en) Method for executing drawing operation by application and electronic equipment
CN113168461A (en) Method for deleting security service and electronic equipment
US20240086231A1 (en) Task migration system and method
CN115039378A (en) Audio output method and terminal equipment
CN116048833B (en) Thread processing method, terminal equipment and chip system
CN114625525A (en) Resource control method and equipment
WO2022166713A1 (en) Electronic device and display method for application thereof, and medium
CN114327175B (en) Information sharing method and device
CN115941674B (en) Multi-device application connection method, device and storage medium
CN116347217B (en) Image processing method, device and storage medium
CN116860420B (en) Event processing method, readable storage medium, and electronic device
CN115017498A (en) Method for operating applet and electronic device
WO2024067169A1 (en) Information processing method and electronic device
CN117909071B (en) Image display method, electronic device, storage medium, and chip system
WO2024140560A1 (en) Control method, and device
CN114816169B (en) Desktop icon display method and device and storage medium
WO2024179249A1 (en) Electronic device display method, electronic device, and storage medium
WO2024036998A1 (en) Display method, storage medium, and electronic device
CN116737292B (en) Display mode switching method, electronic equipment and readable storage medium
CN115567666B (en) Screen recording method, electronic device and readable storage medium
CN117724825B (en) Interface display method and electronic equipment
WO2024012398A1 (en) Message sharing method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant