am f1789afa: Switch null checks to TextUtils.isEmpty()

* commit 'f1789afa535b113047ef20623d79fdfb257537aa':
  Switch null checks to TextUtils.isEmpty()
This commit is contained in:
Tony Mantler 2014-08-07 21:16:33 +00:00 committed by Android Git Automerger
commit 67f497c634
3 changed files with 5 additions and 4 deletions

View File

@ -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";

View File

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

View File

@ -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));
}