A method for calculating terminal usage time, and the terminal and storage medium thereof.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]然而此类现有技术,皆只是粗糙的统计了设备亮屏时间、或者某个应用前台使用时间,究其原因,以安卓系统为例,由于原生安卓系统只针对应用在前台时的时间提供统计支持,因此并不支持对于特定场景的使用时间做记录,比如在灭屏情况下
[0026] The method, terminal, and storage medium for calculating terminal usage time provided by this invention can accurately calculate the actual usage time of the terminal under the cross-state of all usage behaviors within a certain period of time, and is not limited by the fact that applications running in the background after the terminal screen is turned off cannot be counted, thereby providing users with a good user experience for managing their own time.
Smart Images

Figure CN117978908B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart terminal technology, and in particular to a method, system, and storage medium for calculating terminal usage time. Background Technology
[0002] With the widespread use of various mobile devices, people spend a lot of time playing on their phones every day. One important reason for this is that people don't have a clear idea of how much time they spend on their phones each day.
[0003] To address this, existing technologies have proposed several schemes for calculating mobile terminal usage time. For example, the "Terminal Usage Time Reminder Method and Device, Terminal and Storage" (Patent Application No.: 202010265255.6) proposes a scheme to obtain and accumulate the usage time of applications running in the foreground within a preset time period in order to determine the usage time.
[0004] However, existing technologies only provide rough statistics on device screen-on time or the usage time of a specific application in the foreground. The reason for this, taking Android as an example, is that the native Android system only provides statistical support for the time an application spends in the foreground, and therefore does not support recording usage time in specific scenarios, such as when the screen is off. Therefore, typical solutions cannot solve the problem of usage time statistics when the screen is off. However, some applications frequently perform other operations in the background (such as playing audio, recording, or making calls) even when the screen is off.
[0005] Therefore, accurately and reliably calculating the actual usage time of terminal devices within a certain period, including when the screen is off and when running in the background, can greatly help users manage their time. Summary of the Invention
[0006] Therefore, the main objective of this invention is to provide a method for statistically analyzing terminal usage time, as well as a terminal and storage medium, to solve the problems mentioned in the background art.
[0007] To achieve the above objective, according to a first aspect of the present invention, a method for statistically analyzing terminal usage time is provided, comprising the steps of:
[0008] Step S100: Define a custom statistical event, listen to the statistical event and record the event type, create a timestamp and name to establish an event record;
[0009] Step S200: Determine the statistical time range, obtain event records within that time range, and establish a duration calculation stack;
[0010] Step S300: When the stack is determined to be empty, according to the timeline, store the events representing the enabled state in the event record into the stack, and record the corresponding event creation timestamp as the actual start time a; when an event representing the stopped state in the event record occurs, delete the top node of the stack, and if the stack is empty after deleting the top node, record the event timestamp as the actual end time b; record the current period's statistical event usage duration as b – a;
[0011] Step S400 repeats step S300 to calculate the cumulative duration of statistical events for each period within the statistical time range.
[0012] In a possible preferred embodiment, the statistical events include: program start / stop events and system screen on / off events. Each event is recorded and written to the system data storage space through the framework interface.
[0013] In a possible preferred embodiment, the method for using the statistical terminal for a certain duration further includes the following steps:
[0014] Step S500: When there is only one statistical event or no event within the statistical time range, determine the event type after the end time point of the time range, and calculate the usage duration according to the terminal usage logic.
[0015] In a possible preferred embodiment, the step of monitoring statistical events and establishing event records includes:
[0016] The audio playback status is monitored through AudioManager.AudioPlaybackCallback. When the start / stop of audio is detected, the creation timestamp information is written to the program start / stop event.
[0017] By monitoring the current audio application process status using IProcessObserver, when the audio application is detected to be killed while it is in a playback state, the creation timestamp of the audio application being killed is written to the program stop event.
[0018] In a possible preferred embodiment, the step of monitoring statistical events and establishing event records includes:
[0019] Add an OnRecorderStatusChanged interface to the AudioRecorder layer of the system framework to listen for the status of the application using the Mic. When the start / stop status is detected, at least the creation timestamp should be written to the program start / stop event.
[0020] In a possible preferred embodiment, the step of monitoring statistical events and establishing event records includes:
[0021] Register a listener with the system to monitor changes in call status, so as to listen to the status of the call application. When the answer / hang-up status is detected, at least write the creation timestamp to the application start / stop event.
[0022] In a possible preferred embodiment, the step of monitoring statistical events and establishing event records includes:
[0023] Listen to the startOp and finishOp interfaces of the application operation management class AppOpsManager. When the application start / stop status is detected, at least the creation timestamp information should be written to the application start / stop event.
[0024] To achieve the above objectives, in accordance with the above method, according to a second aspect of the present invention, a terminal is also provided, comprising: a processor and a memory; wherein the processor is configured to execute a computer program stored in the memory to perform the steps of the method for calculating terminal usage time as described in any of the preceding claims.
[0025] To achieve the above objectives, in accordance with the above methods, according to a third aspect of the present invention, a computer-readable storage medium is also provided, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the method for calculating terminal usage time as described in any of the preceding claims are implemented.
[0026] The method, terminal, and storage medium for calculating terminal usage time provided by this invention can accurately calculate the actual usage time of the terminal under the cross-state of all usage behaviors within a certain period of time, and is not limited by the fact that applications running in the background after the terminal screen is turned off cannot be counted, thereby providing users with a good user experience for managing their own time. Attached Figure Description
[0027] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0028] Figure 1 This is a flowchart illustrating the steps of the method for calculating terminal usage time according to the present invention;
[0029] Figure 2 This is a flowchart illustrating the steps of monitoring system screen-on / off events and establishing event records in the method for statistically analyzing terminal usage time according to the present invention.
[0030] Figure 3 A flowchart illustrating the steps of monitoring audio program start / stop events and establishing event records in the method for calculating terminal usage time of the present invention;
[0031] Figure 4A flowchart illustrating the steps of monitoring the start / stop events of the Mic program and establishing event records in the method for calculating the usage time of a terminal according to the present invention;
[0032] Figure 5 This is a flowchart illustrating the steps of monitoring call program start / stop events and establishing event records in the method for statistically analyzing terminal usage time of the present invention.
[0033] Figure 6 A flowchart illustrating the steps of monitoring the start / stop event of the positioning program and establishing an event record in the method for calculating the usage time of the terminal according to the present invention;
[0034] Figure 7 This is a timeline diagram illustrating how existing technologies calculate device usage time based on the cumulative sum of time differences between system screen-on / off events.
[0035] Figures 8 to 12 In the method for calculating terminal usage time of the present invention, a timeline diagram illustrating various usage behaviors under overlapping states is provided.
[0036] Figure 13 In the method for calculating the usage time of a terminal in this invention, an example is a time axis diagram of a usage behavior crossover state using stack calculation;
[0037] Figure 14 In the method for calculating the usage time of a terminal according to the present invention, an example is a schematic diagram of the stack calculation process;
[0038] Figure 15 The present invention provides a timeline diagram illustrating various special scenarios in the method for calculating terminal usage time. Detailed Implementation
[0039] To enable those skilled in the art to better understand the technical solutions of the present invention, the specific technical solutions of the present invention will be clearly and completely described below in conjunction with embodiments, so as to help those skilled in the art further understand the present invention. Obviously, the embodiments described in this application are merely some embodiments of the present invention, and not all embodiments. It should be noted that, for those skilled in the art, the embodiments and features in the embodiments of this application can be combined with each other without departing from the concept of the present invention and without conflict. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the disclosure and protection scope of the present invention.
[0040] Furthermore, the terms "first," "second," "S100," "S200," etc., used in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such features can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those described herein. At the same time, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. Unless otherwise expressly specified and limited, the terms "set," "arranged," "installed," "connected," and "linked" should be interpreted broadly, for example, as a fixed connection, a detachable connection, or an integral connection; a mechanical connection or an electrical connection; a direct connection or an indirect connection through an intermediate medium; or a connection within two elements. Those skilled in the art can understand the specific meaning of the above terms in this case based on the specific circumstances and in conjunction with existing technology.
[0041] The terminals mentioned in the examples of this invention include: mobile phones, tablet computers, smart TVs, smartwatches, in-vehicle systems, and other smart devices that have a display screen and can run an operating system to execute application tasks.
[0042] Since the native Android system lacks a method for recording device usage time, current techniques typically involve listening to the system's screen-on / off broadcasts to mark these operations, recording and tracking them. Then, the cumulative sum of the time differences between each screen-on and screen-off event is calculated as the device's usage time. Figure 7 As shown, the sum of time segments ①②...N is the total usage time within that time segment.
[0043] However, in situations where background services continue even when the screen is off, such as listening to music, location services, recording audio, or making phone calls, the timestamps of the screen-off operation and background services overlap. This makes it impossible to accurately calculate the time spent running in the background while the screen is off. But this unquantifiable time is precisely what constitutes the actual usage time of the terminal device.
[0044] Therefore, in order to accurately and reliably calculate the actual usage time of terminal devices within a certain period, including screen-off and background operation, such as... Figures 1 to 6 As shown, the method for calculating terminal usage time provided by this invention mainly includes the following steps:
[0045] Step S100: Define a custom statistical event, listen to the statistical event and record the event type, create a timestamp and name to establish an event record.
[0046] Specifically, taking the Android system as an example, the preferred examples of custom statistical events in this invention include: program start event, program stop event, system screen on event, and system screen off event. The classification of these four events can basically cover the usage scenarios of the terminal. In order to distinguish the events and use them for subsequent usage time statistics, each statistical event will record the event information after it is listened to, including: type, creation timestamp, and name information.
[0047] The event type (enentType) is used to record the start / stop state of the event, such as the system screen on / off state or the program start / stop state; the event creation timestamp (timeStamp) is used to record the timestamp when the event was created in the start / stop state; and the event name (packageName) serves as the unique identifier of the application.
[0048] The following is as follows Figures 2 to 6 As shown, this example illustrates the process of listening to various statistical events to establish an event log.
[0049] Monitor system screen on / off events:
[0050] like Figure 2 As shown, in this example, it is preferable to listen to the system screen on / off broadcast (ACTION_SCREEN_ON / ACTION_SCREEN_OFF) and inject the corresponding system screen on / off event information (screen_on / screen_off) into the system's screen on / off monitoring point by adding a custom interface reportEventStaus(intenentType) method to complete the event recording.
[0051] Listen for audio program start / stop events:
[0052] like Figure 3 As shown, first, a listener for audio playback is registered with the system. For example, through AudioManager.AudioPlaybackCallback, the system can listen for applications that start or pause playback. If the application starts playing, the audio program start event bg_play is recorded. If the application pauses playback, the audio program stop event bg_stop is recorded. Then, the newly added reportStatusEvent interface is used to inject the corresponding event information into the system to complete the event recording.
[0053] In addition, since application processes can be forcibly killed, such as when a music playback process is forcibly killed, the listener will not be able to detect when the music playback stops. Therefore, it is also necessary to register a process-killing listener (IProcessObserver) with the system. When an application is killed while it is playing music, the audio program stops the event bg_stop. Then, the newly added reportStatusEvent interface is used to inject the corresponding event information into the system to complete the event recording.
[0054] Monitor the start / stop events of the recording program:
[0055] like Figure 4 As shown, since the system does not natively have a listener for changes in recording status, this example adds an OnRecorderStatusChanged function to the AudioRecorder layer of the system framework. By listening to this interface, similar to listening to the start / stop events of an audio program, it records the start / stop status events of the application currently occupying the microphone focus. This allows the corresponding event information to be injected into the system using the reportStatusEvent interface, thus completing the event recording.
[0056] Listen for call start / stop events:
[0057] like Figure 5 As shown, a listener (PhoneStateListener) is registered with the system to monitor changes in call status. This listener can detect changes in call status. If the call starts (CALL_STATE_OFFHOOK), the call program starts event (call_start) is recorded. If the call stops, the call program stops event (call_stop) is recorded. The corresponding event information is then injected into the system using the reportStatusEvent interface to complete the event recording.
[0058] Listen for start / stop events of the location program:
[0059] like Figure 6 As shown, screen-off location tracking is a common everyday usage scenario, and the native Android system does not have an interface for recording location status changes. The inventors considered that for runtime permissions like location tracking, which involve hardware access, third-party applications typically perform permission checks in the native system using the following method in AppOpsManager.java (the application operation management class):
[0060] startOp(@NonNull String op, int uid, @NonNull String packageName);
[0061] Similarly, when third-party applications stop using the location service, they will call the following interface to release it:
[0062] finishOp(@NonNull String op, int uid, @NonNull String packageName);
[0063] Therefore, based on the above two characteristics, the corresponding location program start / stop status events can be recorded when the location service starts and stops, that is, when the above interface is called synchronously, and the corresponding event information can be injected into the system using the reportStatusEvent interface to complete the event recording.
[0064] Furthermore, in a preferred embodiment, each event in this example is preferably recorded in the system data storage space through a framework interface to avoid data loss in the event of terminal restart or other situations.
[0065] After obtaining the event records from step S100, the usual practice is to establish calculation formulas based on the timeline for different usage scenarios to calculate the usage duration, for example:
[0066] Assumption:
[0067] screen_off1: indicates the first time the device screen went off (and so on);
[0068] screen_on1: indicates the first time the device screen turns on (and so on);
[0069] bg_start1: indicates the first start point of the background audio service (and so on);
[0070] bg_stop1: indicates the first time the background audio service stops (and so on).
[0071] like Figure 8 The diagram shows a scenario where the screen on / off time and background service usage time do not overlap or overlap within the timeline. In this scenario, there are three usage periods, with a total usage time of: screen_off1 – screen_on1 + bs_top1 – bs_start1 + screen_off2 – screen_on1.
[0072] like Figures 9 to 10The diagram shows scenarios where the screen-on / off time periods overlap with the background service usage time periods within the timeline. Figure 9 In the scenario shown, the total usage time is: screen_off2 - screen_on1. Figure 10 In the scenario shown, the total usage time is: bg_stop2 - bg_start1.
[0073] like Figures 11 to 12 The diagram shows scenarios where the screen-on / off time period and the background service usage time period overlap within the timeline. Figure 11 The scenario shown illustrates a background usage period that includes the screen-on / off time period. The total usage time in this scenario is: screen_off1 - screen_on1; while Figure 12 The scenario shown includes the screen-on / off time period within the background usage time period. The total usage time in this scenario is: bg_stop1 - bg_start1.
[0074] Based on the above calculation logic, it can be known that Figures 8 to 12 The five calculation schemes shown cover the more common terminal usage scenarios. Generally speaking, the usage time in these scenarios can be calculated by establishing a logical calculation formula for each scenario. However, this calculation method is relatively cumbersome and primitive.
[0075] To this end, the present invention designs a duration calculation stack scheme to cleverly and efficiently calculate the actual usage duration of the terminal within a preset time range based on the event records obtained in step S100.
[0076] The stack scheme for calculating this duration includes:
[0077] Step S200: Determine the statistical time range, obtain event records within the time range, and establish a duration calculation stack.
[0078] In step S300, when the stack is determined to be empty, events representing the enabled state (such as screen-on events and program start events) in the event record are stored in the stack according to the timeline order, and the corresponding event creation timestamp is recorded as the actual start time a; when an event representing the stopped state (such as screen-off events and program stop events) occurs in the event record, the top node of the stack is deleted, and if the stack is empty after deleting the top node, the timestamp of the event is recorded as the actual end time b; the usage duration of the current statistical event is recorded as b – a.
[0079] Step S400 repeats step S300 to calculate the cumulative duration of statistical events for each period within the statistical time range.
[0080] Specifically, in scenarios where there is overlap and inclusion between screen-on / off time periods and background computing services, the key to calculating the usage time of a terminal in the first phase is to confirm the true start and end times of the terminal's usage in the first phase.
[0081] The following example demonstrates the calculation logic for calculating the duration of a music application's first-phase usage time using a duration calculation stack.
[0082] The first step is to set the time range to be counted, and then find the statistical events and their information within that time range in the event log.
[0083] The second step is to store the screen_on or bg_start nodes into the stack when screen_on or bg_start is detected. When the stack is empty, the time of screen_on or bg_start is recorded as the real start time of the application in the first phase, which is also the time of the bottom node of the stack.
[0084] Third, when screen_off or bg_stop is detected, the top node of the stack is deleted. If the stack is empty after deleting the top node, then screen_off and bg_stop represent the actual end time of the first phase of application use, and are set as real_stop. At this point, the first phase of application use time is real_stop – real_start.
[0085] Fourth, repeat steps two and three until all application time points within the time range have been calculated. Finally, after summing them up, the actual usage time of the terminal within that time range can be calculated.
[0086] To demonstrate the validity of the aforementioned duration calculation stack, such as Figure 13 The example illustrates a terminal usage scenario: the screen is turned on, a background service is started while the screen is on, the screen is turned off, then the screen is turned on again, the background service is stopped while the screen is on, the screen is turned on again and the background service is started again, the screen is turned off again after a while, and finally the background service is stopped again. Therefore, the actual time used by this application should be from screen_on1 to bg_stop2 = bg_stop2 – screen_on1.
[0087] like Figure 14 The diagram illustrates the derivation process for calculating the stack duration. The final result shows that within this timeframe, the terminal's usage duration is bg_stop2 – screen_on1, which is consistent with... Figure 13 The scenario depicted is consistent with the description.
[0088] On the other hand, such as Figure 15As shown, there are also some special scenarios that require additional special processing by the algorithm. Therefore, this invention further designs some supplementary steps to expand the applicable statistical range, such as:
[0089] Step S500: When there is only one statistical event or no event within the statistical time range, determine the event type after the end time point of the time range, and calculate the usage duration according to the terminal usage logic.
[0090] Specifically, the usage logic is as follows:
[0091] exist Figure 15 In scenario ①, when there is only one system screen-on event within the statistical time range, it is determined whether there is a program start / stop event after the end time point of the time range; if there is a program stop event, the actual usage time is the duration of the statistical time range; if there is a program start event, the actual usage time is end - screen_on.
[0092] exist Figure 15 In this scenario, when there is only one system screen-off operation (screen_off) within the statistical time range, it is determined whether there is a program start / stop event after the end time point of the time range. If there is a program start event, the actual usage time is screen_off minus the start time of the time range. If there is a program stop event, the actual usage time is the duration of the statistical time range.
[0093] exist Figure 15 In this scenario, if there is only one program start event, such as bg_start, within the statistical time range, it is determined whether there is a system screen-on event (screen_on) or screen-off event (screen_off) after the end time point of the time range. If there is a system screen-on event, the actual usage time is end - bg_start; if there is a system screen-off event, the actual usage time is the duration of the statistical time range.
[0094] exist Figure 15 In this scenario, if there is only one program stop event, such as bg_stop, within the statistical time range, it is determined whether there is a system screen-on event (screen_on) or screen-off event (screen_off) after the end time point of the time range. If there is a system screen-off event, the actual usage time is the duration of the statistical time range. If there is a system screen-on event, the actual usage time is bg_stop - the start time of the time range.
[0095] exist Figure 15In this scenario, when there are no events within the statistical time range, it checks if there are any screen_off, screen_on, bg_start, or bg_stop events after the end time point of the time range. If there is a screen_off or bg_stop event, the actual usage time is the duration of the statistical time range. If there is a screen_on event and the next event is bg_stop, the actual usage time is the duration of the statistical time range; otherwise, the actual usage time is 0. If there is a bg_start event and the next event is screen_off, the actual usage time is the duration of the statistical time range; otherwise, the actual usage time is 0.
[0096] On the other hand, corresponding to the above method, the present invention also provides a terminal, which includes: a processor and a memory; wherein the processor is used to execute a computer program stored in the memory to perform the steps of the method for calculating terminal usage time as described in any of the above claims.
[0097] On the other hand, in accordance with the above method, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the steps of the method for calculating terminal usage time as described in any of the preceding claims.
[0098] In summary, the method, terminal, and storage medium for calculating terminal usage time provided by this invention can accurately calculate the actual usage time of the terminal under the cross-state of all usage behaviors within a certain period of time, and is not limited by the inability to calculate the usage time when the terminal screen is off and the application is running in the background. This provides users with a good user experience for managing their own time.
[0099] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The present invention is limited only by the claims and their full scope and equivalents. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
[0100] Those skilled in the art will understand that, besides implementing the system, apparatus, unit, and its modules provided by this invention in purely computer-readable program code, the same program can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system, apparatus, and its modules provided by this invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; alternatively, modules for implementing various functions can be considered both software programs implementing the method and structures within the hardware component.
[0101] Furthermore, all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a microcontroller, chip, or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0102] Furthermore, various different implementations of the present invention can be combined arbitrarily, as long as they do not violate the spirit of the present invention, they should also be regarded as the content disclosed in the present invention.
Claims
1. A method for statistically analyzing terminal usage time, comprising the following steps: Step S100: Custom statistical events include: program start / stop events and system screen on / off events. Listen to statistical events and record event type, create timestamp, and name to establish event records. Step S200: Determine the statistical time range, obtain event records within that time range, and establish a duration calculation stack; Step S300: When the stack is determined to be empty, according to the timeline, store the events representing the enabled state in the event record into the stack, and record the corresponding event creation timestamp as the actual start time a; when an event with the same event type and name representing the stopped state occurs, delete the top node of the stack, and if the stack is empty after deleting the top node, record the event timestamp as the actual end time b; record the current period's statistical event usage duration as b – a; Step S400 repeats step S300 to calculate the cumulative duration of statistical events for each period within the statistical time range.
2. The method for statistically analyzing terminal usage time according to claim 1, wherein the program start / stop events and system screen on / off events in the statistical events are recorded and written to the system data storage space through a framework interface.
3. The method for calculating terminal usage time according to claim 1, wherein the steps further include: Step S500: When there is only one statistical event or no event within the statistical time range, determine the event type after the end time point of the time range, and calculate the usage duration according to the terminal usage logic.
4. The method for calculating the usage time of a terminal according to claim 2, wherein the step of monitoring statistical events and establishing event records includes: The audio playback status is monitored through AudioManager.AudioPlaybackCallback. When the start / stop of audio is detected, the creation timestamp information is written to the program start / stop event. By monitoring the current audio application process status using IProcessObserver, when the audio application is detected to be killed while it is in a playback state, the creation timestamp of the audio application being killed is written to the program stop event.
5. The method for calculating the usage time of a terminal according to claim 2, wherein the step of monitoring statistical events and establishing event records includes: Add an OnRecorderStatusChanged interface to the AudioRecorder layer of the system framework to listen for the status of the application using the Mic. When the start / stop status is detected, at least the creation timestamp should be written to the program start / stop event.
6. The method for calculating the usage time of a terminal according to claim 2, wherein the step of monitoring statistical events and establishing event records includes: Register a listener with the system to monitor changes in call status, so as to listen to the status of the call application. When the answer / hang-up status is detected, at least write the creation timestamp to the application start / stop event.
7. The method for calculating the usage time of a terminal according to claim 2, wherein the step of monitoring statistical events and establishing event records includes: Listen to the startOp and finishOp interfaces of the application operation management class AppOpsManager. When the application start / stop status is detected, at least the creation timestamp information should be written to the application start / stop event.
8. A terminal comprising: A processor and a memory; wherein the processor is configured to execute a computer program stored in the memory to perform the steps of the method for calculating terminal usage time as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method for calculating terminal usage time as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Terminal use duration reminding method and device thereof, terminal and storage medium
CN111479016A
Method and device for acquiring application usage data and terminal equipment
CN106293445A
Terminal use time management method and device
CN106326065A