AM: Fix deadlock when calling AMS from ATMS/WM

Instead of calling AMS synchronously, release the wm lock and pass it to AMS. Wait for AMS to
notify us when its done.

Fixes: 119265867, 119275681
Test: adb shell am start-activity -S -W com.google.android.apps.maps/com.google.android.maps.MapsActivity
Test: atest CtsSampleHostTestCases
Change-Id: Idc2895c14ccd92524e88ce3dda24b3d0e8dce2c1
3 files changed