Skip to content
Commit 7cc9d2d1 authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Initialize lastUsedElapsedTime to Integer.MIN_VALUE.

Since 'lastUsedElapsedTime' indicates the timestamp at which
the app was last used by the user and this isn't necessarily
the reason why we create AppUsageHistory objects, we shouldn't
be initializing the 'lastUsedElapsedTime' to the timestamp at
which the object is being created.

Also, update 'lastPredictedTime' to Integer.MIN_VALUE as
getElapsedTime() time doesn't return predictable values for
timestamps in the past and passing getElapsedTime(0) isn't
accurate as it basically indicates the timestamp at boot.

Bug: 206518483
Test: atest tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java
Change-Id: Ib90b435b1efc34144f0461aaaf339fc6037ecdc2
parent 8fb55d41
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment