OSDN Git Service

Fix injected settings titles not matching a locale change.
authorWilliam Luh <williamluh@google.com>
Fri, 31 Mar 2017 22:08:16 +0000 (15:08 -0700)
committerWilliam Luh <williamluh@google.com>
Thu, 6 Apr 2017 21:35:51 +0000 (14:35 -0700)
commit4c978a302afb0e3b416319b3cd963a6e7ccc379d
treeb493a7aaf2ae84b4f3e9bdcb0717f95ccaab430c
parentcf1f1d9128853f0fa0cef657e2bbb7bf6904c732
Fix injected settings titles not matching a locale change.

The injected tiles code currently treats the string metadata value
for the title key in the Activity's manifest as the title itself.
When the language on the device is changed the title remains in the
previous language until a reboot.

This CL will make injected tiles attempt to treat the string metadata
value as a resource variable to get the integer res id and then
properly load the localized title using the res id. To be backwards
compatible, if the res id is 0, we treat the string metadata value as
the title itself (current behavior).

Bug:36470694
Test: make RunSettingsLibRoboTests
Change-Id: I3963534a3a3a27d0455c4ed1ad4fa574b03d67fc
packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java
packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/TileUtilsTest.java