leanback: fix crash caused by wrong position

When notifyDataSetChange() is called on Adapter that clears
its data and has stable ids, it will trigger a requestChildFocus()
in creating DISAPPEARING animation. At that time we should
use adapter position instead of view position. The adapter
position would be -1, so requestChildFocus() should do nothing.

Bug: 36139432
Test: GridWidgetTest.testRemoveLastItemWithStableId

Change-Id: Ief37156d58c2596c28002143cd14395ade24c6a5
3 files changed