diff --git a/mobile/android/base/ContactService.java b/mobile/android/base/ContactService.java index 9d6392a00c18..9152eb2402e5 100644 --- a/mobile/android/base/ContactService.java +++ b/mobile/android/base/ContactService.java @@ -671,7 +671,7 @@ public class ContactService implements GeckoEventListener { if (typeConstant == BaseTypes.TYPE_CUSTOM) { type = cursor.getString(cursor.getColumnIndex(typeLabelColumn)); } else { - type = getKeyFromMapValue(typeMap, Integer.valueOf(typeConstant)); + type = getKeyFromMapValue(typeMap, typeConstant); } // Since an object may have multiple types, it may have already been added, @@ -712,7 +712,7 @@ public class ContactService implements GeckoEventListener { if (typeConstant == Phone.TYPE_CUSTOM) { type = cursor.getString(cursor.getColumnIndex(Phone.LABEL)); } else { - type = getKeyFromMapValue(mPhoneTypesMap, Integer.valueOf(typeConstant)); + type = getKeyFromMapValue(mPhoneTypesMap, typeConstant); } // Since a phone may have multiple types, it may have already been added, @@ -759,7 +759,7 @@ public class ContactService implements GeckoEventListener { if (typeConstant == StructuredPostal.TYPE_CUSTOM) { type = cursor.getString(cursor.getColumnIndex(StructuredPostal.LABEL)); } else { - type = getKeyFromMapValue(mAddressTypesMap, Integer.valueOf(typeConstant)); + type = getKeyFromMapValue(mAddressTypesMap, typeConstant); } // Since an email may have multiple types, it may have already been added, @@ -984,7 +984,7 @@ public class ContactService implements GeckoEventListener { } String returnStatus = "KO"; - Long newRawContactId = new Long(-1); + Long newRawContactId = -1L; // Insert the contact! ContentProviderResult[] insertResults = applyBatch(newContactOptions); @@ -1476,7 +1476,7 @@ public class ContactService implements GeckoEventListener { private void getContactsCount(final String requestID) { Cursor cursor = getAllRawContactIdsCursor(); - Integer numContacts = Integer.valueOf(cursor.getCount()); + Integer numContacts = cursor.getCount(); cursor.close(); sendCallbackToJavascript("Android:Contacts:Count", requestID, new String[] {"count"}, diff --git a/mobile/android/base/db/AbstractTransactionalProvider.java b/mobile/android/base/db/AbstractTransactionalProvider.java index 2a0cd392d6d1..fb0b037b4e78 100644 --- a/mobile/android/base/db/AbstractTransactionalProvider.java +++ b/mobile/android/base/db/AbstractTransactionalProvider.java @@ -103,7 +103,8 @@ public abstract class AbstractTransactionalProvider extends ContentProvider { if (isInBatch == null) { return false; } - return isInBatch.booleanValue(); + + return isInBatch; } /** diff --git a/mobile/android/base/db/BrowserProvider.java b/mobile/android/base/db/BrowserProvider.java index 2d6b18b12098..009640390668 100644 --- a/mobile/android/base/db/BrowserProvider.java +++ b/mobile/android/base/db/BrowserProvider.java @@ -1065,7 +1065,7 @@ public class BrowserProvider extends SharedBrowserDatabaseProvider { Long additional = values.getAsLong(History.VISITS); // Increment visit count by a specified amount, or default to increment by 1 - values.put(History.VISITS, existing + ((additional != null) ? additional.longValue() : 1)); + values.put(History.VISITS, existing + ((additional != null) ? additional : 1)); } updated += db.update(TABLE_HISTORY, values, "_id = ?", diff --git a/mobile/android/base/preferences/GeckoPreferences.java b/mobile/android/base/preferences/GeckoPreferences.java index 720af8665443..806ee59187d0 100644 --- a/mobile/android/base/preferences/GeckoPreferences.java +++ b/mobile/android/base/preferences/GeckoPreferences.java @@ -11,6 +11,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import android.os.Build; import org.json.JSONObject; import org.mozilla.gecko.AppConstants; import org.mozilla.gecko.AppConstants.Versions; @@ -36,6 +37,7 @@ import org.mozilla.gecko.TelemetryContract.Method; import org.mozilla.gecko.background.common.GlobalConstants; import org.mozilla.gecko.background.healthreport.HealthReportConstants; import org.mozilla.gecko.db.BrowserContract.SuggestedSites; +import org.mozilla.gecko.updater.UpdateServiceHelper; import org.mozilla.gecko.util.GeckoEventListener; import org.mozilla.gecko.util.HardwareUtils; import org.mozilla.gecko.util.ThreadUtils; @@ -325,7 +327,7 @@ OnSharedPreferenceChangeListener // all) in the action bar. updateActionBarTitle(R.string.settings_title); - if (android.os.Build.VERSION.SDK_INT < 13) { + if (Build.VERSION.SDK_INT < 13) { // Affected by Bug 1015209 -- no detach/attach. // If we try rejigging fragments, we'll crash, so don't // enable locale switching at all. @@ -1056,17 +1058,17 @@ OnSharedPreferenceChangeListener if (PREFS_MENU_CHAR_ENCODING.equals(prefName)) { setCharEncodingState(((String) newValue).equals("true")); } else if (PREFS_UPDATER_AUTODOWNLOAD.equals(prefName)) { - org.mozilla.gecko.updater.UpdateServiceHelper.registerForUpdates(this, (String) newValue); + UpdateServiceHelper.registerForUpdates(this, (String) newValue); } else if (PREFS_HEALTHREPORT_UPLOAD_ENABLED.equals(prefName)) { // The healthreport pref only lives in Android, so we do not persist // to Gecko, but we do broadcast intent to the health report // background uploader service, which will start or stop the // repeated background upload attempts. - broadcastHealthReportUploadPref(this, ((Boolean) newValue).booleanValue()); + broadcastHealthReportUploadPref(this, (Boolean) newValue); } else if (PREFS_GEO_REPORTING.equals(prefName)) { - broadcastStumblerPref(this, ((Boolean) newValue).booleanValue()); + broadcastStumblerPref(this, (Boolean) newValue); // Translate boolean value to int for geo reporting pref. - newValue = ((Boolean) newValue) ? 1 : 0; + newValue = (Boolean) newValue ? 1 : 0; } else if (handlers.containsKey(prefName)) { PrefHandler handler = handlers.get(prefName); handler.onChange(this, preference, newValue); diff --git a/mobile/android/base/prompts/IconGridInput.java b/mobile/android/base/prompts/IconGridInput.java index d043fd8d15f7..8b8b3f594e24 100644 --- a/mobile/android/base/prompts/IconGridInput.java +++ b/mobile/android/base/prompts/IconGridInput.java @@ -103,7 +103,7 @@ public class IconGridInput extends PromptInput implements OnItemClickListener { @Override public Object getValue() { - return new Integer(mSelected); + return mSelected; } @Override diff --git a/mobile/android/base/prompts/PromptInput.java b/mobile/android/base/prompts/PromptInput.java index cebea98a5748..98d6302b0343 100644 --- a/mobile/android/base/prompts/PromptInput.java +++ b/mobile/android/base/prompts/PromptInput.java @@ -311,7 +311,7 @@ public class PromptInput { @Override public Object getValue() { - return new Integer(spinner.getSelectedItemPosition()); + return spinner.getSelectedItemPosition(); } } diff --git a/mobile/android/base/tests/DatabaseHelper.java b/mobile/android/base/tests/DatabaseHelper.java index 8f0cf1d1de0a..0c0eab9782ef 100644 --- a/mobile/android/base/tests/DatabaseHelper.java +++ b/mobile/android/base/tests/DatabaseHelper.java @@ -92,7 +92,7 @@ class DatabaseHelper { // About the same implementation as getFolderIdFromGuid from LocalBrowserDB because it is declared private and we can't use reflections to access it protected long getFolderIdFromGuid(String guid) { ContentResolver resolver = mActivity.getContentResolver(); - long folderId = Long.valueOf(-1); + long folderId = -1L; Uri bookmarksUri = buildUri(BrowserDataType.BOOKMARKS); Cursor c = null; try {