--- a/mobile/android/app/checkstyle.xml
+++ b/mobile/android/app/checkstyle.xml
@@ -53,16 +53,12 @@
<!-- TODO: (bug 1263059) Remove specific tokens to enable CAST check. -->
<property name="tokens" value="COMMA, SEMI"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
- <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN,
- LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE,
- LOR, LT, NOT_EQUAL, QUESTION, SL, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND,
- PLUS, PLUS_ASSIGN, MOD, MOD_ASSIGN, LE, LAND, GT, GE, RCURLY, DIV, DIV_ASSIGN"/>
</module>
</module>
</module>
--- a/mobile/android/base/java/org/mozilla/gecko/ContactService.java
+++ b/mobile/android/base/java/org/mozilla/gecko/ContactService.java
@@ -1816,17 +1816,17 @@ public class ContactService implements G
for (int value : values) {
if (value > max) {
max = value;
}
}
return max;
}
- private static void putPossibleNullValueInJSONObject(final String key, final Object value, JSONObject jsonObject) throws JSONException{
+ private static void putPossibleNullValueInJSONObject(final String key, final Object value, JSONObject jsonObject) throws JSONException {
if (value != null) {
jsonObject.put(key, value);
} else {
jsonObject.put(key, JSONObject.NULL);
}
}
private static String getKeyFromMapValue(final HashMap<String, Integer> map, int value) {
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -765,17 +765,17 @@ public abstract class GeckoApp
for (int i = 0; i < checkedItemPositions.size(); i++)
if (checkedItemPositions.get(i))
permissionsToClear.put(i);
GeckoAppShell.notifyObservers("Permissions:Clear", permissionsToClear.toString());
}
});
- builder.setNegativeButton(R.string.site_settings_cancel, new DialogInterface.OnClickListener(){
+ builder.setNegativeButton(R.string.site_settings_cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
ThreadUtils.postToUiThread(new Runnable() {
@Override
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java
@@ -1226,17 +1226,17 @@ public class GeckoAppShell
android.os.Process.killProcess(pid);
return true;
}
};
EnumerateGeckoProcesses(visitor);
}
- interface GeckoProcessesVisitor{
+ interface GeckoProcessesVisitor {
boolean callback(int pid);
}
private static void EnumerateGeckoProcesses(GeckoProcessesVisitor visiter) {
int pidColumn = -1;
int userColumn = -1;
try {
--- a/mobile/android/base/java/org/mozilla/gecko/SessionParser.java
+++ b/mobile/android/base/java/org/mozilla/gecko/SessionParser.java
@@ -53,17 +53,17 @@ public abstract class SessionParser {
abstract public void onTabRead(SessionTab tab);
/**
* Placeholder method that must be overloaded to handle closedTabs while parsing session data.
*
* @param closedTabs, JSONArray of recently closed tab entries.
* @throws JSONException
*/
- public void onClosedTabsRead(final JSONArray closedTabs) throws JSONException{
+ public void onClosedTabsRead(final JSONArray closedTabs) throws JSONException {
}
public void parse(String... sessionStrings) {
final LinkedList<SessionTab> sessionTabs = new LinkedList<SessionTab>();
int totalCount = 0;
int selectedIndex = -1;
try {
for (String sessionString : sessionStrings) {
--- a/mobile/android/base/java/org/mozilla/gecko/db/FormHistoryProvider.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/FormHistoryProvider.java
@@ -146,22 +146,22 @@ public class FormHistoryProvider extends
@Override
public void onPreUpdate(ContentValues values, Uri uri, SQLiteBridge db) { }
@Override
public void onPostQuery(Cursor cursor, Uri uri, SQLiteBridge db) { }
@Override
- protected String getDBName(){
+ protected String getDBName() {
return DB_FILENAME;
}
@Override
protected String getTelemetryPrefix() {
return TELEMETRY_TAG;
}
@Override
- protected int getDBVersion(){
+ protected int getDBVersion() {
return DB_VERSION;
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/db/HomeProvider.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/HomeProvider.java
@@ -136,27 +136,27 @@ public class HomeProvider extends SQLite
return c;
}
/**
* SQLiteBridgeContentProvider implementation
*/
@Override
- protected String getDBName(){
+ protected String getDBName() {
return DB_FILENAME;
}
@Override
protected String getTelemetryPrefix() {
return TELEMETRY_TAG;
}
@Override
- protected int getDBVersion(){
+ protected int getDBVersion() {
return DB_VERSION;
}
@Override
public String getTable(Uri uri) {
final int match = URI_MATCHER.match(uri);
switch (match) {
case ITEMS: {
--- a/mobile/android/base/java/org/mozilla/gecko/db/PasswordsProvider.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/PasswordsProvider.java
@@ -113,27 +113,27 @@ public class PasswordsProvider extends S
if (mCrashHandler != null) {
mCrashHandler.unregister();
mCrashHandler = null;
}
}
@Override
- protected String getDBName(){
+ protected String getDBName() {
return DB_FILENAME;
}
@Override
protected String getTelemetryPrefix() {
return TELEMETRY_TAG;
}
@Override
- protected int getDBVersion(){
+ protected int getDBVersion() {
return DB_VERSION;
}
@Override
public String getType(Uri uri) {
final int match = URI_MATCHER.match(uri);
switch (match) {
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/Axis.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/Axis.java
@@ -404,17 +404,17 @@ abstract class Axis {
}
float average = 0;
for (int i = 0; i < usablePoints; i++) {
average += mRecentVelocities[i];
}
return average / usablePoints;
}
- float accelerate(float velocity, float lastFlingVelocity){
+ float accelerate(float velocity, float lastFlingVelocity) {
return (FLING_ACCEL_BASE_MULTIPLIER * velocity + FLING_ACCEL_SUPPLEMENTAL_MULTIPLIER * lastFlingVelocity);
}
void startFling(boolean stopped) {
mDisableSnap = mSubscroller.scrolling();
if (stopped) {
mFlingState = FlingStates.STOPPED;
--- a/mobile/android/base/java/org/mozilla/gecko/home/BookmarksListView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/BookmarksListView.java
@@ -24,17 +24,17 @@ import android.widget.AdapterView;
import android.widget.HeaderViewListAdapter;
import android.widget.ListAdapter;
import org.mozilla.gecko.util.NetworkUtils;
/**
* A ListView of bookmarks.
*/
public class BookmarksListView extends HomeListView
- implements AdapterView.OnItemClickListener{
+ implements AdapterView.OnItemClickListener {
public static final String LOGTAG = "GeckoBookmarksListView";
public BookmarksListView(Context context) {
this(context, null);
}
public BookmarksListView(Context context, AttributeSet attrs) {
this(context, attrs, R.attr.bookmarksListViewStyle);
--- a/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryAdapter.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/CombinedHistoryAdapter.java
@@ -229,17 +229,17 @@ public class CombinedHistoryAdapter exte
* @param position position in the adapter
* @return position of the item in the data structure
*/
private int transformAdapterPositionForDataStructure(ItemType type, int position) {
if (type == ItemType.CLIENT) {
return position;
} else if (type == ItemType.SECTION_HEADER) {
return position - remoteClients.size();
- } else if (type == ItemType.HISTORY){
+ } else if (type == ItemType.HISTORY) {
return position - remoteClients.size() - getHeadersBefore(position);
} else {
return position;
}
}
public HomeContextMenuInfo makeContextMenuInfoFromPosition(View view, int position) {
final ItemType itemType = getItemTypeForPosition(position);
--- a/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/SearchEngineRow.java
@@ -262,17 +262,17 @@ class SearchEngineRow extends AnimatedHe
public void setOnSearchListener(OnSearchListener listener) {
mSearchListener = listener;
}
public void setOnEditSuggestionListener(OnEditSuggestionListener listener) {
mEditSuggestionListener = listener;
}
- private void bindSuggestionView(String suggestion, boolean animate, int recycledSuggestionCount, Integer previousSuggestionChildIndex, boolean isUserSavedSearch, String telemetryTag){
+ private void bindSuggestionView(String suggestion, boolean animate, int recycledSuggestionCount, Integer previousSuggestionChildIndex, boolean isUserSavedSearch, String telemetryTag) {
final View suggestionItem;
// Reuse suggestion views from recycled view, if possible.
if (previousSuggestionChildIndex + 1 < recycledSuggestionCount) {
suggestionItem = mSuggestionView.getChildAt(previousSuggestionChildIndex + 1);
suggestionItem.setVisibility(View.VISIBLE);
} else {
suggestionItem = mInflater.inflate(R.layout.suggestion_item, null);
--- a/mobile/android/base/java/org/mozilla/gecko/notifications/WhatsNewReceiver.java
+++ b/mobile/android/base/java/org/mozilla/gecko/notifications/WhatsNewReceiver.java
@@ -35,17 +35,17 @@ public class WhatsNewReceiver extends Br
@Override
public void onReceive(Context context, Intent intent) {
if (ACTION_NOTIFICATION_CANCELLED.equals(intent.getAction())) {
Telemetry.sendUIEvent(TelemetryContract.Event.CANCEL, TelemetryContract.Method.NOTIFICATION, EXTRA_WHATSNEW_NOTIFICATION);
return;
}
final String dataString = intent.getDataString();
- if (TextUtils.isEmpty(dataString) || !dataString.contains(AppConstants.ANDROID_PACKAGE_NAME)){
+ if (TextUtils.isEmpty(dataString) || !dataString.contains(AppConstants.ANDROID_PACKAGE_NAME)) {
return;
}
if (!SwitchBoard.isInExperiment(context, Experiments.WHATSNEW_NOTIFICATION)) {
return;
}
if (!isPreferenceEnabled(context)) {
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/LocaleListPreference.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/LocaleListPreference.java
@@ -49,17 +49,17 @@ public class LocaleListPreference extend
private final Paint paint = new Paint();
private final byte[] missingCharacter;
public CharacterValidator(String missing) {
this.missingCharacter = getPixels(drawBitmap(missing));
}
- private Bitmap drawBitmap(String text){
+ private Bitmap drawBitmap(String text) {
Bitmap b = Bitmap.createBitmap(BITMAP_WIDTH, BITMAP_HEIGHT, Bitmap.Config.ALPHA_8);
Canvas c = new Canvas(b);
c.drawText(text, 0, BITMAP_HEIGHT / 2, this.paint);
return b;
}
private static byte[] getPixels(final Bitmap b) {
final int byteCount;
--- a/mobile/android/base/java/org/mozilla/gecko/prompts/PromptListAdapter.java
+++ b/mobile/android/base/java/org/mozilla/gecko/prompts/PromptListAdapter.java
@@ -136,17 +136,17 @@ public class PromptListAdapter extends A
if (viewHolder.textView instanceof CheckedTextView) {
// Apparently just using ct.setChecked(true) doesn't work, so this
// is stolen from the android source code as a way to set the checked
// state of these items
list.setItemChecked(position, item.getSelected());
}
}
- boolean isSelected(int position){
+ boolean isSelected(int position) {
return getItem(position).getSelected();
}
ArrayList<Integer> getSelected() {
int length = getCount();
ArrayList<Integer> selected = new ArrayList<Integer>();
for (int i = 0; i < length; i++) {
--- a/mobile/android/base/java/org/mozilla/gecko/push/PushService.java
+++ b/mobile/android/base/java/org/mozilla/gecko/push/PushService.java
@@ -39,17 +39,17 @@ import java.util.Map;
@ReflectionTarget
public class PushService implements BundleEventListener {
private static final String LOG_TAG = "GeckoPushService";
public static final String SERVICE_WEBPUSH = "webpush";
private static PushService sInstance;
- private static final String[] GECKO_EVENTS = new String[]{
+ private static final String[] GECKO_EVENTS = new String[] {
"PushServiceAndroidGCM:Configure",
"PushServiceAndroidGCM:DumpRegistration",
"PushServiceAndroidGCM:DumpSubscriptions",
"PushServiceAndroidGCM:RegisterUserAgent",
"PushServiceAndroidGCM:UnregisterUserAgent",
"PushServiceAndroidGCM:SubscribeChannel",
"PushServiceAndroidGCM:UnsubscribeChannel",
};
--- a/mobile/android/base/java/org/mozilla/gecko/restrictions/RestrictedProfileConfiguration.java
+++ b/mobile/android/base/java/org/mozilla/gecko/restrictions/RestrictedProfileConfiguration.java
@@ -47,17 +47,17 @@ public class RestrictedProfileConfigurat
private static List<Restrictable> hiddenRestrictions = new ArrayList<>();
static {
hiddenRestrictions.add(Restrictable.MASTER_PASSWORD);
hiddenRestrictions.add(Restrictable.GUEST_BROWSING);
hiddenRestrictions.add(Restrictable.DATA_CHOICES);
hiddenRestrictions.add(Restrictable.DEFAULT_THEME);
// Hold behind Nightly flag until we have an actual block list deployed.
- if (!AppConstants.NIGHTLY_BUILD){
+ if (!AppConstants.NIGHTLY_BUILD) {
hiddenRestrictions.add(Restrictable.BLOCK_LIST);
}
}
/* package-private */ static boolean shouldHide(Restrictable restrictable) {
return hiddenRestrictions.contains(restrictable);
}
--- a/mobile/android/base/java/org/mozilla/gecko/widget/DateTimePicker.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/DateTimePicker.java
@@ -140,42 +140,42 @@ public class DateTimePicker extends Fram
setTempDate(Calendar.MINUTE, oldVal, newVal, 0, 59);
} else if (picker == mAMPMSpinner && mHourEnabled) {
mTempDate.set(Calendar.AM_PM, newVal);
} else {
throw new IllegalArgumentException();
}
} else {
if (DEBUG) Log.d(LOGTAG, "Sdk version < 10, using old behavior");
- if (picker == mDaySpinner && mDayEnabled){
+ if (picker == mDaySpinner && mDayEnabled) {
mTempDate.set(Calendar.DAY_OF_MONTH, newVal);
- } else if (picker == mMonthSpinner && mMonthEnabled){
+ } else if (picker == mMonthSpinner && mMonthEnabled) {
mTempDate.set(Calendar.MONTH, newVal);
- if (mTempDate.get(Calendar.MONTH) == newVal + 1){
+ if (mTempDate.get(Calendar.MONTH) == newVal + 1) {
mTempDate.set(Calendar.MONTH, newVal);
mTempDate.set(Calendar.DAY_OF_MONTH,
mTempDate.getActualMaximum(Calendar.DAY_OF_MONTH));
}
- } else if (picker == mWeekSpinner){
+ } else if (picker == mWeekSpinner) {
mTempDate.set(Calendar.WEEK_OF_YEAR, newVal);
- } else if (picker == mYearSpinner && mYearEnabled){
+ } else if (picker == mYearSpinner && mYearEnabled) {
int month = mTempDate.get(Calendar.MONTH);
mTempDate.set(Calendar.YEAR, newVal);
if (month != mTempDate.get(Calendar.MONTH)) {
mTempDate.set(Calendar.MONTH, month);
mTempDate.set(Calendar.DAY_OF_MONTH,
mTempDate.getActualMaximum(Calendar.DAY_OF_MONTH));
}
- } else if (picker == mHourSpinner && mHourEnabled){
+ } else if (picker == mHourSpinner && mHourEnabled) {
if (mIs12HourMode) {
mTempDate.set(Calendar.HOUR, newVal);
} else {
mTempDate.set(Calendar.HOUR_OF_DAY, newVal);
}
- } else if (picker == mMinuteSpinner && mMinuteEnabled){
+ } else if (picker == mMinuteSpinner && mMinuteEnabled) {
mTempDate.set(Calendar.MINUTE, newVal);
} else if (picker == mAMPMSpinner && mHourEnabled) {
mTempDate.set(Calendar.AM_PM, newVal);
} else {
throw new IllegalArgumentException();
}
}
setDate(mTempDate);
@@ -418,17 +418,17 @@ public class DateTimePicker extends Fram
NumberPicker mSpinner = (NumberPicker) findViewById(id);
mSpinner.setMinValue(min);
mSpinner.setMaxValue(max);
mSpinner.setOnValueChangedListener(mOnChangeListener);
mSpinner.setOnLongPressUpdateInterval(100);
return mSpinner;
}
- public long getTimeInMillis(){
+ public long getTimeInMillis() {
return mCurrentDate.getTimeInMillis();
}
private void reorderDateSpinners() {
mDateSpinners.removeAllViews();
char[] order = DateFormat.getDateFormatOrder(getContext());
final int spinnerCount = order.length;
@@ -446,17 +446,17 @@ public class DateTimePicker extends Fram
default:
throw new IllegalArgumentException();
}
}
mDateSpinners.addView(mWeekSpinner);
}
- void setDate(Calendar calendar){
+ void setDate(Calendar calendar) {
mCurrentDate = mTempDate;
if (mCurrentDate.before(mMinDate)) {
mCurrentDate.setTimeInMillis(mMinDate.getTimeInMillis());
} else if (mCurrentDate.after(mMaxDate)) {
mCurrentDate.setTimeInMillis(mMaxDate.getTimeInMillis());
}
}
@@ -537,17 +537,17 @@ public class DateTimePicker extends Fram
}
}
if (mMinuteEnabled) {
mMinuteSpinner.setValue(mCurrentDate.get(Calendar.MINUTE));
}
}
void updateCalendar() {
- if (mCalendarEnabled){
+ if (mCalendarEnabled) {
mCalendar.setDate(mCurrentDate.getTimeInMillis(), false, false);
}
}
void notifyDateChanged() {
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
}
--- a/mobile/android/base/java/org/mozilla/gecko/widget/FaviconView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/FaviconView.java
@@ -98,17 +98,17 @@ public class FaviconView extends ImageVi
sStrokePaint.setStrokeWidth(sStrokeWidth);
}
mStrokeRect.left = mStrokeRect.top = sStrokeWidth;
mBackgroundRect.left = mBackgroundRect.top = sStrokeWidth * 2.0f;
}
@Override
- protected void onSizeChanged(int w, int h, int oldw, int oldh){
+ protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
// No point rechecking the image if there hasn't really been any change.
if (w == mActualWidth && h == mActualHeight) {
return;
}
mActualWidth = w;
--- a/mobile/android/base/java/org/mozilla/gecko/widget/TwoWayView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/TwoWayView.java
@@ -2234,17 +2234,17 @@ public class TwoWayView extends AdapterV
int focusScroll = amountToScrollToNewFocus(direction, newFocus, positionOfNewFocus);
final int maxScrollAmount = getMaxScrollAmount();
if (focusScroll < maxScrollAmount) {
// Not moving too far, safe to give next view focus
newFocus.requestFocus(direction);
mArrowScrollFocusResult.populate(positionOfNewFocus, focusScroll);
return mArrowScrollFocusResult;
- } else if (distanceToView(newFocus) < maxScrollAmount){
+ } else if (distanceToView(newFocus) < maxScrollAmount) {
// Case to consider:
// Too far to get entire next focusable on screen, but by going
// max scroll amount, we are getting it at least partially in view,
// so give it focus and scroll the max amount.
newFocus.requestFocus(direction);
mArrowScrollFocusResult.populate(positionOfNewFocus, maxScrollAmount);
return mArrowScrollFocusResult;
}