Don't persist APEX

Invalid UID will cause parsing error in libpackagelistparser
which in turn causes the 'run-as' command to fail.

APEX packages should never be used with 'run-as'.

Bug: 225756739
Fix: 233872653
Test: atest CtsJvmtiAttachingHostTestCases
Change-Id: I2a13768f114749f60f1f61a586674a71b84635ed
This commit is contained in:
JW Wang
2022-05-26 13:44:40 +08:00
committed by Chun-Wei Wang
parent b539b72475
commit 97e150f8e6

View File

@@ -2699,6 +2699,11 @@ public final class Settings implements Watchable, Snappable {
}
continue;
}
if (pkg.getPkg().isApex()) {
// Don't persist APEX which doesn't have a valid app id and will cause parsing
// error in libpackagelistparser
continue;
}
final boolean isDebug = pkg.getPkg().isDebuggable();
final IntArray gids = new IntArray();