Merge "Fix high traffic PMS lockless methods" into tm-dev am: f3f7f92eaf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18913289 Change-Id: I912c22471ecbf1ea4fc39fbaa204bdbde8712af4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -418,7 +418,9 @@ public final class AppsFilterImpl extends AppsFilterLocked implements Watchable,
|
|||||||
} else if (changed) {
|
} else if (changed) {
|
||||||
invalidateCache("grantImplicitAccess: " + recipientUid + " -> " + visibleUid);
|
invalidateCache("grantImplicitAccess: " + recipientUid + " -> " + visibleUid);
|
||||||
}
|
}
|
||||||
onChanged();
|
if (changed) {
|
||||||
|
onChanged();
|
||||||
|
}
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2859,12 +2859,15 @@ public class PackageManagerService implements PackageSender, TestUtilityService
|
|||||||
mDexOptHelper.performPackageDexOptUpgradeIfNeeded();
|
mDexOptHelper.performPackageDexOptUpgradeIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void notifyPackageUseInternal(String packageName, int reason) {
|
private void notifyPackageUseInternal(String packageName, int reason) {
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
commitPackageStateMutation(null, packageName, packageState -> {
|
synchronized (mLock) {
|
||||||
packageState.setLastPackageUsageTime(reason, time);
|
final PackageSetting pkgSetting = mSettings.getPackageLPr(packageName);
|
||||||
});
|
if (pkgSetting == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
pkgSetting.getPkgState().setLastPackageUsageTimeInMills(reason, time);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*package*/ DexManager getDexManager() {
|
/*package*/ DexManager getDexManager() {
|
||||||
|
|||||||
@@ -79,7 +79,10 @@ public class PackageStateUnserialized {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
getLastPackageUsageTimeInMills()[reason] = time;
|
getLastPackageUsageTimeInMills()[reason] = time;
|
||||||
mPackageSetting.onChanged();
|
// TODO(b/236180425): This method does not notify snapshot changes because it's called too
|
||||||
|
// frequently, causing too many re-takes. This should be moved to a separate data structure
|
||||||
|
// or merged with the general UsageStats to avoid tracking heavily mutated data in the
|
||||||
|
// package data snapshot.
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user