Method and device for detecting application program, equipment, application program and storage medium

By obtaining the microphone process list from the Android device and determining the application name based on the process information, the problem of UID recognition error was solved, and the accuracy of microphone usage detection was improved.

CN121277779APending Publication Date: 2026-01-06GUANGZHOU SHIZHEN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410880264.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2026-01-06

AI Technical Summary

Technical Problem

In Android devices, different applications may correspond to the same UID, which can easily lead to errors in the method of identifying application package names by UID, affecting the accuracy of microphone usage detection.

Method used

By obtaining the process list of the microphone device, the name of the application is determined based on the process information, and the application using the microphone is accurately identified using a one-to-one or one-to-many mapping relationship.

Benefits of technology

Improved the accuracy of detecting microphone-using applications on Android devices, reducing the occurrence of identification errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121277779A_ABST
    Figure CN121277779A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of Android equipment, and discloses a method for detecting an application program, which is applied to Android equipment with a microphone device and comprises the following steps: judging whether the microphone device is in an occupied state or not; under the condition that the microphone is in the occupied state, acquiring a process list of the microphone device which is being used; determining the name of a running program corresponding to each process according to the process information of each process in the process list; and determining the application program which is using the microphone device based on the name of the running program corresponding to each process. Wherein under the condition that the microphone device in the Android equipment is being used, the application program which is using the microphone device is determined according to the corresponding relation between the process which is using the microphone device and the running program. Therefore, in the process of detecting the application program using the microphone in the Android equipment, the detection accuracy is improved. The invention further discloses a device and equipment for detecting the application program, the application program and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Android device technology, and for example to a method and apparatus for detecting applications, devices, applications, and storage media. Background Technology

[0002] Currently, when users use applications on Android devices, they are quite concerned about application permissions in order to ensure privacy and security, especially the permission for the application to use the microphone on the Android device during operation.

[0003] To ensure users are aware of microphone usage during application operation, related technologies employ a method where the configuration information used to record microphone usage changes when an application uses the microphone. When this configuration information changes, the Android device uses the application's UID (User Identification) in the updated configuration information to identify the application package name corresponding to that UID, thus determining which application is currently using the microphone. The device then provides the user with microphone usage information, indicating which applications are currently using the microphone.

[0004] However, on an Android device, different applications may share the same UID. This makes the existing methods of identifying application package names based on application UIDs prone to errors, thus affecting the accuracy of detecting applications using the microphone on Android devices. Summary of the Invention

[0005] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.

[0006] This application provides a method, apparatus, device, application, and storage medium for detecting applications, which can improve the accuracy of detection when detecting applications using the microphone on an Android device.

[0007] In a first aspect, embodiments of this application provide a method for detecting an application, applied to an Android device, the Android device having a microphone and a display device; the method includes:

[0008] Determine if the microphone device is in use;

[0009] If the microphone is in use, retrieve the list of processes that are using the microphone device.

[0010] Based on the process information of each process in the process list, determine the name of the running program corresponding to each process;

[0011] Based on the name of the running program corresponding to each process, identify the application that is using the microphone device;

[0012] The application using the microphone is displayed on the display device.

[0013] Optionally, obtaining the list of processes using the microphone device includes: issuing a first ADB command to the system process of the Android device, causing the system process to execute the first ADB command to obtain the list of processes using the microphone device.

[0014] Optionally, based on the process information of each process in the process list, the name of the running program corresponding to each process is determined, including: traversing the process information of each process in the process list to obtain the process ID of each process; generating a second ADB command corresponding to each process based on the process ID of each process; and issuing the second ADB command to the system process of the Android device to make the system process execute the second ADB command to determine the name of the running program corresponding to each process.

[0015] Optionally, determining the application using the microphone device based on the name of the running program corresponding to each process includes: filtering applications from the running programs corresponding to each process based on the name of the running program corresponding to each process; and determining the application using the microphone device based on the running status of the application.

[0016] Optionally, based on the name of the running program corresponding to each process, the application is selected from the running programs corresponding to each process, including: based on the name of the running program corresponding to each process, calling a first preset function to determine the installation directory of the running program corresponding to each process; if the target running program is installed in a preset directory, the target running program is determined to be an application; wherein, the target running program is any application among the running programs corresponding to each process.

