Switch null checks to TextUtils.isEmpty()

b/16872654

Change-Id: Ib8943f068ad6988ff08f8bfd54e2df8fa5ce0274
This commit is contained in:
Tony Mantler 2014-08-07 12:42:40 -07:00
parent 8218d00634
commit f1789afa53
3 changed files with 5 additions and 4 deletions

View File

@ -133,7 +133,7 @@ public class EmailClientConnectionManager extends ThreadSafeClientConnManager {
*/ */
public static String makeScheme( public static String makeScheme(
boolean useSsl, boolean trustAllServerCerts, String clientCertAlias) { boolean useSsl, boolean trustAllServerCerts, String clientCertAlias) {
if (clientCertAlias != null) { if (!TextUtils.isEmpty(clientCertAlias)) {
return makeSchemeForClientCert(clientCertAlias, trustAllServerCerts); return makeSchemeForClientCert(clientCertAlias, trustAllServerCerts);
} else { } else {
return useSsl ? (trustAllServerCerts ? "httpts" : "https") : "http"; return useSsl ? (trustAllServerCerts ? "httpts" : "https") : "http";

View File

@ -397,7 +397,7 @@ public class AccountSetupIncomingFragment extends AccountServerBaseFragment
updatePortFromSecurityType(); updatePortFromSecurityType();
} }
if (recvAuth.mClientCertAlias != null) { if (!TextUtils.isEmpty(recvAuth.mClientCertAlias)) {
mClientCertificateSelector.setCertificate(recvAuth.mClientCertAlias); mClientCertificateSelector.setCertificate(recvAuth.mClientCertAlias);
} }

View File

@ -22,6 +22,7 @@ import android.content.res.Resources;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.security.KeyChain; import android.security.KeyChain;
import android.text.TextUtils;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
@ -84,11 +85,11 @@ public class CertificateSelector extends RelativeLayout implements OnClickListen
Resources res = getResources(); Resources res = getResources();
mValue = alias; mValue = alias;
mAliasText.setText( mAliasText.setText(
(alias == null) TextUtils.isEmpty(alias)
? res.getString(R.string.account_setup_exchange_no_certificate) ? res.getString(R.string.account_setup_exchange_no_certificate)
: alias); : alias);
mSelectButton.setText(res.getString( mSelectButton.setText(res.getString(
(alias == null) TextUtils.isEmpty(alias)
? R.string.account_setup_exchange_select_certificate ? R.string.account_setup_exchange_select_certificate
: R.string.account_setup_exchange_remove_certificate)); : R.string.account_setup_exchange_remove_certificate));
} }