Don't add SettingsLib to static_libs in Settings unit test.

Adding them results in duplicate classes and causes conflict for the R
classes and resource loading.

Meanwhile, correctly removing the SettingsLibSettingsSpinner resulted
in the test failing to find the getSelectedItem() method which is
unused inside Settings app. This is an inherent issue when unit
testing an optimized (and shrunk) app, and since there's no other way
for the test to get the current selected item, this change simply
changes the Settings code to invoke getSelectedItem() as well. This
has exactly the same effect because SettingsSpinnerPreference updates
its mPosition right before calling the OnItemSelectedListener in its
implementation.

Bug: 183340630
Bug: 177638625
Bug: 183342958
Test: atest SettingsSliderPreferenceControllerTest
Test: atest PrivateVolumeForgetTest
Change-Id: Ia26ca923369b41291614fb9bd50dfbd2aac2f0fa
2 files changed