am edc31509: am b98ca5b0: Merge "If PackageUsage information is missing, treat as first boot and compile everything"
* commit 'edc31509c2ff8cba86f30c836934d32a3e249dec': If PackageUsage information is missing, treat as first boot and compile everything
This commit is contained in:
@@ -604,6 +604,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();
|
||||
@@ -692,6 +698,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 {
|
||||
@@ -1697,7 +1704,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