AppCompatDelegate - fix cast exception

View#getParent can return a ViewParent and not
necessarily a View. Check that the action mode view
is an instance of View (besides checking for null)
before casting it to a View.

Test: create a custom dialog with TextView as message,
open it and select text multiple times. Observe no crash.

Bug: 31500890
Change-Id: Ie2fcd7de6730b5521086401b2be621fd0a64e593
1 file changed