[0017] Optionally, determining the application using the microphone device based on the application's running state includes: calling a second preset function to determine whether the application is running on an Android device; and if the application is running on an Android device, determining that the application is using the microphone device.

[0018] Optionally, determining whether the microphone device is in a occupied state includes: injecting a listening program into the system program of the Android device; the listening program being invoked and sending a notification message when the configuration information and / or on / off state of the microphone device changes; upon receiving a notification message from the listening program, determining whether the microphone device is in a occupied state based on the notification message; and if no notification message is received from the listening program, determining that the microphone device is in an idle state; wherein the notification message includes a first notification message and / or a second notification message, the first notification message indicating a change in the configuration information of the microphone device, and the second notification message indicating a change in the on / off state of the microphone device.

[0019] Optionally, determining whether the microphone device is in a occupied state based on the notification message includes: if the notification message is a first notification message, calling a third preset function to determine whether the microphone device's usage rights are occupied; if the microphone device's usage rights are occupied, determining that the microphone device is in a occupied state. Alternatively, if the notification message is a second notification message, calling a fourth preset function to determine whether the microphone device's switch is turned on; if the microphone device's switch is turned on, determining that the microphone device is in a occupied state. Alternatively, if the notification message is both a first and a second notification message, calling a third preset function to determine whether the microphone device's usage rights are occupied, and calling a fourth preset function to determine whether the microphone device's switch is turned on; if the microphone device's usage rights are occupied, or the microphone device's switch is turned on, determining that the microphone is in a occupied state.

[0020] In a second aspect, embodiments of this application provide an electronic device, including a processor and a memory storing program instructions, wherein the processor is configured to execute the method for detecting an application as described in the first aspect when running the program instructions.

[0021] Thirdly, embodiments of this application provide an application running on an Android device, the Android device having a microphone device and a display device; wherein, the application is configured to execute the method for detecting applications as described in the first aspect when running.

[0022] Fourthly, embodiments of this application provide a storage medium storing program instructions, wherein the program instructions, when executed, perform the method for detecting the application as described in the first aspect.

[0023] The method, apparatus, device, application, and storage medium for detecting applications provided in this application embodiment can achieve the following technical effects:

[0024] If it is determined that the microphone is being used, a list of processes using the microphone on the Android device is obtained to identify which processes are using the microphone. In Android devices, the process name corresponds to the name of the running program, and when the running program is an application, the process name corresponds to the application's package name. Therefore, based on the process information of each process in the process list, the name of the running program corresponding to each process can be determined, and further, the package name of the application using the microphone can be determined, thus identifying the application using the microphone. Furthermore, in Android devices, there is a one-to-one or one-to-many mapping relationship between applications and processes. Thus, in this method of identifying the application using the microphone based on the processes using the microphone, there is no situation where one process corresponds to different applications, whereas in related technologies, the same UID may correspond to different applications. Therefore, compared to related technologies that rely on UID to identify the corresponding application, the method provided in this application, which identifies the application using the microphone based on the processes using the microphone, can reduce the occurrence of identification errors during the detection of applications using the microphone on Android devices. This improves the accuracy of detection.

[0025] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description

[0026] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are shown as similar elements. The drawings are not to be scaled. And wherein:

[0027] Figure 1 This is a flowchart of a method for detecting applications in related technologies;

[0028] Figure 2 This is a flowchart of a method for detecting an application provided in an embodiment of this application;

[0029] Figure 3 This is an example diagram of a process list provided in an embodiment of this application;

[0030] Figure 4 This is an example diagram illustrating detailed information about a process provided in an embodiment of this application;

[0031] Figure 5 This is a schematic diagram of an Android device provided in an embodiment of this application;

[0032] Figure 6 This is a schematic diagram of a device for detecting an application provided in an embodiment of this application;

[0033] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0034] To provide a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments of this application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this application. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.

[0035] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0036] Unless otherwise stated, the term "multiple" means two or more.

[0037] In this embodiment, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.

[0038] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.

[0039] The term "correspondence" can refer to an association or binding relationship. The correspondence between A and B means that there is an association or binding relationship between A and B.

[0040] Users are particularly concerned about application permissions when using applications on Android devices, especially the permission to use the microphone while the application is running. This is because there is a possibility that applications may automatically enable microphone permissions in the background while using Android devices, and users worry about the leakage of conversation information when using applications on their Android devices.

