Further lint cleanup

This commit is contained in:
l3d00m
2015-08-20 19:29:46 +02:00
parent 419ba50ab2
commit 8f881e23b2
15 changed files with 24 additions and 81 deletions
@@ -30,7 +30,7 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.SOURCE)
public @interface SdkConstant {
public static enum SdkConstantType {
ACTIVITY_INTENT_ACTION, BROADCAST_INTENT_ACTION, SERVICE_ACTION, INTENT_CATEGORY, FEATURE;
ACTIVITY_INTENT_ACTION, BROADCAST_INTENT_ACTION, SERVICE_ACTION, INTENT_CATEGORY, FEATURE
}
SdkConstantType value();
@@ -566,11 +566,8 @@ public class ConnectivityManager {
public boolean requestRouteToHost(int networkType, int hostAddress) {
InetAddress inetAddress = NetworkUtils.intToInetAddress(hostAddress);
if (inetAddress == null) {
return false;
}
return inetAddress != null && requestRouteToHostAddress(networkType, inetAddress);
return requestRouteToHostAddress(networkType, inetAddress);
}
/**
@@ -112,12 +112,12 @@ public class DhcpInfoInternal {
p.addRoute(route);
}
//if empty, connectivity configures default DNS
if (TextUtils.isEmpty(dns1) == false) {
if (!TextUtils.isEmpty(dns1)) {
p.addDns(NetworkUtils.numericToInetAddress(dns1));
} else {
if (LOCAL_LOGV) Log.v(TAG, "makeLinkProperties with empty dns1!");
}
if (TextUtils.isEmpty(dns2) == false) {
if (!TextUtils.isEmpty(dns2)) {
p.addDns(NetworkUtils.numericToInetAddress(dns2));
} else {
if (LOCAL_LOGV) Log.v(TAG, "makeLinkProperties with empty dns2!");
@@ -152,11 +152,7 @@ public class DhcpInfoInternal {
* metered, and sensitive to heavy data transfers.
*/
public boolean hasMeteredHint() {
if (vendorInfo != null) {
return vendorInfo.contains("ANDROID_METERED");
} else {
return false;
}
return vendorInfo != null && vendorInfo.contains("ANDROID_METERED");
}
public String toString() {
@@ -331,13 +331,8 @@ public class NetworkTemplate implements Parcelable {
* Check if mobile network with matching IMSI.
*/
private boolean matchesMobile(NetworkIdentity ident) {
if (ident.mType == TYPE_WIMAX) {
// TODO: consider matching against WiMAX subscriber identity
return true;
} else {
return ((sForceAllNetworkTypes || contains(DATA_USAGE_NETWORK_TYPES, ident.mType))
&& Objects.equal(mSubscriberId, ident.mSubscriberId));
}
// TODO: consider matching against WiMAX subscriber identity
return ident.mType == TYPE_WIMAX || ((sForceAllNetworkTypes || contains(DATA_USAGE_NETWORK_TYPES, ident.mType)) && Objects.equal(mSubscriberId, ident.mSubscriberId));
}
/**
@@ -391,18 +386,11 @@ public class NetworkTemplate implements Parcelable {
* Check if matches Ethernet network template.
*/
private boolean matchesEthernet(NetworkIdentity ident) {
if (ident.mType == TYPE_ETHERNET) {
return true;
}
return false;
return ident.mType == TYPE_ETHERNET;
}
private boolean matchesMobileWildcard(NetworkIdentity ident) {
if (ident.mType == TYPE_WIMAX) {
return true;
} else {
return sForceAllNetworkTypes || contains(DATA_USAGE_NETWORK_TYPES, ident.mType);
}
return ident.mType == TYPE_WIMAX || sForceAllNetworkTypes || contains(DATA_USAGE_NETWORK_TYPES, ident.mType);
}
private boolean matchesWifiWildcard(NetworkIdentity ident) {
@@ -149,13 +149,12 @@ public class ProxyProperties implements Parcelable {
if (!(o instanceof ProxyProperties)) return false;
ProxyProperties p = (ProxyProperties) o;
if (mExclusionList != null && !mExclusionList.equals(p.getExclusionList())) return false;
if (mHost != null && p.getHost() != null && mHost.equals(p.getHost()) == false) {
if (mHost != null && p.getHost() != null && !mHost.equals(p.getHost())) {
return false;
}
if (mHost != null && p.mHost == null) return false;
if (mHost == null && p.mHost != null) return false;
if (mPort != p.mPort) return false;
return true;
return mPort == p.mPort;
}
/**