Fix backup & restore CTS

There were two issues:
- "bmgr restore" didn't actually wait until restore finishes.
Fixed in Ice381dc250e2d2a59cff48152dd3c8d6897d0804.

- In the est, we uninstall the test package and run a restore, but there
was no guarantee that all the package broadcasts would be handled
before the restore.  If a package removed broadcast arrives after the
restore, it'll erase the restored data.
So, wait until all shortcuts are removed from the shortcut manager
before starting a restore.

Bug: 37246838
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutHostTestCases -t android.content.pm.cts.shortcuthost.ShortcutManagerBackupTest
Change-Id: I14288f2a470d31b81a6c89abe63565d442a29c08
1 file changed