[0041] To ensure user privacy and security, and to allow users to clearly understand how an application uses the microphone during operation, related technologies provide a method for detecting application usage. Combined with... Figure 1 As shown, the method provided by the related technology utilizes a target application running on an Android device. Based on the principle that configuration information used to record microphone usage changes when an application uses the microphone on the Android device, a solution is implemented to detect applications using the microphone on the Android device. The specific steps are as follows:

[0042] S11, the target application registers a listener with the Android device to monitor whether the configuration information used to record microphone usage changes.

[0043] S12, when application A uses the microphone, the configuration information changes.

[0044] S13, when the configuration information changes, the Android device sends a notification message carrying the configuration information to the target application. The notification message includes the package name and UID of application A, and the package name and UID of application B.

[0045] S14, the target application looks up the application package name corresponding to the UID in the notification message to determine the application currently using the microphone.

[0046] The target application then provides the user with microphone usage information. This usage information includes details of the applications currently using the microphone, alerting the user to which applications are using the microphone.

[0047] However, the UID of an application on an Android device is determined by the `sharedUserId` attribute in the Android operating system's configuration file (AndroidManifest.xml). When different applications have the same `sharedUserId` attribute, they will correspond to the same UID. This makes the current method of identifying application package names based on application UIDs prone to errors, thus affecting the accuracy of detecting applications using the microphone on Android devices. For example, suppose application A (package name com.android.aaa) and application B (package name com.android.bbb) have the same `sharedUserId` attribute, and both applications A and B have the same UID-1000. If application A is using the microphone on the Android device, and application B is not using the microphone, then using the UID-1000 in the configuration information might lead to the search result for application B's package name com.android.bbb. Application B would be detected even though it's not using the microphone, clearly indicating an error.

[0048] Therefore, embodiments of this application provide a method, apparatus, device, application, and storage medium for detecting applications. When the microphone is being used in an Android device, the application using the microphone is determined based on the correspondence between the process using the microphone and the running program. Compared to related technologies, this reduces the possibility of false identification. Thus, the accuracy of detection is improved in the process of detecting applications using the microphone in an Android device.

[0049] In this embodiment, the Android device is an electronic device running the Android operating system, which includes a microphone and a display. For example, an Android device can be a mobile terminal device such as a mobile phone, laptop, or tablet, or it can be a conference tablet, smart interactive tablet, or other similar device.

[0050] Combination Figure 2 As shown, this application embodiment provides a method for detecting applications. This method is applied to the aforementioned Android device. The executing entity of this method can be a pre-installed application in the Android device or a control module integrated into the Android device. The method includes:

[0051] S21, determine whether the microphone device is in use.

[0052] S22, if the microphone is in use, obtain the list of processes using the microphone device.

[0053] S23. Based on the process information of each process in the process list, determine the name of the running program corresponding to each process.

[0054] S24, based on the name of the running program corresponding to each process, determine the application that is using the microphone device.

[0055] S25 displays the application using the microphone via a display device.

[0056] The application detection method provided in this application can, when it is determined that a microphone device is being used, obtain a list of processes using the microphone device on an Android device to identify which processes are using the microphone device. In an Android device, the name corresponding to a process is the name of the running program, and when the running program is an application, the name corresponding to the process is the application's package name. Therefore, based on the process information of each process in the process list, the name of the running program corresponding to each process can be determined, and further, the package name of the application using the microphone device can be determined, thus identifying the application using the microphone device. Furthermore, in an Android device, there is a one-to-one or one-to-many mapping relationship between applications and processes. Thus, in the method of determining the application using the microphone device based on the processes using the microphone device, there is no situation where one process corresponds to different applications, whereas in related technologies, the same UID corresponds to different applications. Therefore, compared to related technologies that rely on UID to identify corresponding applications, the method provided in this application, which determines the application using the microphone device based on the processes using the microphone device, can reduce the occurrence of identification errors during the detection of applications using the microphone device on an Android device. This improves the accuracy of detection.

[0057] Optionally, in step S21 above, determining whether the microphone device is in a occupied state includes: injecting a listening program into the system program of the Android device. The listening program is invoked and sends a notification message when the configuration information and / or on / off state of the microphone device changes. Upon receiving a notification message from the listening program, it is determined whether the microphone device is in a occupied state based on the notification message. If no notification message is received from the listening program, it is determined that the microphone device is in an idle state. The notification message includes a first notification message and / or a second notification message, whereby the first notification message indicates a change in the configuration information of the microphone device, and the second notification message indicates a change in the on / off state of the microphone device.

