Relax locking for startActivityInPackage().

Both startActivityInPackage() and startActivitiesInPackage()
eventually call through to resolveActivity(), which might need to
acquire the AM lock.

The remainder of ActivityStarter.execute() already acquires the
WM lock when needed, so it should be safe to drop it from the overall
method.  Add additional guarding to ensure that this doesn't regress
in the future.

Bug: 115619667, 157863128
Test: atest WmTests:ActivityStarterTests
Test: atest FrameworksServicesTests:com.android.server.uri
Test: atest CtsAppSecurityHostTestCases:android.appsecurity.cts.AppSecurityTests#testPermissionDiffCert
Test: atest CtsWindowManagerDeviceTestCases:CrossAppDragAndDropTests
Test: atest CtsWindowManagerDeviceTestCases:ActivityStarterTests
Change-Id: Ia1693873a10d11ea61a8a7748e0558beffda8c5b
(cherry picked from commit 13a7cf7044a95f105a693d1c3943441de9c3c99a)
2 files changed