Make 12 PackageManagerService APIs lock-free

Bug: 161323622

The following public PackageManagerService APIs are handled by the
snapshot computer.  They operate on read-only PackageManagerService
state, as captured in the Snapshot class.
 * checkUidPermission
 * getActivityInfo
 * getApplicationInfo
 * getInstalledPackages
 * getInstantAppPackageName
 * getPackage
 * getPackage
 * getPackageInfo
 * getPackageSetting
 * getPackagesForUid
 * getServiceInfo
 * isInstantApp

The ComputerEngine class is a closure over the functions and state
required by the above APIs.  The closure consists of 64 functions.
The code for the 64 functions is moved into the ComputerEngine class.
The code is not modified except that any synchronized blocks are
deleted.  The corresponding PackageManagerService functions are now
implemented as calls into ComputerEngine.  If the PMS function is one
of the above eight, then the call is into the snapshot engine.
Otherwise the call is into the "live" engine, which operates directly
on PackageManagerService state.

Functions that are delegated to the snapshot engine are tagged with a
"// SNAPSHOT" comment.

Test: atest
 * FrameworksServicesTests:UserSystemPackageInstallerTest
 * FrameworksServicesTests:PackageManagerSettingsTests
 * FrameworksServicesTests:PackageManagerServiceTest
 * FrameworksServicesTests:AppsFilterTest
 * FrameworksServicesTests:PackageInstallerSessionTest
 * FrameworksServicesTests:ScanTests

Change-Id: Idb31622e14fa3aca60ff5de0fa76b85c65716f64
1 file changed