[0058] When an application uses the microphone in an Android device, it triggers changes in the configuration information used to record microphone usage and also changes the microphone's on / off state. In this implementation, a listening program injected into the Android device's system program can monitor changes in the microphone's configuration information and / or on / off state. When an application uses the microphone, an audio processing-related program in the system program is executed. During the execution of this audio processing-related program, the injected listening program is triggered, and a notification message is sent back upon triggering.

[0059] When no notification message is received from the monitoring program, it indicates that the microphone device's configuration information and / or on / off state have not changed, meaning the microphone device is not in use and is idle. When a notification message is received from the monitoring program, it indicates that the microphone device's configuration information and / or on / off state have changed. It's understandable that in Android devices, a change in microphone device usage (change in configuration information and / or on / off state) refers to a change in the microphone device's audio access status. This change includes both switching from an audio-off state to an audio-accessed state and vice versa. Therefore, receiving a notification message from the monitoring program only indicates a change in microphone device usage; it doesn't determine the specific change in the microphone device's audio access status. Whether the microphone device is occupied needs further investigation based on its audio access status.

[0060] For example, the listener can be a callback function injected into the Android device's system program. Different callback functions can listen for the microphone's configuration information and on / off state. Specifically, a callback function can listen to the invocation process of the `AudioManager.AudioRecordingCallback` class. The `AudioManager.AudioRecordingCallback` class is an interface in the Android operating system's system program used to receive notifications when the microphone's configuration information is updated. When an application uses the microphone, the `AudioManager.AudioRecordingCallback` class is invoked. This invocation process is listened to by the callback function, which then triggers a callback message reflecting a change in the microphone's configuration information. This callback message corresponds to the first notification message. Alternatively, a callback function can listen to the `AudioManager.ActionMicrophoneMuteChanged` field in the Android operating system's system program. The `AudioManager.ActionMicrophoneMuteChanged` field changes when the microphone's on / off state changes. When an application uses the microphone device, the changes to the AudioManager.ActionMicrophoneMuteChanged field will be monitored by the callback function, which will then send a callback message reflecting the change in the microphone device's on / off state. This callback message corresponds to the second notification message.

[0061] By employing this implementation, Android devices can monitor changes in microphone usage to promptly detect when the microphone is in use, allowing users to be aware of when an application is using it. Furthermore, by only detecting applications using the microphone when a change in microphone usage is detected, the process of identifying applications using the microphone is reduced, minimizing the prolonged occupation of Android operating system resources and improving device performance.

[0062] The following section details the scheme for further determining the audio access status of the microphone device after receiving a notification message, in order to ascertain whether the microphone device is in use:

[0063] Furthermore, based on the notification message, it is determined whether the microphone device is in a occupied state, including: if the notification message is a first notification message, then calling a third preset function to determine whether the microphone device's usage rights are occupied. If the microphone device's usage rights are occupied, it is determined that the microphone device is in an occupied state.

[0064] The first notification message indicates a change in microphone configuration information, requiring a determination of whether microphone usage permissions are being used. If microphone usage permissions are being used, it means a running application is using the microphone, and the microphone is in a occupied state. If microphone usage permissions are not being used, it means no running application is using the microphone, and the configuration information change may be due to the microphone changing from an audio-connected state to an audio-disconnected state. Additionally, the Android operating system provides a function in its system programs for determining microphone usage permissions; this function can be directly called to check if microphone usage permissions are being used.

[0065] Furthermore, based on the notification message, it is determined whether the microphone device is in a occupied state, including: if the notification message is a second notification message, then calling a fourth preset function to determine whether the microphone device's switch is turned on. If the microphone device's switch is turned on, it is determined that the microphone device is in a occupied state.

[0066] The second notification message indicates that the microphone device has switched on / off, requiring a determination of whether the microphone device is switched on. If the microphone device is switched on, it means a running program is using the microphone device, and the microphone device is in use. If the microphone device is not switched on, it means no running program is using the microphone device. The change in the microphone device's on / off state may be due to the microphone device switching from an audio-connected state to an audio-disconnected state. Additionally, the Android operating system provides a function in its system program to determine the microphone device's on / off state; this function can be directly called to determine whether the microphone device is switched on or off.

