Refine equals of both InsetsState and WindowInsets

InsetsState:
It had logic errors in InsetsState#equals while excludesCaptionBar or
excludesInvisibleIme is true. For example, if the last source in one
InsetsState.mSources is captionBar() or ime(), but the other one doesn't
have a source of the same type, the type of source won't be excluded,
which make it always returns false, regardless of excludesCaptionBar or
excludesInvisibleIme.

WindowInsets:
Two WindowInsets could be considered as non-equal while they provide the
same insets of each type from WindowInsets#getInsets if one WindowInsets
has Insets.NONE for a type and the other one has null for the same type.

This CL fixes both problems.

Fix: 284406283
Test: OnApplyWindowInsetsListenerTest
Test: atest InsetsStateTest
Change-Id: I31b078737def461bd51eab9bb1114307a8ab994f
3 files changed