After discussed with UX, we think that is necessery for localization.
So we set the max_line to 2.
Bug: 189495817
Test: change language and manual test
Change-Id: I269a22af37e9edb14de46f9ac245da07b8e2a228
The workaround is accessing the resources dynamically with
Resources.getIdentifier(), however this makes it incompatible with R8
which will think the resource is unused and remove it, resulting in a
runtime exception. There is currently no way to have consumer ProGuard
texts in Soong, and we cannot disable R8 for PermissionController
because it would severely regress our APK size and make build unhappy.
The real cause for the original test failure is that, Settings unit
test used to include SettingsLib libraries in its static_libs, and
this caused duplicate R classes to be included in its test APK (which
is already in Settings APK) and resulted in the wrong R class being
loaded when accessing resources from Settings context.
So we should remove the SettingsLib dependencies in Settings unit test
and remove the workaround here, to correctly fix the issue and unblock
R8 usage.
Bug: 183340630
Bug: 177638625
Bug: 183342958
Test: atest SettingsSliderPreferenceControllerTest
Test: atest PrivateVolumeForgetTest
Change-Id: I404892ccb7c2004ec3f81df69c1dc4bceed150df
Somehow Resource IDs are inconsistent between Settings and
SettingsUnitTests. This is a workaround for NotFoundException
in SettingsUnitTests.
Bug: 183340630
Test: atest SettingsSliderPreferenceControllerTest
Change-Id: I72fef4856317ebf9fb1a667ddb910878185aae39