From 0807c897f40f22ee4df5d425a8c7f7c207000718 Mon Sep 17 00:00:00 2001 From: Jatin Matani Date: Mon, 11 Aug 2014 13:37:15 -0700 Subject: [PATCH] Make SettingsValues non-final to testability Add getter for enableMetricsLogging boolean. Bug:16522256 Change-Id: Ie9a38efc7861b3d4207562d2bf0344c5c2ae957a --- .../android/inputmethod/latin/settings/SettingsValues.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java index 39e834f84..4a47fbb74 100644 --- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java @@ -40,7 +40,8 @@ import java.util.Locale; * When you call the constructor of this class, you may want to change the current system locale by * using {@link com.android.inputmethod.latin.utils.RunInLocale}. */ -public final class SettingsValues { +// Non-final for testing via mock library. +public class SettingsValues { private static final String TAG = SettingsValues.class.getSimpleName(); // "floatMaxValue" and "floatNegativeInfinity" are special marker strings for // Float.NEGATIVE_INFINITE and Float.MAX_VALUE. Currently used for auto-correction settings. @@ -186,6 +187,10 @@ public final class SettingsValues { } } + public boolean isMetricsLoggingEnabled() { + return mEnableMetricsLogging; + } + public boolean isApplicationSpecifiedCompletionsOn() { return mInputAttributes.mApplicationSpecifiedCompletionOn; }