eclair snapshot

This commit is contained in:
Jean-Baptiste Queru
2009-11-12 18:45:53 -08:00
parent 6c63ee4fc4
commit 9db3d07b96
3587 changed files with 991748 additions and 69172 deletions

View File

@@ -381,7 +381,10 @@ public final class UsageStatsService extends IUsageStats.Stub {
mFileLeaf = getCurrentDateStr(FILE_PREFIX);
// Copy current file to back up
File backupFile = new File(mFile.getPath() + ".bak");
mFile.renameTo(backupFile);
if (!mFile.renameTo(backupFile)) {
Log.w(TAG, "Failed to persist new stats");
return;
}
try {
// Write mStats to file
writeStatsFLOCK();
@@ -695,7 +698,14 @@ public final class UsageStatsService extends IUsageStats.Stub {
if (NC > 0) {
for (Map.Entry<String, TimeStats> ent : pus.mLaunchTimes.entrySet()) {
sb.append("A:");
sb.append(ent.getKey());
String activity = ent.getKey();
if (activity.startsWith(pkgName)) {
sb.append('*');
sb.append(activity.substring(
pkgName.length(), activity.length()));
} else {
sb.append(activity);
}
TimeStats times = ent.getValue();
sb.append(',');
sb.append(times.count);