summaryrefslogtreecommitdiffstats
path: root/tests/UsageStatsTest
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2014-09-11 08:31:05 -0700
committerAdam Lesinski <adamlesinski@google.com>2014-09-11 18:39:01 -0700
commit66143fa5b34eea7413335111838fb692987b611a (patch)
tree81c625a519316ba1d499ad5f28ed46ee2bccfaa3 /tests/UsageStatsTest
parent023b6812abbca465773acd6141ff672d525a83ee (diff)
downloadframeworks_base-66143fa5b34eea7413335111838fb692987b611a.zip
frameworks_base-66143fa5b34eea7413335111838fb692987b611a.tar.gz
frameworks_base-66143fa5b34eea7413335111838fb692987b611a.tar.bz2
UsageStats should deal with changing time
When the system time is changed, the UsageStats API will modify all existing entries to correspond with the new time change. If the time changed when the device was off, stats in the future will be deleted. Change-Id: Ica3e9917d4d1a180f97700e52ab390e3673e1e82
Diffstat (limited to 'tests/UsageStatsTest')
-rw-r--r--tests/UsageStatsTest/src/com/android/tests/usagestats/UsageLogActivity.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/UsageStatsTest/src/com/android/tests/usagestats/UsageLogActivity.java b/tests/UsageStatsTest/src/com/android/tests/usagestats/UsageLogActivity.java
index 31e7c38..d9a3b61 100644
--- a/tests/UsageStatsTest/src/com/android/tests/usagestats/UsageLogActivity.java
+++ b/tests/UsageStatsTest/src/com/android/tests/usagestats/UsageLogActivity.java
@@ -86,7 +86,10 @@ public class UsageLogActivity extends ListActivity implements Runnable {
}
mEvents.addFirst(event);
}
- notifyDataSetChanged();
+
+ if (lastTimeStamp != 0) {
+ notifyDataSetChanged();
+ }
return lastTimeStamp;
}