[0067] Furthermore, based on the notification message, it is determined whether the microphone device is in a occupied state, including: if the notification message is a first notification message or a second notification message, then a third preset function is called to determine whether the microphone device's usage rights are occupied, and a fourth preset function is called to determine whether the microphone device's switch is turned on. If the microphone device's usage rights are occupied, or the microphone device's switch is turned on, it is determined that the microphone is in a occupied state.

[0068] When the notification message is either the first or second notification message, it indicates that the microphone device's configuration information and on / off status have changed. It's necessary to determine whether the microphone device's usage rights are being used and whether the microphone device's on / off state is being checked. If the microphone device's usage rights are being used or its on / off state is being checked, it means a running program is using the microphone device, and the microphone device is in a occupied state. If the microphone device's usage rights are not being used and its on / off state is not being checked, it means no running program is using the microphone device. The change in the microphone device's configuration information and on / off status may be due to the microphone device changing from an audio-connected state to an audio-disconnected state. Alternatively, when determining whether the microphone device's usage rights are being used and whether its on / off state is being checked, the system program's preset functions can also be called directly.

[0069] This implementation method, upon receiving a notification message, further determines whether the microphone device is being used by a running program based on its usage permissions and on / off status. This accurately determines whether the microphone device is in use, ensuring the accuracy of the microphone device occupancy assessment. Furthermore, subsequent tasks that detect applications using the microphone device are only executed after confirming that the microphone device is indeed being used by a running program, thus reducing the likelihood of additional tasks being executed. This reduces the excessive use of Android device resources, thereby improving Android device performance.

[0070] Optionally, in step S22 above, obtaining the list of processes using the microphone device includes: sending a first ADB command to the system process of the Android device, causing the system process to execute the first ADB command to obtain the list of processes using the microphone device.

[0071] In this implementation, a list of processes using the microphone on the Android device is obtained by executing corresponding ADB commands through the system processes of the Android device. The system process can be the adbd service process, which is the daemon process of ADB (Android Debug Bridge) that runs and processes ADB commands on the Android device. ADB commands can be sent to the system processes of the Android device through a pre-installed application on the Android device. The obtained process list includes both system processes and application processes using the microphone. It is understood that system processes execute system programs, and application processes execute application programs.

[0072] For example, the first ADB command could be `dumpsys media.audio_flinger|grep'^[[:space:]]*yes'`, where `dumpsys` is the command to retrieve process information, `media.audio_flinger` refers to the processes related to the audio service in the Android device, `grep` is the filtering command, and `yes` indicates that the processes are running. After the system process executes the first ADB command, it can obtain the process information of each running process among the audio service-related processes.

[0073] For example, the process list obtained after a system process executes its first ADB command can be as follows: Figure 3 As shown, Figure 3 Each row in the process list shown represents the process information of a process. 9757 and 8938 represent the process IDs. It is not difficult to see that the first and third rows of process information correspond to the same process with process ID 9757.

[0074] Optionally, in step S23 above, determining the name of the running program corresponding to each process based on the process information of each process in the process list includes: traversing the process information of each process in the process list to obtain the process ID of each process; generating a second ADB command corresponding to each process based on the process ID of each process; and issuing the second ADB command to the system process of the Android device to cause the system process to execute the second ADB command to determine the name of the running program corresponding to each process.

[0075] The process list can identify which processes are currently using the microphone. Further, it's necessary to obtain the running programs corresponding to these processes to determine which running programs are using the microphone. This is done by executing appropriate ADB commands through the Android device's system processes to retrieve the running programs associated with each process. A second ADB command is generated based on the process ID, and after execution by the system process, the process name is obtained. In the Android operating system, the process name is the name of the running program. When the process list includes multiple processes, it's necessary to obtain the name of the running program for each process separately.

[0076] For example, the second ADB command could be PS-APID, where the PS command is used to obtain the process status, the PID is the process ID, and PS-APID is used to obtain detailed information about the process based on the process ID. Combined with... Figure 3As shown, to display detailed information about the process with process ID 9757, the second ADB command is PS -A 9757. To display detailed information about the process with process ID 8938, the second ADB command is PS -A 8938. Detailed information about the process with process ID 9757 can be viewed as follows: Figure 4 As shown, Figure 4 The detailed information shown indicates that the "NAME" column displays the process name, specifically the name of the running application corresponding to process ID 9757, "com.dss.screenrecorder". Normally, for system applications running in the Android operating system, the process name displayed in the "NAME" column is "SYSTEM".

[0077] It should be noted that in this application, after obtaining the names of the running programs corresponding to each process in the process list, all running programs using the microphone device in the Android device are determined. However, users are more concerned about the situation where third-party applications automatically start the microphone device in the background when using the Android device. Therefore, in step S24 of this application embodiment, it is necessary to determine the application using the microphone device based on the names of the running programs corresponding to each process.

[0078] Optionally, in step S24 above, determining the application using the microphone device based on the name of the running program corresponding to each process includes: filtering applications from the running programs corresponding to each process based on their names; and determining the application using the microphone device based on the application's running status.

[0079] In this implementation, considering that the task of detecting applications using the microphone on an Android device requires a certain amount of time to complete, if a user closes an application that was using the microphone during the detection period, the application in each process's running program will be directly identified as the application using the microphone and reported to the user. This could easily lead to false detections, as previously closed applications are mistakenly reported as applications using the microphone. Therefore, after filtering applications from the running programs of each process, it is necessary to refer to the application's running status to determine which application is using the microphone. This avoids false detections.

[0080] Furthermore, based on the names of the running programs corresponding to each process, applications are filtered out from the running programs corresponding to each process, including: determining whether the target running program is an application based on its name. Here, the target running program can be any application among the running programs corresponding to each process.

[0081] Combination Figure 4 As shown, since the process name displayed in the "NAME" column of system running programs in the Android operating system is usually "SYSTEM", it is possible to determine whether a running program is an application simply by looking at its name. Specifically, if the name of a running program is not "SYSTEM", then the running program is considered an application.

[0082] However, considering the special case that some system programs in the Android operating system may not have the name "SYSTEM", alternatively, applications can be filtered from the running programs corresponding to each process based on their names. Specifically, a first preset function can be called to determine the installation directory of the running programs corresponding to each process based on their names. If the target running program is installed in a preset directory, the target running program is determined to be an application. Here, the target running program can be any application among the running programs corresponding to each process.

[0083] In this implementation, the first preset function can be a function provided by the package manager in the Android device. By calling this preset function, it is possible to determine whether the running program is a third-party application installed on the Android device. For example, since the installation directories of system programs and third-party applications are different in the Android operating system (e.g., system programs are installed in the / system / app / directory, and third-party applications are installed in the / data / app / directory), after the first preset function is called, it is possible to determine whether the running program is installed in the installation directory of the third-party application, thereby determining whether the running program is a third-party application.

[0084] This implementation reduces false detections during the detection of applications using the microphone on an Android device, thereby further improving detection accuracy.

[0085] Optionally, determining whether an application is using the microphone device based on its running state includes: calling a second preset function to determine whether the application is running on an Android device. If the application is running on an Android device, the application is determined to be using the microphone device.

[0086] In this embodiment, the package manager in the Android device is mainly used for the installation, deletion, upgrading, configuration and management of applications. The package manager also provides a second preset function for determining whether an application is running. By calling this preset function, it is possible to determine whether an application is running on the Android device.

[0087] Optionally, in step S25 above, after determining which application is using the microphone on the Android device, the user can be informed of the application using the microphone through the display interface of the Android device's display device, so that the user can more clearly understand which application(s) on the Android device are using the microphone. For example, combined with... Figure 5 As shown, feedback on application information can be displayed as a notification message on the Android device's display interface. Specifically, the application name can be displayed as a floating window on the Android device's display interface. For example, applications 1 and 2 that use the microphone can be displayed on the Android device's display interface. Using this implementation, the application currently using the microphone can be more accurately presented to the user through the Android device's display interface, thereby improving the user experience.

[0088] Optionally, after displaying an application using the microphone on the Android device's screen, the Android device can also control the application's permissions based on the user's input. For example, assuming a user doesn't want a particular application to use the microphone, the device can control and disable that application's microphone access permission in response to the user's input. This satisfies the user's personalized needs regarding application permissions when using applications on the Android device, thereby improving the user experience.

[0089] It should be noted that after the application using the microphone is displayed on the Android device's screen, the Android device can also respond to other operation commands from the user, and this application embodiment does not limit this.

