Skip to content
Commit 326e7338 authored by Winson's avatar Winson
Browse files

Move nested package dir checking to PackageParser2

As part of Ib05b187dc006272603709a95534c40744cd62f0c, /data/app
APKs were nested one directory further down. This makes the cacher
and parsing disagree on the actual file path representing a package.

The AndroidPackage and thus public API representation remained
correct by using the immediate parent folder containing the APKs,
usually /data/app/~~random/packageName-random.

But because PMS doesn't search its scan directories any further
than the first directory level, when it scanned /data/app, it
would submit /data/app/~~random, one parent level higher than
previous pre-R platform levels expected.

Unfortunately since this behavior is now handled by the system
gracefully, it's hard to migrate back and enforce that the right
dir is passed to PackageParser2, as several system components call
into it.

Instead, this moves the deeper child check up from the parsing
internals to PackageParser2#parsePackage, which will transform its
input packageFile to the deeper level as necessary, which preserves
the internal parsing API behavior while also ensuring that any
deeper parsing infrastucture works on a single equivalent path
to represent a package.

Bug: 243912163
Bug: 242639590

Test: presubmit

Change-Id: I089b915a7751407dbe456a32b0c6eae315d193f5
parent 1321dbed
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment