An application fingerprint calling method, device and computer readable storage medium
By combining process information and the judgment of the top task interface activity component in the fingerprint service of the fingerprint framework, the problem of fingerprint misjudgment in the prior art is solved, and more stable and accurate fingerprint invocation is achieved, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NUBIA TECHNOLOGY CO LTD
- Filing Date
- 2022-06-28
- Publication Date
- 2026-06-19
AI Technical Summary
In existing technologies, there is a lag in determining whether an application is a foreground process using the importance variable of ActivityManager.RunningAppProcessInfo, which can cause the fingerprint function to misidentify it as a background process, thus affecting the user experience.
In the fingerprint service of the fingerprint framework, it is determined whether the process information of the application meets the preset conditions. If it does not meet the conditions, the top interface activity component of the top task determines whether the application is a foreground process, and then allows or denies fingerprint recognition.
It improves the stability and accuracy of fingerprint access, enhances the user experience, and achieves better control logic while ensuring fingerprint security.
Smart Images

Figure CN115113999B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mobile communications, and more particularly to an application fingerprinting method, device, and computer-readable storage medium. Background Technology
[0002] In existing technologies, with the continuous development of smart terminal devices, the application scope and frequency of fingerprint recognition have been further increased. To regulate the secure use of fingerprints, Android's fingerprint security mechanism stipulates that third-party applications not in the foreground cannot enable fingerprint recognition. Each time fingerprint verification, enrollment, or detection is initiated, the fingerprint framework determines whether the current application is a foreground process. If not, it refuses to use fingerprint verification, enrollment, or detection. In the native fingerprint framework, the foreground process is determined by the running process information ActivityManager.RunningAppProcessInfo. Each process has an importance variable, which records the process's importance level in the system. The smaller the importance value, the higher the importance level. When proc.importance is less than or equal to IMPORTANCE_FOREGROUND_SERVICE 125, the process is considered a foreground process, and fingerprint use is allowed.
[0003] However, relying solely on the aforementioned variables to determine whether a process is in the foreground has a certain time lag. Because the values of these variables may not be updated in a timely manner, the system might mistakenly identify it as a background process, thus preventing the fingerprint scanner from functioning properly and resulting in a poor user experience. Summary of the Invention
[0004] To address the aforementioned technical deficiencies in the prior art, this invention proposes an application fingerprint invocation method, which includes:
[0005] In the fingerprint service of the preset fingerprint framework, it is determined whether the variable of the current application's process information meets the first preset condition;
[0006] When the variable meets the first preset condition, the application is allowed to call fingerprint recognition; when the first preset condition is not met, the application is determined to be a program corresponding to the foreground process by the active component of the top interface of the corresponding top task of the application.
[0007] When it is determined that the application belongs to the program corresponding to the foreground process, the application is allowed to call fingerprint recognition; when it is determined that the application does not belong to the program corresponding to the foreground process, the application is denied from calling fingerprint recognition.
[0008] Optionally, in the fingerprint service of the preset fingerprint framework, determining whether the variables of the current application's process information meet the first preset condition includes:
[0009] When the application initiates a fingerprint recognition request, the fingerprint service determines whether the application has the permission to access the fingerprint.
[0010] When it is determined that the application has the required calling permission, it is determined whether the application is a system application or a third-party application.
[0011] Optionally, the step of determining whether the variables of the current application's process information meet the first preset condition in the fingerprint service of the preset fingerprint framework further includes:
[0012] When it is determined that the application belongs to the third-party application, it is determined whether the variable is less than or equal to a preset reference value;
[0013] When the variable is determined to be less than or equal to the reference value, the variable is determined to meet the first preset condition; when the variable is determined to be greater than the reference value, the variable is determined to not meet the first preset condition.
[0014] Optionally, when the first preset condition is not met, determining whether the application belongs to the foreground process through the active component of the top interface of the corresponding top task of the application includes:
[0015] Add a system service acquisition method to the utility class of the fingerprint service;
[0016] The current interface manager is obtained through the system service acquisition method.
[0017] Optionally, the step of determining whether the application belongs to the foreground process by the active component of the top interface of the corresponding top task when the first preset condition is not met further includes:
[0018] The interface manager is used to obtain the currently running task stack information;
[0019] The top task of the task stack is obtained through the task stack information, and the package name of the top interface of the top task is obtained.
[0020] Optionally, the step of determining whether the application belongs to the foreground process by the active component of the top interface of the corresponding top task when the first preset condition is not met further includes:
[0021] When the package name is the same as the package name of the third-party application, it is determined that the third-party application belongs to the program corresponding to the foreground process;
[0022] If the package name is different from the package name of the third-party application, it is determined that the third-party application does not belong to the program corresponding to the foreground process.
[0023] Optionally, when it is determined that the application belongs to the program corresponding to the foreground process, allowing the application to call fingerprint recognition includes:
[0024] When it is determined that the application belongs to the program corresponding to the foreground process, the service provider object in the fingerprint service is obtained, and the third-party application is determined to be an implementation class of the fingerprint service through the service provider object.
[0025] When it is determined that the third-party application belongs to the implementation class, the package name of the third-party application is used to determine whether the third-party application belongs to the current client in the fingerprint service that is currently being processed.
[0026] Optionally, when it is determined that the application belongs to the program corresponding to the foreground process, allowing the application to call fingerprint recognition further includes:
[0027] When the package name of the third-party application is the same as the package name corresponding to the current client, the application is allowed to call fingerprint recognition;
[0028] If the package name of the third-party application is different from the package name corresponding to the current client, the application is denied the right to use fingerprint recognition.
[0029] The present invention also proposes an application fingerprinting device, the device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the application fingerprinting method as described in any of the preceding claims.
[0030] The present invention also proposes a computer-readable storage medium storing an application fingerprint invocation program, which, when executed by a processor, implements the steps of the application fingerprint invocation method as described in any of the preceding claims.
[0031] The application fingerprinting method, device, and computer-readable storage medium of the present invention determine whether the process information variables of the current application meet the first preset condition within the fingerprint service of a preset fingerprint framework. When the variables meet the first preset condition, the application is allowed to call fingerprint recognition; when the variables do not meet the first preset condition, the application is determined to be a program corresponding to the foreground process through the active component of the top interface of the corresponding top task of the application. If the application is determined to be a program corresponding to the foreground process, the application is allowed to call fingerprint recognition; if the application is determined not to be a program corresponding to the foreground process, the application is denied to call fingerprint recognition. This achieves an application fingerprinting scheme with superior control logic, greatly improving the stability and accuracy of fingerprinting functions in various scenarios while ensuring fingerprint security, and enhancing the user experience of fingerprint functionality. Attached Figure Description
[0032] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings:
[0033] Figure 1 This is a schematic diagram of the hardware structure of a mobile terminal according to the present invention;
[0034] Figure 2 This is a flowchart of the first embodiment of the application fingerprinting method of the present invention;
[0035] Figure 3 This is a flowchart of the second embodiment of the application fingerprinting method of the present invention;
[0036] Figure 4 This is a flowchart of the third embodiment of the application fingerprinting method of the present invention;
[0037] Figure 5 This is a flowchart of the fourth embodiment of the application fingerprinting method of the present invention;
[0038] Figure 6 This is a flowchart of the fifth embodiment of the application fingerprinting method of the present invention;
[0039] Figure 7 This is a flowchart of the sixth embodiment of the application fingerprinting method of the present invention;
[0040] Figure 8 This is a flowchart of the seventh embodiment of the application fingerprinting method of the present invention;
[0041] Figure 9 This is a flowchart of the eighth embodiment of the application fingerprinting method of the present invention. Detailed Implementation
[0042] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0043] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.
[0044] Terminals can be implemented in various forms. For example, the terminals described in this invention may include mobile terminals such as mobile phones, tablets, laptops, handheld computers, personal digital assistants (PDAs), portable media players (PMPs), navigation devices, wearable devices, smart bracelets, pedometers, etc., as well as fixed terminals such as digital TVs and desktop computers.
[0045] The following description will use a mobile terminal as an example. Those skilled in the art will understand that, apart from elements specifically designed for mobile purposes, the construction according to embodiments of the present invention can also be applied to fixed-type terminals.
[0046] Please see Figure 1 This is a schematic diagram of the hardware structure of a mobile terminal implementing various embodiments of the present invention. The mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an A / V (Audio / Video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111, etc. Those skilled in the art will understand that... Figure 1 The mobile terminal structure shown does not constitute a limitation on the mobile terminal. The mobile terminal may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0047] The following is combined with Figure 1 A detailed introduction to each component of the mobile terminal:
[0048] The radio frequency unit 101 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with the processor 110; additionally, it transmits uplink data to the base station. Typically, the radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, and a duplexer. Furthermore, the radio frequency unit 101 can also communicate wirelessly with networks and other devices. The aforementioned wireless communications may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution), and TDD-LTE (Time Division Duplexing-Long Term Evolution).
[0049] WiFi is a short-range wireless transmission technology. Mobile terminals, through the WiFi module 102, can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 1 WiFi module 102 is shown, but it is understood that it is not a necessary component of a mobile terminal and can be omitted as needed without changing the nature of the invention.
[0050] The audio output unit 103 can convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into audio signals and output them as sound when the mobile terminal 100 is in call signal receiving mode, call mode, recording mode, voice recognition mode, broadcast receiving mode, etc. Furthermore, the audio output unit 103 can also provide audio output related to specific functions performed by the mobile terminal 100 (e.g., call signal receiving sound, message receiving sound, etc.). The audio output unit 103 may include a speaker, a buzzer, etc.
[0051] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos acquired by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames can be displayed on the display unit 106. The image frames processed by the GPU 1041 can be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) in operating modes such as telephone call mode, recording mode, and voice recognition mode, and can process such sound into audio data. The processed audio (voice) data can be converted into a format that can be transmitted to a mobile communication base station via the radio frequency unit 101 in telephone call mode. The microphone 1042 can implement various types of noise cancellation (or suppression) algorithms to eliminate (or suppress) noise or interference generated during the reception and transmission of audio signals.
[0052] The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1061 according to the ambient light level, and the proximity sensor can turn off the display panel 1061 and / or backlight when the mobile terminal 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, tapping), etc. Other sensors that may be configured in the phone, such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.
[0053] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0054] User input unit 107 can be used to receive input numerical or character information, and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, user input unit 107 may include touch panel 1071 and other input devices 1072. Touch panel 1071, also known as touch screen, can collect touch operations on or near the user (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near touch panel 1071), and drive corresponding connection devices according to a pre-set program. Touch panel 1071 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to processor 110, and can receive and execute commands from processor 110. In addition, touch panel 1071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may also include other input devices 1072. Specifically, other input devices 1072 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc., without being limited here.
[0055] Furthermore, the touch panel 1071 may cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of touch event. Subsequently, the processor 110 provides corresponding visual output on the display panel 1061 based on the type of touch event. Although in Figure 1 In this embodiment, the touch panel 1071 and the display panel 1061 are two independent components to realize the input and output functions of the mobile terminal. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to realize the input and output functions of the mobile terminal. The specific implementation is not limited here.
[0056] Interface unit 108 serves as an interface through which at least one external device can connect to mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. Interface unit 108 may be used to receive input (e.g., data, power, etc.) from the external device and transmit the received input to one or more elements within mobile terminal 100, or it may be used to transmit data between mobile terminal 100 and the external device.
[0057] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback, image playback, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory 109 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0058] The processor 110 is the control center of the mobile terminal. It connects various parts of the mobile terminal via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 109, and by calling data stored in the memory 109, it performs various functions and processes data of the mobile terminal, thereby providing overall monitoring of the mobile terminal. The processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 110.
[0059] The mobile terminal 100 may also include a power supply 111 (such as a battery) that supplies power to various components. Preferably, the power supply 111 can be logically connected to the processor 110 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.
[0060] although Figure 1 As not shown, the mobile terminal 100 may also include a Bluetooth module, etc., which will not be described in detail here.
[0061] Based on the above-described mobile terminal hardware structure, various embodiments of the method of the present invention are proposed.
[0062] Example 1
[0063] Figure 2 This is a flowchart of the first embodiment of the application fingerprint invocation method of the present invention. An application fingerprint invocation method includes:
[0064] In the fingerprint service of the preset fingerprint framework, it is determined whether the variable of the current application's process information meets the first preset condition;
[0065] When the variable meets the first preset condition, the application is allowed to call fingerprint recognition; when the first preset condition is not met, the application is determined to be a program corresponding to the foreground process by the active component of the top interface of the corresponding top task of the application.
[0066] When it is determined that the application belongs to the program corresponding to the foreground process, the application is allowed to call fingerprint recognition; when it is determined that the application does not belong to the program corresponding to the foreground process, the application is denied from calling fingerprint recognition.
[0067] In this embodiment, the inventors discovered that in the current fingerprint invocation scheme, determining whether a process is in the foreground by using the `proc.importance` variable of the running process information `ActivityManager.RunningAppProcessInfo` has a certain lag. Specifically, after unlocking from a screen-off state, the third-party application interface has already been invoked, but the corresponding `proc.importance` value has not yet been modified to be less than or equal to `IMPORTANCE_FOREGROUND_SERVICE`. This directly leads to the system misjudging it as a background process, thus preventing the fingerprint from being used normally.
[0068] The specific manifestation of the aforementioned technical problem is that after adding a fingerprint lock to Alipay or WeChat Work, when clicking the Alipay notification on the lock screen to enter the Alipay interface, a fingerprint unlock verification interface will pop up. However, there is a possibility that the fingerprint icon will not be displayed, meaning that fingerprint verification cannot be performed normally. Similarly, when the screen of WeChat Work is off, and fingerprint unlock returns to the WeChat Work interface, a fingerprint unlock verification interface will also pop up, but there is also a possibility that the fingerprint icon will not be displayed, thus preventing normal fingerprint verification.
[0069] In this embodiment, the inventors analyzed the situation and found that the above scenarios were caused by third-party applications running in the background that did not switch to the foreground process in time after the lock screen disappeared. Even if the application's interface was called up, the fingerprint was still rejected by the system, making it impossible to use the fingerprint normally, which greatly affected the user experience. Moreover, since this problem occurs probabilistically based on the user's actual usage, it is difficult to find and solve such problems.
[0070] In this embodiment, within the fingerprint service `FingerprintService` of the fingerprint framework, when determining whether a third-party application is a foreground process, it first checks the `proc.importance` variable of the currently running process information `ActivityManager.RunningAppProcessInfo`. If it is not a foreground process, it further checks the currently running task stack information `ActivityManager.RunningTaskInfo` to determine if the application is a foreground process. If the top interface Activity of the top task in the task stack belongs to the current third-party application, then the application is considered a foreground process, and fingerprint use is allowed. Otherwise, the application is considered a background process, and fingerprint use is not allowed. In this embodiment, after implementing the above solution, the problem of misjudging a foreground process and causing fingerprints to malfunction is resolved, thereby improving the user experience.
[0071] The beneficial effect of this embodiment is that, in the fingerprint service of the preset fingerprint framework, it determines whether the process information variable of the current application meets a first preset condition; when the variable meets the first preset condition, the application is allowed to call fingerprint recognition; when it does not meet the first preset condition, it determines whether the application belongs to the program corresponding to the foreground process through the active component of the top interface of the corresponding top task of the application; when it is determined that the application belongs to the program corresponding to the foreground process, the application is allowed to call fingerprint recognition; when it is determined that the application does not belong to the program corresponding to the foreground process, the application is denied from calling fingerprint recognition. This implements an application fingerprint calling scheme with superior control logic, greatly improving the stability and accuracy of fingerprint calling function in various scenarios while ensuring fingerprint security, and enhancing the user experience of fingerprint function.
[0072] Example 2
[0073] Figure 3 This is a flowchart of a second embodiment of the application fingerprinting method of the present invention. Based on the above embodiment, the step of determining whether the variables of the current application's process information meet the first preset condition in the fingerprint service of the preset fingerprint framework includes:
[0074] S11. When the application initiates a fingerprint recognition call request, the fingerprint service determines whether the application has fingerprint call permission.
[0075] S12. When it is determined that the application has the calling permission, it is determined whether the application is a system application or a third-party application.
[0076] Optionally, in this embodiment, the canUserFingerprint method of FingerprintService in the fingerprint service is used. In this method, the permission to use fingerprint is first determined by android.Manifest.permission.USE_FINGERPRINT in the above-mentioned canUserFingerprint method. Then, it is determined whether the application belongs to the system level application, that is, whether Binder.getCallingUid is equal to Process.SYSTEM_UID. If so, it is determined that it belongs to the system level application.
[0077] The beneficial effect of this embodiment is that, when the application initiates a fingerprint recognition call request, the fingerprint service determines whether the application has the permission to call the fingerprint; if it is determined that the application has the permission, it is determined whether the application is a system application or a third-party application. This implements an application fingerprint calling scheme with superior control logic, greatly improving the stability and accuracy of fingerprint calling functions in various scenarios while ensuring fingerprint security, and enhancing the user experience of fingerprint functionality.
[0078] Example 3
[0079] Figure 4 This is a flowchart of the third embodiment of the application fingerprinting method of the present invention. Based on the above embodiment, the step of determining whether the variable of the current application's process information meets the first preset condition in the fingerprint service of the preset fingerprint framework further includes:
[0080] S13. When it is determined that the application belongs to the third-party application, determine whether the variable is less than or equal to a preset reference value;
[0081] S14. When it is determined that the variable is less than or equal to the reference value, the variable is determined to meet the first preset condition; when it is determined that the variable is greater than the reference value, the variable is determined to not meet the first preset condition.
[0082] Optionally, in this embodiment, in the canUserFingerprint method of the fingerprint service FingerprintService, it first determines whether it is a foreground process by using Utils.isForeground(uid,pid). This method determines whether it is a foreground process by using the proc.importance variable of the running process information ActivityManager.RunningAppProcessInfo. If the value of the above proc.importance variable is less than or equal to IMPORTANCE_FOREGROUND_SERVICE 125, it is considered to be a foreground process.
[0083] The beneficial effect of this embodiment is that, when determining that the application belongs to the third-party application, it judges whether the variable is less than or equal to a preset reference value; when it is determined that the variable is less than or equal to the reference value, it is determined that the variable meets the first preset condition; when it is determined that the variable is greater than the reference value, it is determined that the variable does not meet the first preset condition. This implements an application fingerprinting scheme with superior control logic, greatly improving the stability and accuracy of fingerprinting functions in various scenarios while ensuring fingerprint security, and enhancing the user experience of fingerprint functionality.
[0084] Example 4
[0085] Figure 5 This is a flowchart of the fourth embodiment of the application fingerprinting method of the present invention. Based on the above embodiment, when the first preset condition is not met, determining whether the application belongs to the program corresponding to the foreground process through the active component of the top interface of the corresponding top task of the application includes:
[0086] S21. Add a system service acquisition method to the utility class of the fingerprint service;
[0087] S22. Obtain the current interface manager through the system service acquisition method.
[0088] Optionally, in this embodiment, an isForeground(Contextcontext,String clientPackage) method is added to the Utils utility class of the fingerprint service. This method first obtains the interface manager mActivityManager through (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE).
[0089] The beneficial effect of this embodiment is that by adding a system service acquisition method to the tool class of the fingerprint service, and obtaining the current interface manager through the system service acquisition method, a better application fingerprint invocation scheme with optimized control logic is achieved. While ensuring fingerprint security, this greatly improves the stability and accuracy of fingerprint invocation functions in various scenarios, enhancing the user experience of the fingerprint function.
[0090] Example 5
[0091] Figure 6 This is a flowchart of the fifth embodiment of the application fingerprinting method of the present invention. Based on the above embodiment, the step of determining whether the application belongs to the program corresponding to the foreground process through the active component of the top interface of the corresponding top task of the application when the first preset condition is not met further includes:
[0092] S23. Obtain the currently running task stack information through the interface manager;
[0093] S24. Obtain the top task of the task stack through the task stack information, and obtain the package name of the top interface of the top task.
[0094] Optionally, in this embodiment, the currently running task stack information ActivityManager.RunningTaskInfo is obtained through the above-mentioned mActivityManager interface manager; then the package name of the top interface topActivity of the top task in the task stack is obtained.
[0095] The beneficial effect of this embodiment is that it obtains the currently running task stack information through the interface manager; obtains the top task of the task stack through the task stack information, and obtains the package name of the top interface of the top task. This implements an application fingerprinting scheme with superior control logic, greatly improving the stability and accuracy of fingerprinting functions in various scenarios while ensuring fingerprint security, and enhancing the user experience of the fingerprint function.
[0096] Example 6
[0097] Figure 7 This is a flowchart of the sixth embodiment of the application fingerprinting method of the present invention. Based on the above embodiment, the step of determining whether the application belongs to the program corresponding to the foreground process through the active component of the top interface of the corresponding top task of the application when the first preset condition is not met further includes:
[0098] S25. When the package name is the same as the package name of the third-party application, determine that the third-party application belongs to the program corresponding to the foreground process;
[0099] S26. When the package name is different from the package name of the third-party application, determine that the third-party application does not belong to the program corresponding to the foreground process.
[0100] Optionally, in this embodiment, when the packageName of the top Activity of the top interface is equal to the package name of the application, i.e., runningTasks.get(0).topActivity.getPackageName(), it is assumed that the package name of the third-party application is equal to the package name packageName, and it is determined to be a foreground process.
[0101] Optionally, in this embodiment, when the packageName of the top Activity of the top interface is not equal to the package name of the application, i.e. when runningTasks.get(0).topActivity.getPackageName(), it is considered that the package name of the third-party application is different from the packageName, and it is determined to be a non-foreground process.
[0102] The beneficial effect of this embodiment is that, when the package name is the same as the package name of the third-party application, it is determined that the third-party application belongs to the program corresponding to the foreground process; when the package name is different from the package name of the third-party application, it is determined that the third-party application does not belong to the program corresponding to the foreground process. This implements an application fingerprinting scheme with superior control logic, greatly improving the stability and accuracy of fingerprinting functionality in various scenarios while ensuring fingerprint security, thus enhancing the user experience of the fingerprint function.
[0103] Example 7
[0104] Figure 8 This is a flowchart of the seventh embodiment of the application fingerprinting method of the present invention. Based on the above embodiment, the step of allowing the application to call fingerprint recognition when it is determined that the application belongs to the program corresponding to the foreground process includes:
[0105] S31. When it is determined that the application belongs to the program corresponding to the foreground process, obtain the service provider object in the fingerprint service, and determine whether the third-party application belongs to the implementation class of the fingerprint service through the service provider object.
[0106] S32. When it is determined that the third-party application belongs to the implementation class, the package name of the third-party application is used to determine whether the third-party application belongs to the current client in the fingerprint service that is currently in the processing state.
[0107] Optionally, in this embodiment, the service provider object ServiceProvider in FingerprintService is obtained, and it is determined whether it belongs to the fingerprint service implementation class Fingerprint21; if it does, the isCurrentClient method of Fingerprint21 is called to determine whether the third-party application belongs to the CurrentClient currently being processed.
[0108] The beneficial effect of this embodiment is that, when it is determined that the application belongs to the program corresponding to the foreground process, the service provider object in the fingerprint service is obtained, and the service provider object is used to determine whether the third-party application belongs to the implementation class of the fingerprint service; when it is determined that the third-party application belongs to the implementation class, the package name of the third-party application is used to determine whether the third-party application belongs to the current client in the fingerprint service that is currently being processed. This implements an application fingerprint invocation scheme with superior control logic, which, while ensuring fingerprint security, greatly improves the stability and accuracy of fingerprint invocation functions in various scenarios, and enhances the user experience of fingerprint functionality.
[0109] Example 8
[0110] Figure 9 This is a flowchart of the eighth embodiment of the application fingerprinting method of the present invention. Based on the above embodiment, the step of allowing the application to call fingerprint recognition when it is determined that the application belongs to the program corresponding to the foreground process further includes:
[0111] S33. When the package name of the third-party application is the same as the package name corresponding to the current client, the application is allowed to call fingerprint recognition;
[0112] S34. When the package name of the third-party application is different from the package name corresponding to the current client, the application is refused to call fingerprint recognition.
[0113] Optionally, in this embodiment, it is determined whether the third-party application package name opPackageName is equal to CurrentClient.getOwnerString. If it is equal, then it is determined that the operation fingerprint is allowed.
[0114] It is understandable that third-party applications that have enabled fingerprint recognition should be able to cancel their own fingerprint operation when they are switched to the background process. In other words, the control logic for enabling fingerprint recognition should be optimized to meet the principle of "whoever enables it, cancels it".
[0115] As can be seen, in this embodiment, the `canUserFingerprint` method of the fingerprint service `FingerprintService` uses `Utils.isForeground(uid, pid)` to determine whether it is a foreground process. This method uses the `proc.importance` variable of the running process information `ActivityManager.RunningAppProcessInfo` to determine whether it belongs to the foreground process. If `proc.importance` is less than or equal to `IMPORTANCE_FOREGROUND_SERVICE` 125, it is considered a foreground process; otherwise, the `isForeground(Context context, String clientPackage)` method already added to the fingerprint service utility class `Utils` is called to determine whether the current top interface belongs to a third-party application. If it does, it is considered a foreground process, and fingerprint use is allowed normally; otherwise, the application is considered a background process, and fingerprint use is not allowed normally. Therefore, this embodiment adds an extra layer of judgment and protection to the original system, which can more accurately determine whether a third-party application belongs to the foreground process.
[0116] The beneficial effect of this embodiment is that it allows the application to call fingerprint recognition when the package name of the third-party application is the same as the package name corresponding to the current client; and it rejects the application from calling fingerprint recognition when the package name of the third-party application is different from the package name corresponding to the current client. This implements an application fingerprint calling scheme with superior control logic, greatly improving the stability and accuracy of fingerprint calling functionality in various scenarios while ensuring fingerprint security, and enhancing the user experience of fingerprint functionality.
[0117] Example 9
[0118] Based on the above embodiments, the present invention also proposes an application fingerprinting device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the application fingerprinting method as described in any of the above embodiments.
[0119] It should be noted that the above-described device embodiments and method embodiments belong to the same concept. The specific implementation process can be found in the method embodiments, and the technical features in the method embodiments are also applicable to the device embodiments, which will not be repeated here.
[0120] Example 10
[0121] Based on the above embodiments, the present invention also proposes a computer-readable storage medium storing an application fingerprint invocation program, which, when executed by a processor, implements the steps of the application fingerprint invocation method as described in any of the above embodiments.
[0122] It should be noted that the above-described medium embodiments and method embodiments belong to the same concept. The specific implementation process can be found in the method embodiments, and the technical features in the method embodiments are also applicable to the medium embodiments, which will not be repeated here.
[0123] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0124] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0125] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0126] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. An application fingerprinting method, characterized in that, The method includes: In the fingerprint service of the preset fingerprint framework, it is determined whether the variable of the current application's process information meets the first preset condition; When the variable meets the first preset condition, the application is allowed to call fingerprint recognition; when the first preset condition is not met, the application is determined to be a program corresponding to the foreground process by the active component of the top interface of the corresponding top task of the application. When it is determined that the application belongs to the program corresponding to the foreground process, the application is allowed to call fingerprint recognition; when it is determined that the application does not belong to the program corresponding to the foreground process, the application is denied from calling fingerprint recognition. In the fingerprint service within the preset fingerprint framework, determining whether the variables of the current application's process information meet the first preset condition includes: When the application initiates a fingerprint recognition request, the fingerprint service determines whether the application has the permission to access the fingerprint. When it is determined that the application has the calling permission, it is determined whether the application is a system application or a third-party application; When it is determined that the application belongs to the third-party application, it is determined whether the variable is less than or equal to a preset reference value; When it is determined that the variable is less than or equal to the reference value, the variable is determined to meet the first preset condition; when it is determined that the variable is greater than the reference value, the variable is determined to not meet the first preset condition. When it is determined that the application belongs to the program corresponding to the foreground process, allowing the application to call fingerprint recognition includes: Obtain the service provider object in the fingerprint service, and determine whether the third-party application belongs to the implementation class of the fingerprint service through the service provider object; When it is determined that the third-party application belongs to the implementation class, the package name of the third-party application is used to determine whether the third-party application belongs to the current client in the fingerprint service that is currently being processed. When the package name of the third-party application is the same as the package name corresponding to the current client, the third-party application is allowed to call fingerprint recognition; If the package name of the third-party application is different from the package name corresponding to the current client, the third-party application's fingerprint recognition is rejected.
2. The application fingerprinting method according to claim 1, characterized in that, When the first preset condition is not met, determining whether the application belongs to the foreground process through the active component of the top interface of the corresponding top task of the application includes: Add a system service acquisition method to the utility class of the fingerprint service; The current interface manager is obtained through the system service acquisition method.
3. The application fingerprint invocation method of claim 2, wherein, The step of determining whether an application belongs to a foreground process by using the active component of the top interface of the corresponding top task of the application when the first preset condition is not met further includes: The interface manager is used to obtain the currently running task stack information; The top task of the task stack is obtained through the task stack information, and the package name of the top interface of the top task is obtained.
4. The application fingerprint invocation method of claim 3, wherein, The step of determining whether an application belongs to a foreground process by using the active component of the top interface of the corresponding top task of the application when the first preset condition is not met further includes: When the package name is the same as the package name of the third-party application, it is determined that the third-party application belongs to the program corresponding to the foreground process; If the package name is different from the package name of the third-party application, it is determined that the third-party application does not belong to the program corresponding to the foreground process.
5. An application fingerprint calling device, characterized by, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the application fingerprint invocation method as described in any one of claims 1 to 4.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an application fingerprint invocation program, which, when executed by a processor, implements the steps of the application fingerprint invocation method as described in any one of claims 1 to 4.