[0090] Combination Figure 6 As shown, this application embodiment provides an application detection device 600, which is integrated into the aforementioned Android device. The device 600 includes a status judgment module 601, a process acquisition module 602, a name determination module 603, an application determination module 604, and an application display module 605. Wherein:

[0091] The status judgment module 601 is configured to determine whether the microphone device is in an occupied state.

[0092] The process acquisition module 602 is configured to acquire a list of processes using the microphone device when the microphone is in use.

[0093] The name determination module 603 is configured to determine the name of the running program corresponding to each process based on the process information of each process in the process list.

[0094] Application determination module 604 is configured to determine the application using the microphone device based on the name of the running program corresponding to each process.

[0095] Application display module 605 is configured to display, via a display device, an application that is using a microphone device.

[0096] Optionally, the process acquisition module 602 is specifically used to: issue a first ADB command to the system process of the Android device, causing the system process to execute the first ADB command to obtain a list of processes that are using the microphone device.

[0097] Optionally, the name determination module 603 is specifically used for: traversing the process information of each process in the process list to obtain the process ID of each process; generating a second ADB command corresponding to each process based on the process ID; and issuing the second ADB command to the system process of the Android device, causing the system process to execute the second ADB command to determine the name of the running program corresponding to each process.

[0098] Optionally, the application determination module 604 is specifically used to: filter applications from the running programs corresponding to each process based on the names of the running programs corresponding to each process; and determine the application that is using the microphone device based on the running status of the application.

[0099] Optionally, the application determination module 604 is specifically used to: based on the name of the running program corresponding to each process, call a first preset function to determine the installation directory of the running program corresponding to each process. If the target running program is installed in a preset directory, the target running program is determined to be an application. The target running program can be any application program among the running programs corresponding to each process.

[0100] Optionally, the application determination module 604 is specifically used to: call a second preset function to determine whether the application is running on an Android device. If the application is running on an Android device, determine that the application is using the microphone device.

[0101] Optionally, the state determination module 601 is specifically used to: inject a listener into the system program of the Android device. The listener is invoked and sends a notification message when the configuration information and / or on / off state of the microphone device changes. Upon receiving a notification message from the listener, the system determines whether the microphone device is in a occupied state. If no notification message is received from the listener, the system determines that the microphone device is in an idle state. The notification message includes a first notification message and / or a second notification message, whereby the first notification message indicates a change in the configuration information of the microphone device, and the second notification message indicates a change in the on / off state of the microphone device.

[0102] Optionally, the status determination module 601 is specifically used to: if the notification message is a first notification message, call a third preset function to determine whether the microphone device's usage rights are occupied. If the microphone device's usage rights are occupied, determine that the microphone device is in an occupied state.

[0103] Optionally, the status determination module 601 is specifically used to: if the notification message is a second notification message, call a fourth preset function to determine whether the microphone device is switched on. If the microphone device is switched on, determine that the microphone device is in an occupied state.

[0104] Optionally, the status determination module 601 is specifically used to: if the notification message is a first notification message or a second notification message, call a third preset function to determine whether the microphone device's usage rights are occupied, and call a fourth preset function to determine whether the microphone device's switch is turned on. If the microphone device's usage rights are occupied, or the microphone device's switch is turned on, the system determines that the microphone is in an occupied state.

[0105] The device 600 for detecting applications provided in this application embodiment performs the same action as the method for detecting applications described in the above embodiment. Its implementation principle and technical effect are similar, and will not be repeated here.

[0106] Combination Figure 7 As shown, this application provides an electronic device 700, including a processor 100 and a memory 101. Optionally, the electronic device 700 may further include a communication interface 102 and a bus 103. The processor 100, communication interface 102, and memory 101 can communicate with each other via the bus 103. The communication interface 102 can be used for information transmission. The processor 100 can call logical instructions in the memory 101 to execute the application detection method described in the above embodiment.

[0107] Furthermore, the logic instructions in the aforementioned memory 101 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0108] The memory 101, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this application. The processor 100 executes functional applications and data processing by running the program instructions / modules stored in the memory 101, that is, it implements the method for detecting applications in the above embodiments.

[0109] The memory 101 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 101 may include high-speed random access memory and may also include non-volatile memory.

[0110] This application provides an application that runs on the Android device described in the foregoing embodiments, wherein the application is configured to execute the method for detecting applications described in the foregoing embodiments when running.

