Loading
Fix appMetadataFilePath when restoring system app
When restoring a disabled system app the appMetadataFilePath field was not being copied over from the disabled PackageSetting to the new PackageSetting. This is now copied over in enableSystemPackageLPw. The appMetadataFilePath was also being set in commitPackageSettings which is shared code path for both installs and restores. This was causing the appMetadataFilePath to be set to null when restoring. Moved the relevant code instead to commitPackagesLocked so that it only sets for installs and not restores. Also added GET_APP_METADATA permission check to guard the get-app-metadata adb command. Bug: 281589646 Test: Manual Test: atest android.packageinstaller.install.cts.InstallAppMetadataTest Change-Id: I69b90d61b1f53f8eaefc2adf719eca99f77e81ea