Merge "Preventing NPE crash if view is detached from window." into tm-dev am: 76386f47a4 am: 3d4a598a0c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18799295

Change-Id: Ie30bcc39cb57326798b057421f7e0a8a6da62d0b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>