Fix: PackageInfo for apex has wrong info

Currently, ApexInfo.packageName is directly fed into PackageInfo. However,
this is wrong because ApexInfo.packageName is from apex_manifest.json,
not AndroidManifest.xml. Name in apex_manifest.json is the internal ID
of an APEX while the name in AndroidManifest.xml is the public
externally-visible name.

Fixing the issue by parsing the AndroidManifest.xml in the apex file
via PackageParser.

This change also fixes the problem that signature is not included in the
PackageInfo for APEX. It is included when GET_SIGNATURES is specified.

Bug: 123029986
Bug: 123028426
Test: adb shell cmd package list packages --apex-only --show-versioncode
Shows com.google.* names

Change-Id: I0021b302f3f4e843f79dd6d40716cefd531c5628
(cherry picked from commit 86f5652341403084a57fb7f1e51d1299c763c4f8)
5 files changed