Skip to content

Commit

Permalink
Fix background PackageUsage writing.
Browse files Browse the repository at this point in the history
Change-Id: Ia358b61e648b427c86cf75ae096cd2a68ace209f
  • Loading branch information
bdcgoogle committed May 12, 2014
1 parent f6c9c42 commit 112a720
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ boolean isFirstBoot() {

void write(boolean force) {
if (force) {
write();
writeInternal();
return;
}
if (SystemClock.elapsedRealtime() - mLastWritten.get() < WRITE_INTERVAL
Expand All @@ -623,7 +623,7 @@ void write(boolean force) {
@Override
public void run() {
try {
write(true);
writeInternal();
} finally {
mBackgroundWriteRunning.set(false);
}
Expand All @@ -632,7 +632,7 @@ public void run() {
}
}

private void write() {
private void writeInternal() {
synchronized (mPackages) {
synchronized (mFileLock) {
AtomicFile file = getFile();
Expand Down Expand Up @@ -4219,7 +4219,7 @@ public boolean performDexOpt(String packageName, boolean updateUsage) {
if (updateUsage) {
p.mLastPackageUsageTimeInMills = System.currentTimeMillis();
}
mPackageUsage.write();
mPackageUsage.write(false);
if (!p.mDexOptNeeded) {
return false;
}
Expand Down

0 comments on commit 112a720

Please sign in to comment.