Handle the case where root task could be null.

- If a root task is quickly destroyed, conerting its token to task
  object will return null.
- Handle that case as it happens in a few Activity related tests.

Bug: 297060765
Bug: 299972488
Test: atest AssistantStackTests
Test: atest StartActivityTests
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f384fa30fbf13ec5b1721bc0e52e1065be4cbed2)
Merged-In: I179055fd434656c8116661b9f39adfdcef249ce7
Change-Id: I179055fd434656c8116661b9f39adfdcef249ce7
3 files changed
tree: e8aab3b76a280bde5b93ac68f0aece375156e4b2
  1. builtInServices/
  2. tools/
  3. updatableServices/
  4. .gitignore
  5. OWNERS
  6. PREUPLOAD.cfg