am 0b0a52c1: am 09d11896: am edc31509: am b98ca5b0: Merge "If PackageUsage information is missing, treat as first boot and compile everything"
* commit '0b0a52c1ce381bdef2b857f850f1030a8bd3a50e': If PackageUsage information is missing, treat as first boot and compile everything
This commit is contained in:
@@ -613,6 +613,12 @@ public class PackageManagerService extends IPackageManager.Stub {
|
||||
private final AtomicLong mLastWritten = new AtomicLong(0);
|
||||
private final AtomicBoolean mBackgroundWriteRunning = new AtomicBoolean(false);
|
||||
|
||||
private boolean mIsFirstBoot = false;
|
||||
|
||||
boolean isFirstBoot() {
|
||||
return mIsFirstBoot;
|
||||
}
|
||||
|
||||
void write(boolean force) {
|
||||
if (force) {
|
||||
write();
|
||||
@@ -701,6 +707,7 @@ public class PackageManagerService extends IPackageManager.Stub {
|
||||
pkg.mLastPackageUsageTimeInMills = timeInMillis;
|
||||
}
|
||||
} catch (FileNotFoundException expected) {
|
||||
mIsFirstBoot = true;
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, "Failed to read package usage times", e);
|
||||
} finally {
|
||||
@@ -1745,7 +1752,7 @@ public class PackageManagerService extends IPackageManager.Stub {
|
||||
|
||||
@Override
|
||||
public boolean isFirstBoot() {
|
||||
return !mRestoredSettings;
|
||||
return !mRestoredSettings || mPackageUsage.isFirstBoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user