From 0eda7dfcacd838da4a534230f62a121b826000d6 Mon Sep 17 00:00:00 2001 From: Young-Ho Cha Date: Wed, 7 Jan 2015 11:24:35 +0900 Subject: check ntpserver as empty string instead of null mServer cannot set null, because string from resource always returns non-null charsequence Change-Id: I8d6a6fdbc34267ee361e7bd20719887268161870 Signed-off-by: Young-Ho Cha --- core/java/android/util/NtpTrustedTime.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/java/android/util') diff --git a/core/java/android/util/NtpTrustedTime.java b/core/java/android/util/NtpTrustedTime.java index 602a68c..b18cc3b 100644 --- a/core/java/android/util/NtpTrustedTime.java +++ b/core/java/android/util/NtpTrustedTime.java @@ -22,6 +22,7 @@ import android.content.res.Resources; import android.net.SntpClient; import android.os.SystemClock; import android.provider.Settings; +import android.text.TextUtils; /** * {@link TrustedTime} that connects with a remote NTP server as its trusted @@ -73,7 +74,7 @@ public class NtpTrustedTime implements TrustedTime { @Override public boolean forceRefresh() { - if (mServer == null) { + if (TextUtils.isEmpty(mServer)) { // missing server, so no trusted time available return false; } -- cgit v1.1