CN108052401B - System attribute monitoring method, terminal device and computer readable storage medium - Google Patents

System attribute monitoring method, terminal device and computer readable storage medium Download PDF

Info

Publication number
CN108052401B
CN108052401B CN201711468242.3A CN201711468242A CN108052401B CN 108052401 B CN108052401 B CN 108052401B CN 201711468242 A CN201711468242 A CN 201711468242A CN 108052401 B CN108052401 B CN 108052401B
Authority
CN
China
Prior art keywords
attribute
data
name
monitored
broadcasted
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
CN201711468242.3A
Other languages
Chinese (zh)
Other versions
CN108052401A (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.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology 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 Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN201711468242.3A priority Critical patent/CN108052401B/en
Publication of CN108052401A publication Critical patent/CN108052401A/en
Application granted granted Critical
Publication of CN108052401B publication Critical patent/CN108052401B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs

Abstract

The invention discloses a system attribute monitoring method, terminal equipment and a computer readable storage medium. According to the method, when system attribute setting is carried out on a layer C of an android system, attribute information of the system attribute is transmitted to a JAVA layer of the android system, data to be broadcasted is generated in the JAVA layer of the android system according to the attribute information, and finally the data to be broadcasted is broadcasted in the JAVA layer of the android system, so that a broadcast receiver sends the data to be broadcasted to a target application program after monitoring the data to be broadcasted, and therefore the target application program can simply and timely realize system attribute monitoring on the premise that normal operation of general system platform application is not influenced, and program performance is improved.

Description

System attribute monitoring method, terminal device and computer readable storage medium
Technical Field
The invention relates to the technical field of android system equipment, in particular to a system attribute monitoring method, terminal equipment and a computer readable storage medium.
Background
With the popularization of the Android system (namely the Android system) products at present, user experience is friendly, abundant extended applications are provided, and the open source property is the reason that the Android system is far away from other systems in the market occupancy rate of the intelligent equipment at present. However, as more applications are installed on the Android device, the coupling degree between the applications is higher and higher, especially for system applications. And most applications need to do corresponding business logic in combination with different states of certain attributes.
In Android, there is a method for system attributes, which can represent different states by setting different values for certain system attributes, and which can be used between processes. However, for some scenarios, an application needs to constantly monitor changes of a certain system attribute, but since Android does not provide such a method, most development engineers constantly query corresponding system attributes to determine whether a system attribute value to be monitored changes. Although this approach may be effective, implementation is cumbersome, and a change notification of the corresponding attribute cannot be obtained in time.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a system attribute monitoring method, terminal equipment and a computer readable storage medium, and aims to solve the technical problems that the monitoring of system attributes in the prior art is complicated to realize and a change notification of corresponding attributes cannot be obtained in time.
In order to achieve the above object, the present invention provides a system attribute monitoring method, which includes the following steps:
when system attribute setting is carried out on a layer C of an android system, transmitting attribute information of the system attribute to a JAVA layer of the android system;
generating data to be broadcasted in a JAVA layer of the android system according to the attribute information;
and broadcasting the data to be broadcasted in a JAVA layer of the android system, so that a broadcast receiver sends the data to be broadcasted to a target application program after monitoring the data to be broadcasted.
Preferably, before broadcasting the data to be broadcast in a JAVA layer of the android system so that a broadcast receiver monitors the data to be broadcast and sends the data to be broadcast to a target application, the system attribute monitoring method further includes:
receiving a registration instruction sent by a target application program to a broadcast receiver in a JAVA layer of the android system;
and the broadcast receiver monitors and registers according to the registration instruction so as to monitor the data to be broadcast.
Preferably, the attribute information includes: a target attribute name and a target attribute value;
correspondingly, the generating of the data to be broadcasted in the JAVA layer of the android system according to the attribute information specifically includes:
generating data to be broadcasted in a JAVA layer of the android system according to the target attribute name and the target attribute value, wherein the data name of the data to be broadcasted is generated according to the target attribute name, and the data content of the data to be broadcasted is the target attribute value;
correspondingly, the performing, by the broadcast receiver, a monitoring registration according to the registration instruction to monitor the data to be broadcast specifically includes:
and the broadcast receiver extracts the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, generates the name of the data to be monitored according to the attribute name to be monitored, and monitors and registers the name of the data to be monitored so as to monitor the data to be broadcast.
Preferably, the data name of the data to be broadcasted is generated according to a preset character string and the target attribute name;
correspondingly, the extracting, by the broadcast receiver, the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, generating the name of the data to be monitored according to the attribute name to be monitored, and performing monitoring registration on the name of the data to be monitored, so as to monitor the data to be broadcast, specifically including:
and the broadcast receiver extracts the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, generates a data name to be monitored according to a preset character string and the attribute name to be monitored, and monitors and registers the data name to be monitored so as to monitor the data to be broadcast.
Preferably, the data name of the data to be broadcasted is obtained by splicing a preset character string and the target attribute name;
the method includes that the broadcast receiver extracts a name of an attribute to be monitored, which is the same as the target attribute name, from the registration instruction, generates a name of data to be monitored according to a preset character string and the name of the attribute to be monitored, and monitors and registers the name of the data to be monitored so as to monitor the data to be broadcast, and specifically includes the following steps:
and the broadcast receiver extracts the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, splices a preset character string with the attribute name to be monitored to obtain the name of the data to be monitored, and monitors and registers the name of the data to be monitored so as to monitor the data to be broadcast.
Preferably, when the system attribute setting is performed on the layer C of the android system, the transmitting the attribute information of the system attribute to the JAVA layer of the android system specifically includes:
and when the system attribute is set on the layer C of the android system, transmitting the attribute information of the system attribute to the JAVA layer of the android system through a JNI mechanism.
Preferably, when the system attribute setting is performed on the layer C of the android system, the transmitting the attribute information of the system attribute to the JAVA layer of the android system through a JNI mechanism specifically includes:
and when the system attribute is set on the C layer of the android system, calling the attribute information as a parameter to a preset program segment of a JAVA layer of the android system by a preset function of the C layer of the android system through a JNI mechanism so as to transmit the attribute information of the system attribute to the JAVA layer of the android system.
Preferably, the preset program segment belongs to systemoproperties class of JAVA layer of the android system.
In addition, to achieve the above object, the present invention also provides a terminal device, including: the system comprises a memory, a processor and a system attribute monitoring program which is stored on the memory and can run on the processor, wherein the system attribute monitoring program is configured to realize the steps of the system attribute monitoring method.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium, in which a system attribute monitor is stored, and the system attribute monitor, when executed by a processor, implements the steps of the system attribute monitoring method as described above.
According to the method, when system attribute setting is carried out on a layer C of an android system, attribute information of the system attribute is transmitted to a JAVA layer of the android system, data to be broadcasted is generated in the JAVA layer of the android system according to the attribute information, and finally the data to be broadcasted is broadcasted in the JAVA layer of the android system, so that a broadcast receiver sends the data to be broadcasted to a target application program after monitoring the data to be broadcasted, and therefore the target application program can simply and timely realize system attribute monitoring on the premise that normal operation of general system platform application is not influenced, and program performance is improved.
Drawings
Fig. 1 is a schematic structural diagram of a terminal device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a system attribute monitoring method according to a first embodiment of the present invention;
fig. 3 is a flowchart illustrating a system attribute monitoring method according to a second embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a terminal device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the terminal device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
In a specific implementation, the terminal device may be a smart phone, a tablet computer, a notebook computer, or a smart television, which is not limited in this embodiment.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the terminal device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a system property listener.
In the terminal device shown in fig. 1, the network interface 1004 is mainly used for data communication with an external network; the user interface 1003 is mainly used for receiving input instructions of a user; the terminal device calls the system attribute monitor stored in the memory 1005 through the processor 1001, and performs the following operations:
when system attribute setting is carried out on a layer C of an android system, transmitting attribute information of the system attribute to a JAVA layer of the android system;
generating data to be broadcasted in a JAVA layer of the android system according to the attribute information;
and broadcasting the data to be broadcasted in a JAVA layer of the android system, so that a broadcast receiver sends the data to be broadcasted to a target application program after monitoring the data to be broadcasted.
Further, processor 1001 may call a system attribute listener stored in memory 1005, and also perform the following operations:
receiving a registration instruction sent by a target application program to a broadcast receiver in a JAVA layer of the android system;
and the broadcast receiver monitors and registers according to the registration instruction so as to monitor the data to be broadcast.
Further, the attribute information includes: a target attribute name and a target attribute value; processor 1001 may call a system attribute listener stored in memory 1005 to also perform the following operations:
generating data to be broadcasted in a JAVA layer of the android system according to the target attribute name and the target attribute value, wherein the data name of the data to be broadcasted is generated according to the target attribute name, and the data content of the data to be broadcasted is the target attribute value;
and the broadcast receiver extracts the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, generates the name of the data to be monitored according to the attribute name to be monitored, and monitors and registers the name of the data to be monitored so as to monitor the data to be broadcast.
Further, the data name of the data to be broadcasted is generated according to a preset character string and the target attribute name; processor 1001 may call a system attribute listener stored in memory 1005 to also perform the following operations:
and the broadcast receiver extracts the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, generates a data name to be monitored according to a preset character string and the attribute name to be monitored, and monitors and registers the data name to be monitored so as to monitor the data to be broadcast.
Further, the data name of the data to be broadcasted is obtained by splicing a preset character string and the target attribute name; processor 1001 may call a system attribute listener stored in memory 1005 to also perform the following operations:
and the broadcast receiver extracts the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, splices a preset character string with the attribute name to be monitored to obtain the name of the data to be monitored, and monitors and registers the name of the data to be monitored so as to monitor the data to be broadcast.
Further, processor 1001 may call a system attribute listener stored in memory 1005, and also perform the following operations:
and when the system attribute is set on the layer C of the android system, transmitting the attribute information of the system attribute to the JAVA layer of the android system through a JNI mechanism.
Further, processor 1001 may call a system attribute listener stored in memory 1005, and also perform the following operations:
and when the system attribute is set on the C layer of the android system, calling the attribute information as a parameter to a preset program segment of a JAVA layer of the android system by a preset function of the C layer of the android system through a JNI mechanism so as to transmit the attribute information of the system attribute to the JAVA layer of the android system.
According to the scheme, when the system attribute is set on the layer C of the android system, the attribute information of the system attribute is transmitted to the JAVA layer of the android system, the data to be broadcast is generated in the JAVA layer of the android system according to the attribute information, and finally the data to be broadcast is broadcast in the JAVA layer of the android system, so that the broadcast receiver sends the data to be broadcast to the target application program after monitoring the data to be broadcast, the target application program can simply and timely monitor the system attribute on the premise of not influencing the normal operation of the general system platform application, and the program performance is improved.
Based on the hardware structure, the embodiment of the system attribute monitoring method is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a system attribute monitoring method according to a first embodiment of the present invention.
In a first embodiment, the system attribute monitoring method includes the following steps:
s10: when system attribute setting is carried out on a layer C of an android system, transmitting attribute information of the system attribute to a JAVA layer of the android system;
it should be noted that, in the android system, the system attribute may be set by JAVA, C + +, C, and using a shell command, but these operations are all finally set by a send _ prop _ msg function of the C layer, where the send _ prop _ msg function is completed by sending the attribute to be set to the attribute server of the C layer using a socket, and therefore, when the system attribute is set by the send _ prop _ msg function of the C layer, the attribute information of the system attribute may be transmitted to the JAVA layer of the android system.
Since the layer C and the JAVA layer in the android system belong to different framework layers, in order to facilitate communication between the layer C and the JAVA layer, in this embodiment, the attribute information of the system attribute may be transmitted to the JAVA layer of the android system through a JAVA Native Interface (JNI) mechanism.
It is understood that the C layer may call to JAVA layer functions through a JNI mechanism, or the JAVA layer may call to C layer functions through a JNI mechanism.
In a specific implementation, in order to facilitate transmission of the attribute information of the system attribute to the JAVA layer of the android system through a JNI mechanism, in this embodiment, when the system attribute is set on the C layer of the android system, the attribute information can be called as a parameter to a preset program segment of the JAVA layer of the android system by a preset function of the C layer of the android system through the JNI mechanism, so as to transmit the attribute information of the system attribute to the JAVA layer of the android system.
In order to enable the preset program segment to perform attribute processing, in this embodiment, the preset program segment belongs to a systemoproperties class of a JAVA layer of the android system, and certainly, the preset program segment does not belong to an existing program segment in the systemoproperties class of the JAVA layer, but is established according to needs in this embodiment, and in order to facilitate identification thereof, in this embodiment, a name of the preset program segment may be set to getsystemoprocenge, so that the preset function is called conveniently.
S20: generating data to be broadcasted in a JAVA layer of the android system according to the attribute information;
it should be noted that after the attribute information is obtained, the data to be broadcasted that can reflect the attribute information can be generated.
S30: and broadcasting the data to be broadcasted in a JAVA layer of the android system, so that a broadcast receiver sends the data to be broadcasted to a target application program after monitoring the data to be broadcasted.
In a specific implementation, the target application may be one application or multiple applications, which is not limited in this embodiment.
In this embodiment, when system attribute setting is performed on the layer C of the android system, the attribute information of the system attribute is transmitted to the JAVA layer of the android system, then data to be broadcast is generated in the JAVA layer of the android system according to the attribute information, and finally the data to be broadcast is broadcast in the JAVA layer of the android system, so that a broadcast receiver sends the data to be broadcast to a target application program after monitoring the data to be broadcast, thereby simply and timely enabling the target application program to implement system attribute monitoring without affecting normal operation of a general system platform application, and improving program performance.
Further, as shown in fig. 3, a second embodiment of the system attribute monitoring method according to the present invention is provided based on the first embodiment, and in this embodiment, before step S10, the system attribute monitoring method further includes:
s01: receiving a registration instruction sent by a target application program to a broadcast receiver in a JAVA layer of the android system;
s02: and the broadcast receiver monitors and registers according to the registration instruction so as to monitor the data to be broadcast.
It should be noted that, in order to enable the broadcast receiver to determine the target application program that needs to monitor the system attribute, a registration instruction sent by the target application program to the broadcast receiver may be received in the JAVA layer of the android system, and then the broadcast receiver performs monitoring registration according to the registration instruction, so that the target application program can monitor the data to be broadcast through the broadcast receiver.
It can be understood that the onReceive function can be rewritten by the target application program after sending the registration instruction to the broadcast receiver, so that after receiving the data to be broadcast sent by the broadcast receiver, the service logic processing is performed according to the data to be broadcast.
In order to facilitate the listening registration of the target application, in this embodiment, the attribute information may include: a target attribute name prop _ name and a target attribute value prop _ value;
correspondingly, the step S20 may specifically include: generating data to be broadcasted in a JAVA layer of the android system according to the target attribute name prop _ name and the target attribute value prop _ value, wherein the data name of the data to be broadcasted is generated according to the target attribute name prop _ name, and the data content of the data to be broadcasted is the target attribute value prop _ value;
correspondingly, the step S02 may specifically include: and the broadcast receiver extracts the attribute name to be monitored, which is the same as the target attribute name prop _ name, from the registration instruction, generates a name of data to be monitored according to the attribute name to be monitored, and monitors and registers the name of the data to be monitored so as to monitor the data to be broadcast.
In this embodiment, since the data content of the data to be broadcasted is the target attribute value prop _ value, the target attribute value can be obtained after the target application program obtains the data to be broadcasted, so as to know the setting condition of the system attribute.
Since the data name of the data to be broadcasted is generated according to the target attribute name prop _ name, and the data name to be monitored is generated according to the attribute name to be monitored which is the same as the target attribute name prop _ name, the broadcast receiver can monitor the data to be broadcasted by the data name to be monitored.
It can be understood that, in a specific implementation, since the target attribute name prop _ name may be the same as other attribute names in the android system, confusion is likely to occur, so as to cause misidentification of an application program.
In order to prevent the generation process of the data name of the data to be broadcasted and the data name to be monitored from being too complex, in this embodiment, the data name of the data to be broadcasted is obtained by splicing a preset character string and the target attribute name, and correspondingly, the attribute name to be monitored also needs to be obtained by splicing the preset character string and the attribute name to be monitored, that is, the preset character string and the attribute name to be monitored are spliced to obtain the data name to be monitored.
Assuming that the target attribute name is "persistence. system. language", and the preset character string is "com.tc.sysprep. change", at this time, the data name of the data to be broadcasted may be "com.tc.sysprep. change. persistence. system. language", and accordingly, the attribute name to be listened is also "com.tc.sysprep. change. persistence. system. language".
In a specific implementation, the data type of the data to be broadcasted may be an Intent type, and correspondingly, the data to be listened to registered in the broadcast receiver may be an Intent filter type.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a system attribute monitor is stored on the computer-readable storage medium, and when executed by a processor, the system attribute monitor implements the following operations:
when system attribute setting is carried out on a layer C of an android system, transmitting attribute information of the system attribute to a JAVA layer of the android system;
generating data to be broadcasted in a JAVA layer of the android system according to the attribute information;
and broadcasting the data to be broadcasted in a JAVA layer of the android system, so that a broadcast receiver sends the data to be broadcasted to a target application program after monitoring the data to be broadcasted.
Further, the system attribute monitor, when executed by the processor, further performs the following operations:
receiving a registration instruction sent by a target application program to a broadcast receiver in a JAVA layer of the android system;
and the broadcast receiver monitors and registers according to the registration instruction so as to monitor the data to be broadcast.
Further, the attribute information includes: a target attribute name and a target attribute value; the system attribute monitor, when executed by the processor, further performs the following:
generating data to be broadcasted in a JAVA layer of the android system according to the target attribute name and the target attribute value, wherein the data name of the data to be broadcasted is generated according to the target attribute name, and the data content of the data to be broadcasted is the target attribute value;
and the broadcast receiver extracts the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, generates the name of the data to be monitored according to the attribute name to be monitored, and monitors and registers the name of the data to be monitored so as to monitor the data to be broadcast.
Further, the data name of the data to be broadcasted is generated according to a preset character string and the target attribute name; the system attribute monitor, when executed by the processor, further performs the following:
and the broadcast receiver extracts the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, generates a data name to be monitored according to a preset character string and the attribute name to be monitored, and monitors and registers the data name to be monitored so as to monitor the data to be broadcast.
Further, the data name of the data to be broadcasted is obtained by splicing a preset character string and the target attribute name; the system attribute monitor, when executed by the processor, further performs the following:
and the broadcast receiver extracts the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, splices a preset character string with the attribute name to be monitored to obtain the name of the data to be monitored, and monitors and registers the name of the data to be monitored so as to monitor the data to be broadcast.
Further, the system attribute monitor, when executed by the processor, further performs the following operations:
and when the system attribute is set on the layer C of the android system, transmitting the attribute information of the system attribute to the JAVA layer of the android system through a JNI mechanism.
Further, the system attribute monitor, when executed by the processor, further performs the following operations:
and when the system attribute is set on the C layer of the android system, calling the attribute information as a parameter to a preset program segment of a JAVA layer of the android system by a preset function of the C layer of the android system through a JNI mechanism so as to transmit the attribute information of the system attribute to the JAVA layer of the android system.
According to the scheme, when the system attribute is set on the layer C of the android system, the attribute information of the system attribute is transmitted to the JAVA layer of the android system, the data to be broadcast is generated in the JAVA layer of the android system according to the attribute information, and finally the data to be broadcast is broadcast in the JAVA layer of the android system, so that the broadcast receiver sends the data to be broadcast to the target application program after monitoring the data to be broadcast, the target application program can simply and timely monitor the system attribute on the premise of not influencing the normal operation of the general system platform application, and the program performance is improved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A system attribute monitoring method is characterized by comprising the following steps:
when system attribute setting is carried out on a layer C of an android system, transmitting attribute information of the system attribute to a JAVA layer of the android system;
generating data to be broadcasted in a JAVA layer of the android system according to the attribute information;
broadcasting the data to be broadcasted in a JAVA layer of the android system, so that a broadcast receiver sends the data to be broadcasted to a target application program after monitoring the data to be broadcasted;
when the system attribute setting is carried out on the layer C of the android system, the attribute information of the system attribute is transmitted to the JAVA layer of the android system, and the method comprises the following steps:
when the system attribute is set through a send _ prop _ msg function of a C layer of an android system, a preset function of the C layer of the android system calls attribute information of the system attribute as a parameter to a preset program segment of a JAVA layer of the android system through a JNI mechanism so as to transmit the attribute information of the system attribute to the JAVA layer of the android system.
2. The method for monitoring system attributes according to claim 1, wherein the method for monitoring system attributes further includes, before broadcasting the data to be broadcasted in a JAVA layer of the android system so that a broadcast receiver monitors the data to be broadcasted and sends the data to be broadcasted to a target application program, the method for monitoring system attributes further includes:
receiving a registration instruction sent by a target application program to a broadcast receiver in a JAVA layer of the android system;
and the broadcast receiver monitors and registers according to the registration instruction so as to monitor the data to be broadcast.
3. The system attribute listening method of claim 2 wherein the attribute information comprises: a target attribute name and a target attribute value;
correspondingly, the generating of the data to be broadcasted in the JAVA layer of the android system according to the attribute information specifically includes:
generating data to be broadcasted in a JAVA layer of the android system according to the target attribute name and the target attribute value, wherein the data name of the data to be broadcasted is generated according to the target attribute name, and the data content of the data to be broadcasted is the target attribute value;
correspondingly, the performing, by the broadcast receiver, a monitoring registration according to the registration instruction to monitor the data to be broadcast specifically includes:
and the broadcast receiver extracts the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, generates the name of the data to be monitored according to the attribute name to be monitored, and monitors and registers the name of the data to be monitored so as to monitor the data to be broadcast.
4. The system attribute monitoring method according to claim 3, wherein the data name of the data to be broadcast is generated according to a preset character string and the target attribute name;
correspondingly, the extracting, by the broadcast receiver, the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, generating the name of the data to be monitored according to the attribute name to be monitored, and performing monitoring registration on the name of the data to be monitored, so as to monitor the data to be broadcast, specifically including:
and the broadcast receiver extracts the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, generates a data name to be monitored according to a preset character string and the attribute name to be monitored, and monitors and registers the data name to be monitored so as to monitor the data to be broadcast.
5. The system attribute monitoring method according to claim 4, wherein the data name of the data to be broadcasted is obtained by splicing a preset character string and the target attribute name;
the method includes that the broadcast receiver extracts a name of an attribute to be monitored, which is the same as the target attribute name, from the registration instruction, generates a name of data to be monitored according to a preset character string and the name of the attribute to be monitored, and monitors and registers the name of the data to be monitored so as to monitor the data to be broadcast, and specifically includes the following steps:
and the broadcast receiver extracts the attribute name to be monitored, which is the same as the target attribute name, from the registration instruction, splices a preset character string with the attribute name to be monitored to obtain the name of the data to be monitored, and monitors and registers the name of the data to be monitored so as to monitor the data to be broadcast.
6. The system attribute monitoring method according to claim 1, wherein the preset program segment belongs to systemoproperties class of JAVA layer of the android system.
7. A terminal device, characterized in that the terminal device comprises: a memory, a processor, and a system attribute monitor stored on the memory and executable on the processor, the system attribute monitor configured to implement the steps of the system attribute monitor method of any of claims 1 to 6.
8. A computer-readable storage medium, wherein a system attribute monitor is stored on the computer-readable storage medium, and when executed by a processor, the system attribute monitor implements the steps of the system attribute monitoring method according to any one of claims 1 to 6.
CN201711468242.3A 2017-12-27 2017-12-27 System attribute monitoring method, terminal device and computer readable storage medium Active CN108052401B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711468242.3A CN108052401B (en) 2017-12-27 2017-12-27 System attribute monitoring method, terminal device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711468242.3A CN108052401B (en) 2017-12-27 2017-12-27 System attribute monitoring method, terminal device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108052401A CN108052401A (en) 2018-05-18
CN108052401B true CN108052401B (en) 2022-01-04

Family

ID=62129165

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711468242.3A Active CN108052401B (en) 2017-12-27 2017-12-27 System attribute monitoring method, terminal device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108052401B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109743692A (en) * 2018-12-28 2019-05-10 深圳Tcl新技术有限公司 Acquisition methods, system and the computer readable storage medium of bluetooth hot spot information
CN109918061B (en) * 2019-02-13 2022-06-14 福建星网智慧软件有限公司 Cross-platform interface middleware implementation method and device based on android system
CN112911407A (en) * 2019-11-19 2021-06-04 海信视像科技股份有限公司 Display device and broadcast interactive transparent transmission method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104090751A (en) * 2014-06-10 2014-10-08 南靖万利达科技有限公司 Method for acquiring root authority in Android system
CN104636375A (en) * 2013-11-12 2015-05-20 中兴通讯股份有限公司 Method and device for automatically backing up application data and restoring application data according to needs
CN104793998A (en) * 2014-01-20 2015-07-22 中兴通讯股份有限公司 Terminal system resource management method and device
CN106055348A (en) * 2016-05-19 2016-10-26 青岛海信电器股份有限公司 Method and device for informing system attribute updating

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636375A (en) * 2013-11-12 2015-05-20 中兴通讯股份有限公司 Method and device for automatically backing up application data and restoring application data according to needs
CN104793998A (en) * 2014-01-20 2015-07-22 中兴通讯股份有限公司 Terminal system resource management method and device
CN104090751A (en) * 2014-06-10 2014-10-08 南靖万利达科技有限公司 Method for acquiring root authority in Android system
CN106055348A (en) * 2016-05-19 2016-10-26 青岛海信电器股份有限公司 Method and device for informing system attribute updating

Also Published As

Publication number Publication date
CN108052401A (en) 2018-05-18

Similar Documents

Publication Publication Date Title
CN108023808B (en) Message distribution method and device in application program
CN107515764B (en) Application page opening method, terminal and computer readable storage medium
CN109117361B (en) Remote debugging method, related equipment and system for small program
CN110012328B (en) Method and device for interacting with smart television
CN108052401B (en) System attribute monitoring method, terminal device and computer readable storage medium
US20210208861A1 (en) Method, User Equipment, and Application Server for Downloading Application
CN107645546B (en) File monitoring method based on android system, intelligent device and storage medium
CN107818023B (en) Thread-based message processing method, intelligent device and storage medium
WO2019184658A1 (en) Profile switching method and apparatus, and mobile terminal
CN106445609A (en) Automatic updating method of application program and mobile terminal
CN111240768A (en) Configuration parameter configuration method and device and computer storage medium
US20190114183A1 (en) Terminal Configuration Method and Terminal Based on Provision Protocol for Transmission
US20240069850A1 (en) Application Sharing Method, Electronic Device, and Storage Medium
CN106980531B (en) Input method operation processing method and device
CN108228457B (en) Test agent method and device of mobile terminal and computer readable storage medium
CN111475230B (en) Application function configuration method and device and electronic equipment
CN107092494B (en) Method and device for accessing APK (android Package) resource
CN109144520B (en) Information interaction method, device, equipment and storage medium among different objects in Android
CN112333062A (en) Control method and control device for household equipment and computer readable storage medium
CN108112052B (en) Terminal network sharing method and device, air conditioner and storage medium
CN110865823A (en) Pre-installed application control method, pre-installed application control device and storage medium
CN106815006B (en) Page calling method and device and page management server
CN110336693B (en) Method, device, equipment and storage medium for managing network block equipment
CN108009084B (en) Testing method, device and system for hybrid mobile application
KR102506155B1 (en) Electronic device, application executing system and control methods thereof

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