From 50d7d19a7377df9421b6a0af2d8ecce2dfd32796 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 16 Jun 2015 16:21:27 -0700 Subject: Fix issue with german translation of lock times The word "immediately" would go into a different place in the sentence than a number so we have to break this into two strings. Fixes bug 21602326 Change-Id: Ie07f1bc84d68bdea8d6f1264dfd18326c2e48df4 --- res/values/strings.xml | 2 ++ src/com/android/settings/SecuritySettings.java | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 0343a1569..5d162115c 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -653,6 +653,8 @@ %1$s after sleep + Immediately after sleep, except when kept unlocked by %1$s + %1$s after sleep, except when kept unlocked by %2$s Show owner info on lock screen diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index 93bf1e017..c9676596d 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -542,8 +542,13 @@ public class SecuritySettings extends SettingsPreferenceFragment Preference preference = getPreferenceScreen().findPreference(KEY_TRUST_AGENT); if (preference != null && preference.getTitle().length() > 0) { - mLockAfter.setSummary(getString(R.string.lock_after_timeout_summary_with_exception, - entries[best], preference.getTitle())); + if (Long.valueOf(values[best].toString()) == 0) { + mLockAfter.setSummary(getString(R.string.lock_immediately_summary_with_exception, + preference.getTitle())); + } else { + mLockAfter.setSummary(getString(R.string.lock_after_timeout_summary_with_exception, + entries[best], preference.getTitle())); + } } else { mLockAfter.setSummary(getString(R.string.lock_after_timeout_summary, entries[best])); } -- cgit v1.2.3