Track the correct package manager field

Static shared libraries were not being properly tracked and snapshotted.
This meant that any lookups that didn't involve the live data structure
were incorrect; it was as if the platform had no static shared libraries
at all.

Fixes: 189851804
Bug: 188661399
Bug: 189851804
Test: atest StaticSharedLibsHostTests
Change-Id: Ia48cf95903bfc8ad194890b5408c8b1f96793ec4
This commit is contained in:
Todd Kennedy
2021-06-01 21:24:29 -07:00
committed by Patrick Baumann
parent ee4d86d0c1
commit 6fe434da81

View File

@@ -1413,8 +1413,8 @@ public class PackageManagerService extends IPackageManager.Stub
mStaticLibsByDeclaringPackage = new WatchedArrayMap<>();
private final SnapshotCache<WatchedArrayMap<String, WatchedLongSparseArray<SharedLibraryInfo>>>
mStaticLibsByDeclaringPackageSnapshot =
new SnapshotCache.Auto<>(mSharedLibraries, mSharedLibraries,
"PackageManagerService.mSharedLibraries");
new SnapshotCache.Auto<>(mStaticLibsByDeclaringPackage, mStaticLibsByDeclaringPackage,
"PackageManagerService.mStaticLibsByDeclaringPackage");
// Mapping from instrumentation class names to info about them.
@Watched