Filter out empty and unnecessary rectangles

Layout::getSelection will sometimes give us rectangles which are
redundant - specifically, those with dimension zero and those that may
already be contained in some other rectangles. In order to keep the
smart select animation simple and in line with what the user would
visually expect, we remove these rectangles.

Test: manual - verify smart select animation over multiple lines
Test: bit FrameworksCoreTests:android.widget.SelectionActionModeHelperTest
Change-Id: Ia4406d9505366245609b44e3ec3743f84820ba0a
2 files changed