diff options
author | Brian Carlstrom <bdc@google.com> | 2014-06-19 09:38:06 -0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2014-06-20 12:53:19 -0700 |
commit | 0547ce55ebb2754c69cabe2b8c4687139b87cd5e (patch) | |
tree | 7d8687e81086338307bacbc842003954aa329ab5 /services | |
parent | b02dadd47c20b65569413cb4575c6050fe7b609f (diff) | |
download | frameworks_base-0547ce55ebb2754c69cabe2b8c4687139b87cd5e.zip frameworks_base-0547ce55ebb2754c69cabe2b8c4687139b87cd5e.tar.gz frameworks_base-0547ce55ebb2754c69cabe2b8c4687139b87cd5e.tar.bz2 |
Treat missing package usage data as a separate case
Bug: 15520936
Change-Id: I8e1c6921973f84af7ee94de91721cc4a3436ebaf
Diffstat (limited to 'services')
-rwxr-xr-x | services/java/com/android/server/pm/PackageManagerService.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index 2dad8ab..7d018ba 100755 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -604,10 +604,10 @@ public class PackageManagerService extends IPackageManager.Stub { private final AtomicLong mLastWritten = new AtomicLong(0); private final AtomicBoolean mBackgroundWriteRunning = new AtomicBoolean(false); - private boolean mIsFirstBoot = false; + private boolean mIsHistoricalPackageUsageAvailable = true; - boolean isFirstBoot() { - return mIsFirstBoot; + boolean isHistoricalPackageUsageAvailable() { + return mIsHistoricalPackageUsageAvailable; } void write(boolean force) { @@ -698,7 +698,7 @@ public class PackageManagerService extends IPackageManager.Stub { pkg.mLastPackageUsageTimeInMills = timeInMillis; } } catch (FileNotFoundException expected) { - mIsFirstBoot = true; + mIsHistoricalPackageUsageAvailable = false; } catch (IOException e) { Log.w(TAG, "Failed to read package usage times", e); } finally { @@ -1677,7 +1677,7 @@ public class PackageManagerService extends IPackageManager.Stub { @Override public boolean isFirstBoot() { - return !mRestoredSettings || mPackageUsage.isFirstBoot(); + return !mRestoredSettings; } @Override @@ -4124,7 +4124,7 @@ public class PackageManagerService extends IPackageManager.Stub { // The exception is first boot of a non-eng device, which // should do a full dexopt. boolean eng = "eng".equals(SystemProperties.get("ro.build.type")); - if (eng || !isFirstBoot()) { + if (eng || (!isFirstBoot() && mPackageUsage.isHistoricalPackageUsageAvailable())) { // TODO: add a property to control this? long dexOptLRUThresholdInMinutes; if (eng) { |