Fix the FLAG_INSTALLED for factory APEXes

To be consistent with the behavior of system apks. APEX is always
preloaded and can never be fully uninsalled.

Fix PackageManager#getInstalledPackages for there is no more
uninstalled APEX. Inactive APEX is still considered installed.

Bug: 226514467
Bug: 225756739
Test: atest com.android.server.pm.ApexManagerTest
Change-Id: I784071caee2366f984bd5a1f98a0a575e4c9baf6
6 files changed