Merge "Avoid instantiations of Boolean that are immediately unboxed." into nyc-dev-plus-aosp
am: cc0eaf4
* commit 'cc0eaf4124011d8a370f3c354e241887a633e8f1':
Avoid instantiations of Boolean that are immediately unboxed.
Change-Id: Ia4ea8bbd2a4fd5cb3094f3682034542b8f7d8e80
This commit is contained in:
@@ -570,7 +570,7 @@ public class ZenModeConfig implements Parcelable {
|
||||
|
||||
private static boolean safeBoolean(String val, boolean defValue) {
|
||||
if (TextUtils.isEmpty(val)) return defValue;
|
||||
return Boolean.valueOf(val);
|
||||
return Boolean.parseBoolean(val);
|
||||
}
|
||||
|
||||
private static int safeInt(XmlPullParser parser, String att, int defValue) {
|
||||
|
||||
@@ -135,7 +135,7 @@ public class VpnProfile implements Cloneable, Parcelable {
|
||||
profile.dnsServers = values[5];
|
||||
profile.searchDomains = values[6];
|
||||
profile.routes = values[7];
|
||||
profile.mppe = Boolean.valueOf(values[8]);
|
||||
profile.mppe = Boolean.parseBoolean(values[8]);
|
||||
profile.l2tpSecret = values[9];
|
||||
profile.ipsecIdentifier = values[10];
|
||||
profile.ipsecSecret = values[11];
|
||||
|
||||
@@ -1280,7 +1280,7 @@ public class XmlUtils {
|
||||
if (eventType == parser.START_TAG) {
|
||||
if (parser.getName().equals("item")) {
|
||||
try {
|
||||
array[i] = Boolean.valueOf(parser.getAttributeValue(null, "value"));
|
||||
array[i] = Boolean.parseBoolean(parser.getAttributeValue(null, "value"));
|
||||
} catch (NullPointerException e) {
|
||||
throw new XmlPullParserException("Need value attribute in item");
|
||||
} catch (NumberFormatException e) {
|
||||
|
||||
@@ -1402,7 +1402,7 @@ final class ActivityRecord {
|
||||
} else if (ATTR_RESOLVEDTYPE.equals(attrName)) {
|
||||
resolvedType = attrValue;
|
||||
} else if (ATTR_COMPONENTSPECIFIED.equals(attrName)) {
|
||||
componentSpecified = Boolean.valueOf(attrValue);
|
||||
componentSpecified = Boolean.parseBoolean(attrValue);
|
||||
} else if (ATTR_USERID.equals(attrName)) {
|
||||
userId = Integer.parseInt(attrValue);
|
||||
} else if (attrName.startsWith(TaskDescription.ATTR_TASKDESCRIPTION_PREFIX)) {
|
||||
|
||||
@@ -311,7 +311,7 @@ public class RankingHelper implements RankingConfig {
|
||||
|
||||
private static boolean tryParseBool(String value, boolean defValue) {
|
||||
if (TextUtils.isEmpty(value)) return defValue;
|
||||
return Boolean.valueOf(value);
|
||||
return Boolean.parseBoolean(value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -251,7 +251,7 @@ final class PersistentDataStore {
|
||||
throw new XmlPullParserException(
|
||||
"Missing " + ATTR_ENABLED + " attribute on " + TAG_PARENTAL_CONTROLS);
|
||||
}
|
||||
mParentalControlsEnabled = Boolean.valueOf(enabled);
|
||||
mParentalControlsEnabled = Boolean.parseBoolean(enabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -998,7 +998,7 @@ public class ServiceState implements Parcelable {
|
||||
m.putString("data-operator-alpha-long", mDataOperatorAlphaLong);
|
||||
m.putString("data-operator-alpha-short", mDataOperatorAlphaShort);
|
||||
m.putString("data-operator-numeric", mDataOperatorNumeric);
|
||||
m.putBoolean("manual", Boolean.valueOf(mIsManualNetworkSelection));
|
||||
m.putBoolean("manual", mIsManualNetworkSelection);
|
||||
m.putInt("radioTechnology", mRilVoiceRadioTechnology);
|
||||
m.putInt("dataRadioTechnology", mRilDataRadioTechnology);
|
||||
m.putBoolean("cssIndicator", mCssIndicator);
|
||||
@@ -1006,8 +1006,8 @@ public class ServiceState implements Parcelable {
|
||||
m.putInt("systemId", mSystemId);
|
||||
m.putInt("cdmaRoamingIndicator", mCdmaRoamingIndicator);
|
||||
m.putInt("cdmaDefaultRoamingIndicator", mCdmaDefaultRoamingIndicator);
|
||||
m.putBoolean("emergencyOnly", Boolean.valueOf(mIsEmergencyOnly));
|
||||
m.putBoolean("isDataRoamingFromRegistration", Boolean.valueOf(mIsDataRoamingFromRegistration));
|
||||
m.putBoolean("emergencyOnly", mIsEmergencyOnly);
|
||||
m.putBoolean("isDataRoamingFromRegistration", mIsDataRoamingFromRegistration);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
|
||||
@@ -1046,7 +1046,7 @@ public class SignalStrength implements Parcelable {
|
||||
m.putInt("LteRssnr", mLteRssnr);
|
||||
m.putInt("LteCqi", mLteCqi);
|
||||
m.putInt("TdScdma", mTdScdmaRscp);
|
||||
m.putBoolean("isGsm", Boolean.valueOf(isGsm));
|
||||
m.putBoolean("isGsm", isGsm);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4883,7 +4883,7 @@ public class TelephonyManager {
|
||||
*/
|
||||
public boolean getSmsReceiveCapableForPhone(int phoneId, boolean defaultValue) {
|
||||
if (SubscriptionManager.isValidPhoneId(phoneId)) {
|
||||
return Boolean.valueOf(TelephonyManager.getTelephonyProperty(phoneId,
|
||||
return Boolean.parseBoolean(TelephonyManager.getTelephonyProperty(phoneId,
|
||||
TelephonyProperties.PROPERTY_SMS_RECEIVE, String.valueOf(defaultValue)));
|
||||
}
|
||||
|
||||
@@ -4914,7 +4914,7 @@ public class TelephonyManager {
|
||||
*/
|
||||
public boolean getSmsSendCapableForPhone(int phoneId, boolean defaultValue) {
|
||||
if (SubscriptionManager.isValidPhoneId(phoneId)) {
|
||||
return Boolean.valueOf(TelephonyManager.getTelephonyProperty(phoneId,
|
||||
return Boolean.parseBoolean(TelephonyManager.getTelephonyProperty(phoneId,
|
||||
TelephonyProperties.PROPERTY_SMS_SEND, String.valueOf(defaultValue)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user