From f1789afa535b113047ef20623d79fdfb257537aa Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Thu, 7 Aug 2014 12:42:40 -0700 Subject: [PATCH] Switch null checks to TextUtils.isEmpty() b/16872654 Change-Id: Ib8943f068ad6988ff08f8bfd54e2df8fa5ce0274 --- .../emailcommon/utility/EmailClientConnectionManager.java | 2 +- .../email/activity/setup/AccountSetupIncomingFragment.java | 2 +- src/com/android/email/view/CertificateSelector.java | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/emailcommon/src/com/android/emailcommon/utility/EmailClientConnectionManager.java b/emailcommon/src/com/android/emailcommon/utility/EmailClientConnectionManager.java index ca0c21aab..82c1a4e74 100644 --- a/emailcommon/src/com/android/emailcommon/utility/EmailClientConnectionManager.java +++ b/emailcommon/src/com/android/emailcommon/utility/EmailClientConnectionManager.java @@ -133,7 +133,7 @@ public class EmailClientConnectionManager extends ThreadSafeClientConnManager { */ public static String makeScheme( boolean useSsl, boolean trustAllServerCerts, String clientCertAlias) { - if (clientCertAlias != null) { + if (!TextUtils.isEmpty(clientCertAlias)) { return makeSchemeForClientCert(clientCertAlias, trustAllServerCerts); } else { return useSsl ? (trustAllServerCerts ? "httpts" : "https") : "http"; diff --git a/src/com/android/email/activity/setup/AccountSetupIncomingFragment.java b/src/com/android/email/activity/setup/AccountSetupIncomingFragment.java index e3ba87fb9..7ae2c38e8 100644 --- a/src/com/android/email/activity/setup/AccountSetupIncomingFragment.java +++ b/src/com/android/email/activity/setup/AccountSetupIncomingFragment.java @@ -397,7 +397,7 @@ public class AccountSetupIncomingFragment extends AccountServerBaseFragment updatePortFromSecurityType(); } - if (recvAuth.mClientCertAlias != null) { + if (!TextUtils.isEmpty(recvAuth.mClientCertAlias)) { mClientCertificateSelector.setCertificate(recvAuth.mClientCertAlias); } diff --git a/src/com/android/email/view/CertificateSelector.java b/src/com/android/email/view/CertificateSelector.java index 35826f8fe..12945de68 100644 --- a/src/com/android/email/view/CertificateSelector.java +++ b/src/com/android/email/view/CertificateSelector.java @@ -22,6 +22,7 @@ import android.content.res.Resources; import android.os.Parcel; import android.os.Parcelable; import android.security.KeyChain; +import android.text.TextUtils; import android.util.AttributeSet; import android.view.View; import android.view.View.OnClickListener; @@ -84,11 +85,11 @@ public class CertificateSelector extends RelativeLayout implements OnClickListen Resources res = getResources(); mValue = alias; mAliasText.setText( - (alias == null) + TextUtils.isEmpty(alias) ? res.getString(R.string.account_setup_exchange_no_certificate) : alias); mSelectButton.setText(res.getString( - (alias == null) + TextUtils.isEmpty(alias) ? R.string.account_setup_exchange_select_certificate : R.string.account_setup_exchange_remove_certificate)); }