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

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

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