android: Async setupConnection binder call

Make setupConnection oneway/async. Add a ICallbackInt interface to
return the PID of the child process. The reply is then posted back to
launcher thread. Connection setup is already mostly async so only
involves moving related code to the reply callback.

One caveat is that getCallingPid no longer works and just returns 0
for oneway calls. The pid check is not strictly necessary, so dropped
the from setupConnection instead.

BUG=689758, 690118

Review-Url: https://codereview.chromium.org/2810433002
Cr-Commit-Position: refs/heads/master@{#463332}
Committed: https://chromium.googlesource.com/chromium/src/+/39c7bd71dc2f9c9f692dd346e4e4e525af25ede1

Reland contains fix for flaky test. The pid is received asynchronously
now, so wait for it after allocating a connection.

Review-Url: https://codereview.chromium.org/2810433002
Cr-Commit-Position: refs/heads/master@{#463419}


CrOS-Libchrome-Original-Commit: 03ee275e219a1dd9ab281452507aeb7357c6f4c7
2 files changed
tree: 41b8bccb97e0f1b6b61f40b190258474685c1351
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/