[0111] This application provides a storage medium storing computer-executable instructions configured to execute the method for detecting the application described in the above embodiments.

[0112] The aforementioned storage medium can be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0113] The technical solutions of this application embodiment can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this application embodiment. The aforementioned storage medium can be a non-transitory storage medium, including: USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, and other media capable of storing program code; it can also be a transient storage medium.

[0114] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used in this application means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.

[0115] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0116] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to implement this embodiment according to actual needs. In addition, the functional units in the embodiments of this application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0117] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description; sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

Claims

1. A method of detecting an application program, characterized by, The method is applied to an Android device, and the Android device is provided with a microphone device and a display device; the method comprises: determining whether the microphone device is in an occupied state; in the case that the microphone device is in the occupied state, obtaining a process list of processes using the microphone device; determining the name of a running program corresponding to each process according to process information of each process in the process list; determining an application program using the microphone device based on the name of the running program corresponding to each process; displaying the application program using the microphone device through the display device.

2. The method of claim 1, wherein, obtaining the process list of processes using the microphone device comprises: issuing a first ADB command to a system process of the Android device, so that the system process executes the first ADB command to obtain the process list of processes using the microphone device.

3. The method of claim 1, wherein, determining the name of the running program corresponding to each process according to the process information of each process in the process list comprises: traversing the process information of each process in the process list to obtain the process number of each process; generating a second ADB command corresponding to each process according to the process number of each process; issuing the second ADB command to the system process of the Android device, so that the system process executes the second ADB command to determine the name of the running program corresponding to each process.

4. The method of claim 1, wherein, determining the application program using the microphone device based on the name of the running program corresponding to each process comprises: screening the application program from the running program corresponding to each process based on the name of the running program corresponding to each process; determining the application program using the microphone device according to the running state of the application program.

5. The method of claim 4, wherein, screening the application program from the running program corresponding to each process based on the name of the running program corresponding to each process comprises: calling a first preset function to determine the installation directory of the running program corresponding to each process based on the name of the running program corresponding to each process; in the case that the target running program is installed in a preset directory, determining that the target running program is the application program; wherein the target running program is any one of the running program corresponding to each process.

6. The method of claim 4, wherein, determining the application program using the microphone device according to the running state of the application program comprises: calling a second preset function to determine whether the application program runs on the Android device; in the case that the application program runs on the Android device, determining that the application program is the application program using the microphone device.

7. The method according to any one of claims 1 to 6, characterized in that, determining whether the microphone device is in the occupied state comprises: injecting a listening program into a system program of the Android device; the listening program is called and feeds back a notification message when the configuration information and / or the switch state of the microphone device changes; in the case that the notification message fed back by the listening program is received, determining whether the microphone device is in the occupied state according to the notification message; in the case that the notification message fed back by the listening program is not received, determining that the microphone device is in an idle state; The notification message includes a first notification message and / or a second notification message, the first notification message is used to represent that the configuration information of the microphone device changes, and the second notification message is used to represent that the switch state of the microphone device changes.

8. The method of claim 7, wherein, According to the notification message, it is judged whether the microphone device is in an occupied state, including: If the notification message is the first notification message, a third preset function is called to judge whether the use right of the microphone device is occupied, and in the case that the use right of the microphone device is occupied, it is determined that the microphone device is in the occupied state; or, If the notification message is the second notification message, a fourth preset function is called to judge whether the switch of the microphone device is opened, and in the case that the switch of the microphone device is opened, it is determined that the microphone device is in the occupied state; or, If the notification message is the first notification message and the second notification message, the third preset function is called to judge whether the use right of the microphone device is occupied, and the fourth preset function is called to judge whether the switch of the microphone device is opened, and in the case that the use right of the microphone device is occupied or the switch of the microphone device is opened, it is determined that the microphone device is in the occupied state.

9. An electronic device comprising a processor and a memory having stored thereon program instructions, wherein, The processor is configured to execute the method for detecting the application program as claimed in any one of claims 1 to 8 when the program instruction is run.

10. An application program, characterized by The application program is configured to execute the method for detecting the application program as claimed in any one of claims 1 to 8 when it is run.

11. A storage medium storing program instructions, characterized in that, The program instruction is configured to execute the method for detecting the application program as claimed in any one of claims 1 to 8 when it is run.