Bug 1512274 - [geckoview] Add final to all methods in GeckoView. r=geckoview-reviewers,snorp
☠☠ backed out by 1f911d12fd07 ☠ ☠
authorAgi Sferro <agi@mozilla.com>
Fri, 15 Mar 2019 18:08:36 +0000
changeset 522085 58642fa9c95b0aad2f6adae8b8005f17e41541fc
parent 522084 3812d67603799766ab89a8ee5d4fdfd1c376d0ce
child 522086 380cdbe5557c86bed91f985824cee75321ee282c
push id10871
push usercbrindusan@mozilla.com
push dateMon, 18 Mar 2019 15:49:32 +0000
treeherdermozilla-beta@018abdd16060 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, snorp
bugs1512274
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1512274 - [geckoview] Add final to all methods in GeckoView. r=geckoview-reviewers,snorp Depends on D23682 Differential Revision: https://phabricator.services.mozilla.com/D23683
mobile/android/geckoview/src/main/java/org/mozilla/gecko/AndroidGamepadManager.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/CrashHandler.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/EventDispatcher.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoBatteryManager.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoEditableChild.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoNetworkManager.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoProfile.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoProfileDirectories.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoScreenOrientation.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSharedPrefs.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSystemStateListener.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/InputMethods.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/NSSBridge.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/PrefsHelper.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/SpeechSynthesisService.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/SysInfo.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/TelemetryUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoSurface.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoSurfaceTexture.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/StackScroller.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceAllocator.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceAllocatorService.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceTextureListener.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SyncConfig.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/VsyncSource.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/AsyncCodecFactory.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/BaseHlsPlayer.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/Codec.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/CodecProxy.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/FormatParam.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoAudioInfo.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHLSDemuxerWrapper.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHLSResourceWrapper.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHLSSample.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsAudioRenderer.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsPlayer.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsRendererBase.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsVideoRenderer.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV21.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV23.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoPlayerFactory.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoVideoInfo.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/JellyBeanAsyncCodec.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/MediaDrmProxy.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/MediaManager.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteManager.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteMediaDrmBridge.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteMediaDrmBridgeStub.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/Sample.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SamplePool.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SessionKeyInfo.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SharedMemBuffer.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/Utils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/ByteBufferInputStream.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/DirectBufferAllocator.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/NativeZip.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/SafeIntent.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/SharedMemory.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/permissions/PermissionBlock.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/permissions/Permissions.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/permissions/PermissionsHelper.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoServiceChildProcess.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/sqlite/ByteBufferInputStream.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/sqlite/MatrixBlobCursor.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/sqlite/SQLiteBridge.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/sqlite/SQLiteBridgeException.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityResultHandlerMap.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/BitmapUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ContentUriUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ContextUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/FileUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/FloatUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GamepadUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GeckoBundle.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GeckoJarReader.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/HardwareCodecCapabilityUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/HardwareUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/INIParser.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/INISection.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/IOUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/InputDeviceUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/InputOptionsUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/JSONUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/MenuUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/NetworkUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/NonEvictingLruCache.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/PrefUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ProxySelector.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/RawResource.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/StrictModeContext.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/StringUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ThreadUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/UIAsyncTask.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/BasicSelectionActionDelegate.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/ContentBlocking.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/CrashReporter.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/DynamicToolbarAnimator.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoDisplay.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoEditable.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoFontScaleListener.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoInputConnection.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoInputStream.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoResult.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoWebExecutor.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/MediaElement.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/PanZoomController.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/ParcelableUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/RuntimeSettings.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionFinder.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebRequest.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebRequestError.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebResponse.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/AndroidGamepadManager.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/AndroidGamepadManager.java
@@ -31,46 +31,46 @@ public class AndroidGamepadManager {
     private static enum Axis {
         X(MotionEvent.AXIS_X),
         Y(MotionEvent.AXIS_Y),
         Z(MotionEvent.AXIS_Z),
         RZ(MotionEvent.AXIS_RZ);
 
         public final int axis;
 
-        private Axis(int axis) {
+        private Axis(final int axis) {
             this.axis = axis;
         }
     }
 
     // A list of gamepad button mappings. Axes are determined at
     // runtime, as they vary by Android version.
     private static enum Trigger {
         Left(6),
         Right(7);
 
         public final int button;
 
-        private Trigger(int button) {
+        private Trigger(final int button) {
             this.button = button;
         }
     }
 
     private static final int FIRST_DPAD_BUTTON = 12;
     // A list of axis number, gamepad button mappings for negative, positive.
     // Button mappings are added to FIRST_DPAD_BUTTON.
     private static enum DpadAxis {
         UpDown(MotionEvent.AXIS_HAT_Y, 0, 1),
         LeftRight(MotionEvent.AXIS_HAT_X, 2, 3);
 
         public final int axis;
         public final int negativeButton;
         public final int positiveButton;
 
-        private DpadAxis(int axis, int negativeButton, int positiveButton) {
+        private DpadAxis(final int axis, final int negativeButton, final int positiveButton) {
             this.axis = axis;
             this.negativeButton = negativeButton;
             this.positiveButton = positiveButton;
         }
     }
 
     private static enum Button {
         A(KeyEvent.KEYCODE_BUTTON_A),
@@ -87,31 +87,31 @@ public class AndroidGamepadManager {
         THUMBR(KeyEvent.KEYCODE_BUTTON_THUMBR),
         DPAD_UP(KeyEvent.KEYCODE_DPAD_UP),
         DPAD_DOWN(KeyEvent.KEYCODE_DPAD_DOWN),
         DPAD_LEFT(KeyEvent.KEYCODE_DPAD_LEFT),
         DPAD_RIGHT(KeyEvent.KEYCODE_DPAD_RIGHT);
 
         public final int button;
 
-        private Button(int button) {
+        private Button(final int button) {
             this.button = button;
         }
     }
 
     private static class Gamepad {
         // ID from GamepadService
         public int id;
         // Retain axis state so we can determine changes.
         public float axes[];
         public boolean dpad[];
         public int triggerAxes[];
         public float triggers[];
 
-        public Gamepad(int serviceId, int deviceId) {
+        public Gamepad(final int serviceId, final int deviceId) {
             id = serviceId;
             axes = new float[Axis.values().length];
             dpad = new boolean[4];
             triggers = new float[2];
 
             InputDevice device = InputDevice.getDevice(deviceId);
             if (device != null) {
                 // LTRIGGER/RTRIGGER don't seem to be exposed on older
@@ -189,17 +189,17 @@ public class AndroidGamepadManager {
         ThreadUtils.postToUiThread(new Runnable() {
             @Override
             public void run() {
                 handleGamepadAdded(device_id, service_id);
             }
         });
     }
 
-    /* package */ static void handleGamepadAdded(int deviceId, int serviceId) {
+    /* package */ static void handleGamepadAdded(final int deviceId, final int serviceId) {
         ThreadUtils.assertOnUiThread();
         if (!sStarted) {
             return;
         }
 
         final List<KeyEvent> pending = sPendingGamepads.get(deviceId);
         if (pending == null) {
             removeGamepad(deviceId);
@@ -209,34 +209,34 @@ public class AndroidGamepadManager {
         sPendingGamepads.remove(deviceId);
         sGamepads.put(deviceId, new Gamepad(serviceId, deviceId));
         // Handle queued KeyEvents
         for (KeyEvent ev : pending) {
             handleKeyEvent(ev);
         }
     }
 
-    private static float deadZone(MotionEvent ev, int axis) {
+    private static float deadZone(final MotionEvent ev, final int axis) {
         if (GamepadUtils.isValueInDeadZone(ev, axis)) {
             return 0.0f;
         }
         return ev.getAxisValue(axis);
     }
 
-    private static void mapDpadAxis(Gamepad gamepad,
-                                    boolean pressed,
-                                    float value,
-                                    int which) {
+    private static void mapDpadAxis(final Gamepad gamepad,
+                                    final boolean pressed,
+                                    final float value,
+                                    final int which) {
         if (pressed != gamepad.dpad[which]) {
             gamepad.dpad[which] = pressed;
             onButtonChange(gamepad.id, FIRST_DPAD_BUTTON + which, pressed, Math.abs(value));
         }
     }
 
-    public static boolean handleMotionEvent(MotionEvent ev) {
+    public static boolean handleMotionEvent(final MotionEvent ev) {
         ThreadUtils.assertOnUiThread();
         if (!sStarted) {
             return false;
         }
 
         final Gamepad gamepad = sGamepads.get(ev.getDeviceId());
         if (gamepad == null) {
             // Not a device we care about.
@@ -279,17 +279,17 @@ public class AndroidGamepadManager {
         for (DpadAxis dpadaxis : DpadAxis.values()) {
             float value = deadZone(ev, dpadaxis.axis);
             mapDpadAxis(gamepad, value < 0.0f, value, dpadaxis.negativeButton);
             mapDpadAxis(gamepad, value > 0.0f, value, dpadaxis.positiveButton);
         }
         return true;
     }
 
-    public static boolean handleKeyEvent(KeyEvent ev) {
+    public static boolean handleKeyEvent(final KeyEvent ev) {
         ThreadUtils.assertOnUiThread();
         if (!sStarted) {
             return false;
         }
 
         int deviceId = ev.getDeviceId();
         final List<KeyEvent> pendingGamepad = sPendingGamepads.get(deviceId);
         if (pendingGamepad != null) {
@@ -346,22 +346,22 @@ public class AndroidGamepadManager {
             }
             if ((device.getSources() & InputDevice.SOURCE_GAMEPAD) != InputDevice.SOURCE_GAMEPAD) {
                 continue;
             }
             addGamepad(device);
         }
     }
 
-    private static void addGamepad(InputDevice device) {
+    private static void addGamepad(final InputDevice device) {
         sPendingGamepads.put(device.getId(), new ArrayList<KeyEvent>());
         onGamepadChange(device.getId(), true);
     }
 
-    private static void removeGamepad(int deviceId) {
+    private static void removeGamepad(final int deviceId) {
         Gamepad gamepad = sGamepads.get(deviceId);
         onGamepadChange(gamepad.id, false);
         sGamepads.remove(deviceId);
     }
 
     private static void addDeviceListener(final Context context) {
         if (Build.VERSION.SDK_INT < 16) {
             // Poll known gamepads to see if they've disappeared.
@@ -375,41 +375,41 @@ public class AndroidGamepadManager {
                                 removeGamepad(deviceId);
                             }
                         }
                     }
                 }, POLL_TIMER_PERIOD, POLL_TIMER_PERIOD);
         } else {
             sListener = new InputManager.InputDeviceListener() {
                 @Override
-                public void onInputDeviceAdded(int deviceId) {
+                public void onInputDeviceAdded(final int deviceId) {
                     InputDevice device = InputDevice.getDevice(deviceId);
                     if (device == null) {
                         return;
                     }
                     if ((device.getSources() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) {
                         addGamepad(device);
                     }
                 }
 
                 @Override
-                public void onInputDeviceRemoved(int deviceId) {
+                public void onInputDeviceRemoved(final int deviceId) {
                     if (sPendingGamepads.get(deviceId) != null) {
                         // Got removed before Gecko's ack reached us.
                         // gamepadAdded will deal with it.
                         sPendingGamepads.remove(deviceId);
                         return;
                     }
                     if (sGamepads.get(deviceId) != null) {
                         removeGamepad(deviceId);
                     }
                 }
 
                 @Override
-                public void onInputDeviceChanged(int deviceId) {
+                public void onInputDeviceChanged(final int deviceId) {
                 }
             };
             final InputManager im = (InputManager)
                     context.getSystemService(Context.INPUT_SERVICE);
             im.registerInputDeviceListener(sListener, ThreadUtils.getUiHandler());
         }
     }
 
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/CrashHandler.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/CrashHandler.java
@@ -442,17 +442,17 @@ public class CrashHandler implements Thr
 
     /**
      * Implements the default behavior for handling uncaught exceptions.
      *
      * @param thread The exception thread
      * @param exc An uncaught exception
      */
     @Override
-    public void uncaughtException(Thread thread, Throwable exc) {
+    public void uncaughtException(final Thread thread, final Throwable exc) {
         if (this.crashing) {
             // Prevent possible infinite recusions.
             return;
         }
 
         Thread resolvedThread = thread;
         if (resolvedThread == null) {
             // Gecko may pass in null for thread to denote the current thread.
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/EventDispatcher.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/EventDispatcher.java
@@ -87,17 +87,17 @@ public final class EventDispatcher exten
     @WrapForJNI(calledFrom = "gecko")
     private synchronized void setAttachedToGecko(final int state) {
         if (mAttachedToGecko && state == DETACHED) {
             dispose(false);
         }
         mAttachedToGecko = (state == ATTACHED);
     }
 
-    private void dispose(boolean force) {
+    private void dispose(final boolean force) {
         final Handler geckoHandler = ThreadUtils.sGeckoHandler;
         if (geckoHandler == null) {
             return;
         }
 
         geckoHandler.post(new Runnable() {
             @Override
             public void run() {
@@ -470,18 +470,18 @@ public final class EventDispatcher exten
                     } else {
                         callback.sendError(response);
                     }
                 }
             });
         }
 
         @Override // EventCallback
-        public void sendSuccess(Object response) {
+        public void sendSuccess(final Object response) {
             makeCallback(/* success */ true, response);
         }
 
         @Override // EventCallback
-        public void sendError(Object response) {
+        public void sendError(final Object response) {
             makeCallback(/* success */ false, response);
         }
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
@@ -277,35 +277,35 @@ public class GeckoAppShell
         }
     }
 
     /*
      *  The Gecko-side API: API methods that Gecko calls
      */
 
     @WrapForJNI(exceptionMode = "ignore")
-    private static String getExceptionStackTrace(Throwable e) {
+    private static String getExceptionStackTrace(final Throwable e) {
         return CrashHandler.getExceptionStackTrace(CrashHandler.getRootException(e));
     }
 
     @WrapForJNI(exceptionMode = "ignore")
-    private static synchronized void handleUncaughtException(Throwable e) {
+    private static synchronized void handleUncaughtException(final Throwable e) {
         if (sCrashHandler != null) {
             sCrashHandler.uncaughtException(null, e);
         }
     }
 
-    private static float getLocationAccuracy(Location location) {
+    private static float getLocationAccuracy(final Location location) {
         float radius = location.getAccuracy();
         return (location.hasAccuracy() && radius > 0) ? radius : 1001;
     }
 
     // Permissions are explicitly checked when requesting content permission.
     @SuppressLint("MissingPermission")
-    private static Location getLastKnownLocation(LocationManager lm) {
+    private static Location getLastKnownLocation(final LocationManager lm) {
         Location lastKnownLocation = null;
         List<String> providers = lm.getAllProviders();
 
         for (String provider : providers) {
             Location location = lm.getLastKnownLocation(provider);
             if (location == null) {
                 continue;
             }
@@ -369,17 +369,17 @@ public class GeckoAppShell
             return false;
         }
 
         final Looper l = Looper.getMainLooper();
         lm.requestLocationUpdates(provider, 100, 0.5f, getLocationListener(), l);
         return true;
     }
 
-    private static LocationManager getLocationManager(Context context) {
+    private static LocationManager getLocationManager(final Context context) {
         try {
             return (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
         } catch (NoSuchFieldError e) {
             // Some Tegras throw exceptions about missing the CONTROL_LOCATION_UPDATES permission,
             // which allows enabling/disabling location update notifications from the cell radio.
             // CONTROL_LOCATION_UPDATES is not for use by normal applications, but we might be
             // hitting this problem if the Tegras are confused about missing cell radios.
             Log.e(LOGTAG, "LOCATION_SERVICE not found?!", e);
@@ -404,21 +404,21 @@ public class GeckoAppShell
 
     private static class DefaultListeners implements SensorEventListener,
                                                      LocationListener,
                                                      NotificationListener,
                                                      ScreenOrientationDelegate,
                                                      WakeLockDelegate,
                                                      HapticFeedbackDelegate {
         @Override
-        public void onAccuracyChanged(Sensor sensor, int accuracy) {
+        public void onAccuracyChanged(final Sensor sensor, final int accuracy) {
         }
 
         @Override
-        public void onSensorChanged(SensorEvent s) {
+        public void onSensorChanged(final SensorEvent s) {
             int sensor_type = s.sensor.getType();
             int hal_type = 0;
             float x = 0.0f, y = 0.0f, z = 0.0f, w = 0.0f;
             // SensorEvent timestamp is in nanoseconds, Gecko expects microseconds.
             final long time = s.timestamp / 1000;
 
             switch (sensor_type) {
             case Sensor.TYPE_ACCELEROMETER:
@@ -508,52 +508,54 @@ public class GeckoAppShell
             // properties of the JavaScript Coordinates object.
             GeckoAppShell.onLocationChanged(
                 location.getLatitude(), location.getLongitude(),
                 altitude, accuracy, altitudeAccuracy,
                 heading, speed, location.getTime());
         }
 
         @Override
-        public void onProviderDisabled(String provider)
+        public void onProviderDisabled(final String provider)
         {
         }
 
         @Override
-        public void onProviderEnabled(String provider)
+        public void onProviderEnabled(final String provider)
         {
         }
 
         @Override
-        public void onStatusChanged(String provider, int status, Bundle extras)
+        public void onStatusChanged(final String provider, final int status, final Bundle extras)
         {
         }
 
         @Override // NotificationListener
-        public void showNotification(String name, String cookie, String host,
-                                     String title, String text, String imageUrl) {
+        public void showNotification(final String name, final String cookie, final String host,
+                                     final String title, final String text, final String imageUrl) {
             // Default is to not show the notification, and immediate send close message.
             GeckoAppShell.onNotificationClose(name, cookie);
         }
 
         @Override // NotificationListener
-        public void showPersistentNotification(String name, String cookie, String host,
-                                               String title, String text, String imageUrl,
-                                               String data) {
+        public void showPersistentNotification(final String name, final String cookie,
+                                               final String host, final String title,
+                                               final String text, final String imageUrl,
+                                               final String data) {
             // Default is to not show the notification, and immediate send close message.
             GeckoAppShell.onNotificationClose(name, cookie);
         }
 
         @Override // NotificationListener
-        public void closeNotification(String name) {
+        public void closeNotification(final String name) {
             // Do nothing.
         }
 
         @Override // ScreenOrientationDelegate
-        public boolean setRequestedOrientationForCurrentActivity(int requestedActivityInfoOrientation) {
+        public boolean setRequestedOrientationForCurrentActivity(
+                final int requestedActivityInfoOrientation) {
             // Do nothing, and report that the orientation was not set.
             return false;
         }
 
         private SimpleArrayMap<String, PowerManager.WakeLock> mWakeLocks;
 
         @Override // WakeLockDelegate
         @SuppressLint("Wakelock") // We keep the wake lock independent from the function
@@ -649,17 +651,18 @@ public class GeckoAppShell
     public static void setNotificationListener(final NotificationListener listener) {
         sNotificationListener = (listener != null) ? listener : DEFAULT_LISTENERS;
     }
 
     public static ScreenOrientationDelegate getScreenOrientationDelegate() {
         return sScreenOrientationDelegate;
     }
 
-    public static void setScreenOrientationDelegate(@Nullable ScreenOrientationDelegate screenOrientationDelegate) {
+    public static void setScreenOrientationDelegate(
+            final @Nullable ScreenOrientationDelegate screenOrientationDelegate) {
         sScreenOrientationDelegate = (screenOrientationDelegate != null) ? screenOrientationDelegate : DEFAULT_LISTENERS;
     }
 
     public static WakeLockDelegate getWakeLockDelegate() {
         return sWakeLockDelegate;
     }
 
     public void setWakeLockDelegate(final WakeLockDelegate delegate) {
@@ -671,17 +674,17 @@ public class GeckoAppShell
     }
 
     public static void setHapticFeedbackDelegate(final HapticFeedbackDelegate delegate) {
         sHapticFeedbackDelegate = (delegate != null) ? delegate : DEFAULT_LISTENERS;
     }
 
     @SuppressWarnings("fallthrough")
     @WrapForJNI(calledFrom = "gecko")
-    private static void enableSensor(int aSensortype) {
+    private static void enableSensor(final int aSensortype) {
         final SensorManager sm = (SensorManager)
             getApplicationContext().getSystemService(Context.SENSOR_SERVICE);
 
         switch (aSensortype) {
         case GeckoHalDefines.SENSOR_GAME_ROTATION_VECTOR:
             if (gGameRotationVectorSensor == null) {
                 gGameRotationVectorSensor = sm.getDefaultSensor(
                         Sensor.TYPE_GAME_ROTATION_VECTOR);
@@ -783,17 +786,17 @@ public class GeckoAppShell
         default:
             Log.w(LOGTAG, "Error! Can't enable unknown SENSOR type " +
                   aSensortype);
         }
     }
 
     @SuppressWarnings("fallthrough")
     @WrapForJNI(calledFrom = "gecko")
-    private static void disableSensor(int aSensortype) {
+    private static void disableSensor(final int aSensortype) {
         final SensorManager sm = (SensorManager)
             getApplicationContext().getSystemService(Context.SENSOR_SERVICE);
 
         switch (aSensortype) {
         case GeckoHalDefines.SENSOR_GAME_ROTATION_VECTOR:
             if (gGameRotationVectorSensor != null) {
                 sm.unregisterListener(getSensorListener(), gGameRotationVectorSensor);
               break;
@@ -855,26 +858,26 @@ public class GeckoAppShell
     @JNITarget
     static public int getPreferredIconSize() {
         ActivityManager am = (ActivityManager)
             getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE);
         return am.getLauncherLargeIconSize();
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    private static String[] getHandlersForMimeType(String aMimeType, String aAction) {
+    private static String[] getHandlersForMimeType(final String aMimeType, final String aAction) {
         final GeckoInterface geckoInterface = getGeckoInterface();
         if (geckoInterface == null) {
             return new String[] {};
         }
         return geckoInterface.getHandlersForMimeType(aMimeType, aAction);
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    private static String[] getHandlersForURL(String aURL, String aAction) {
+    private static String[] getHandlersForURL(final String aURL, final String aAction) {
         final GeckoInterface geckoInterface = getGeckoInterface();
         if (geckoInterface == null) {
             return new String[] {};
         }
         return geckoInterface.getHandlersForURL(aURL, aAction);
     }
 
     @WrapForJNI(calledFrom = "gecko")
@@ -882,38 +885,38 @@ public class GeckoAppShell
       return HardwareCodecCapabilityUtils.getHWEncoderCapability();
     }
 
     @WrapForJNI(calledFrom = "gecko")
     private static boolean getHWDecoderCapability() {
       return HardwareCodecCapabilityUtils.getHWDecoderCapability();
     }
 
-    static List<ResolveInfo> queryIntentActivities(Intent intent) {
+    static List<ResolveInfo> queryIntentActivities(final Intent intent) {
         final PackageManager pm = getApplicationContext().getPackageManager();
 
         // Exclude any non-exported activities: we can't open them even if we want to!
         // Bug 1031569 has some details.
         final ArrayList<ResolveInfo> list = new ArrayList<>();
         for (ResolveInfo ri: pm.queryIntentActivities(intent, 0)) {
             if (ri.activityInfo.exported) {
                 list.add(ri);
             }
         }
 
         return list;
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    public static String getExtensionFromMimeType(String aMimeType) {
+    public static String getExtensionFromMimeType(final String aMimeType) {
         return MimeTypeMap.getSingleton().getExtensionFromMimeType(aMimeType);
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    public static String getMimeTypeFromExtensions(String aFileExt) {
+    public static String getMimeTypeFromExtensions(final String aFileExt) {
         StringTokenizer st = new StringTokenizer(aFileExt, ".,; ");
         String type = null;
         String subType = null;
         while (st.hasMoreElements()) {
             String ext = st.nextToken();
             String mt = getMimeTypeFromExtension(ext);
             if (mt == null)
                 continue;
@@ -929,22 +932,22 @@ public class GeckoAppShell
             type = "*";
         if (subType == null)
             subType = "*";
         return type + "/" + subType;
     }
 
     @SuppressWarnings("try")
     @WrapForJNI(calledFrom = "gecko")
-    private static boolean openUriExternal(String targetURI,
-                                           String mimeType,
-                                           String packageName,
-                                           String className,
-                                           String action,
-                                           String title) {
+    private static boolean openUriExternal(final String targetURI,
+                                           final String mimeType,
+                                           final String packageName,
+                                           final String className,
+                                           final String action,
+                                           final String title) {
         final GeckoInterface geckoInterface = getGeckoInterface();
         if (geckoInterface == null) {
             return false;
         }
         // Bug 1450449 - Downloaded files already are already in a public directory and aren't
         // really owned exclusively by Firefox, so there's no real benefit to using
         // content:// URIs here.
         try (StrictModeContext unused = StrictModeContext.allowAllVmPolicies()) {
@@ -981,30 +984,30 @@ public class GeckoAppShell
      */
     public static void onNotificationClick(final String name, final String cookie) {
         if (GeckoThread.isRunning()) {
             notifyAlertListener(name, "alertclickcallback", cookie);
         }
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    private static void showNotification(String name, String cookie, String title,
-                                         String text, String host, String imageUrl,
-                                         String persistentData) {
+    private static void showNotification(final String name, final String cookie, final String title,
+                                         final String text, final String host,
+                                         final String imageUrl, final String persistentData) {
         if (persistentData == null) {
             getNotificationListener().showNotification(name, cookie, title, text, host, imageUrl);
             return;
         }
 
         getNotificationListener().showPersistentNotification(
                 name, cookie, title, text, host, imageUrl, persistentData);
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    private static void closeNotification(String name) {
+    private static void closeNotification(final String name) {
         getNotificationListener().closeNotification(name);
     }
 
     public static synchronized void setDisplayDpiOverride(@Nullable final Integer dpi) {
         if (dpi == null) {
             return;
         }
         if (sDensityDpi != 0) {
@@ -1066,68 +1069,68 @@ public class GeckoAppShell
                 sScreenDepth = sUseMaxScreenDepth ? info.bitsPerPixel : 24;
             }
         }
 
         return sScreenDepth;
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    private static void performHapticFeedback(boolean aIsLongPress) {
+    private static void performHapticFeedback(final boolean aIsLongPress) {
         // Don't perform haptic feedback if a vibration is currently playing,
         // because the haptic feedback will nuke the vibration.
         if (!sVibrationMaybePlaying || System.nanoTime() >= sVibrationEndTime) {
             getHapticFeedbackDelegate().performHapticFeedback(
                     aIsLongPress ? HapticFeedbackConstants.LONG_PRESS
                                  : HapticFeedbackConstants.VIRTUAL_KEY);
             sVibrationMaybePlaying = false;
             sVibrationEndTime = 0;
         }
     }
 
     private static Vibrator vibrator() {
         return (Vibrator) getApplicationContext().getSystemService(Context.VIBRATOR_SERVICE);
     }
 
     // Helper method to convert integer array to long array.
-    private static long[] convertIntToLongArray(int[] input) {
+    private static long[] convertIntToLongArray(final int[] input) {
         long[] output = new long[input.length];
         for (int i = 0; i < input.length; i++) {
             output[i] = input[i];
         }
         return output;
     }
 
     // Vibrate only if haptic feedback is enabled.
-    private static void vibrateOnHapticFeedbackEnabled(int[] milliseconds) {
+    private static void vibrateOnHapticFeedbackEnabled(final int[] milliseconds) {
         if (Settings.System.getInt(getApplicationContext().getContentResolver(),
                                    Settings.System.HAPTIC_FEEDBACK_ENABLED, 0) > 0) {
             if (milliseconds.length == 1) {
                 vibrate(milliseconds[0]);
             } else {
                 vibrate(convertIntToLongArray(milliseconds), -1);
             }
         }
     }
 
     @SuppressLint("MissingPermission")
     @WrapForJNI(calledFrom = "gecko")
-    private static void vibrate(long milliseconds) {
+    private static void vibrate(final long milliseconds) {
         sVibrationEndTime = System.nanoTime() + milliseconds * 1000000;
         sVibrationMaybePlaying = true;
         try {
             vibrator().vibrate(milliseconds);
         } catch (final SecurityException ignore) {
             Log.w(LOGTAG, "No VIBRATE permission");
         }
     }
 
     @SuppressLint("MissingPermission")
     @WrapForJNI(calledFrom = "gecko")
-    private static void vibrate(long[] pattern, int repeat) {
+    private static void vibrate(final long[] pattern, final int repeat) {
         // If pattern.length is odd, the last element in the pattern is a
         // meaningless delay, so don't include it in vibrationDuration.
         long vibrationDuration = 0;
         int iterLen = pattern.length & ~1;
         for (int i = 0; i < iterLen; i++) {
           vibrationDuration += pattern[i];
         }
 
@@ -1274,31 +1277,31 @@ public class GeckoAppShell
 
         return result;
     }
 
     @WrapForJNI(calledFrom = "gecko")
     public static void killAnyZombies() {
         GeckoProcessesVisitor visitor = new GeckoProcessesVisitor() {
             @Override
-            public boolean callback(int pid) {
+            public boolean callback(final int pid) {
                 if (pid != android.os.Process.myPid())
                     android.os.Process.killProcess(pid);
                 return true;
             }
         };
 
         EnumerateGeckoProcesses(visitor);
     }
 
     interface GeckoProcessesVisitor {
         boolean callback(int pid);
     }
 
-    private static void EnumerateGeckoProcesses(GeckoProcessesVisitor visiter) {
+    private static void EnumerateGeckoProcesses(final GeckoProcessesVisitor visiter) {
         int pidColumn = -1;
         int userColumn = -1;
 
         Process ps = null;
         InputStreamReader inputStreamReader = null;
         BufferedReader in = null;
         try {
             // run ps and parse its output
@@ -1342,17 +1345,17 @@ public class GeckoAppShell
             IOUtils.safeStreamClose(in);
             IOUtils.safeStreamClose(inputStreamReader);
             if (ps != null) {
                 ps.destroy();
             }
         }
     }
 
-    public static String getAppNameByPID(int pid) {
+    public static String getAppNameByPID(final int pid) {
         BufferedReader cmdlineReader = null;
         String path = "/proc/" + pid + "/cmdline";
         try {
             File cmdlineFile = new File(path);
             if (!cmdlineFile.exists())
                 return "";
             cmdlineReader = new BufferedReader(new FileReader(cmdlineFile));
             return cmdlineReader.readLine().trim();
@@ -1414,17 +1417,17 @@ public class GeckoAppShell
             IOUtils.safeStreamClose(inputStreamReader);
             if (process != null) {
                 process.destroy();
             }
         }
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    private static byte[] getIconForExtension(String aExt, int iconSize) {
+    private static byte[] getIconForExtension(final String aExt, final int iconSize) {
         try {
             int resolvedIconSize = iconSize;
             if (iconSize <= 0) {
                 resolvedIconSize = 16;
             }
 
             String resolvedExt = aExt;
             if (aExt != null && aExt.length() > 1 && aExt.charAt(0) == '.') {
@@ -1448,22 +1451,22 @@ public class GeckoAppShell
             return buf.array();
         }
         catch (Exception e) {
             Log.w(LOGTAG, "getIconForExtension failed.",  e);
             return null;
         }
     }
 
-    public static String getMimeTypeFromExtension(String ext) {
+    public static String getMimeTypeFromExtension(final String ext) {
         final MimeTypeMap mtm = MimeTypeMap.getSingleton();
         return mtm.getMimeTypeFromExtension(ext);
     }
 
-    private static Drawable getDrawableForExtension(PackageManager pm, String aExt) {
+    private static Drawable getDrawableForExtension(final PackageManager pm, final String aExt) {
         Intent intent = new Intent(Intent.ACTION_VIEW);
         final String mimeType = getMimeTypeFromExtension(aExt);
         if (mimeType != null && mimeType.length() > 0)
             intent.setType(mimeType);
         else
             return null;
 
         List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);
@@ -1512,47 +1515,48 @@ public class GeckoAppShell
     };
 
     private static GeckoInterface sGeckoInterface;
 
     public static GeckoInterface getGeckoInterface() {
         return sGeckoInterface;
     }
 
-    public static void setGeckoInterface(GeckoInterface aGeckoInterface) {
+    public static void setGeckoInterface(final GeckoInterface aGeckoInterface) {
         sGeckoInterface = aGeckoInterface;
     }
 
     /* package */ static Camera sCamera;
 
     private static final int kPreferredFPS = 25;
     private static byte[] sCameraBuffer;
 
     private static class CameraCallback implements Camera.PreviewCallback {
         @WrapForJNI(calledFrom = "gecko")
         private static native void onFrameData(int camera, byte[] data);
 
         private final int mCamera;
 
-        public CameraCallback(int camera) {
+        public CameraCallback(final int camera) {
             mCamera = camera;
         }
 
         @Override
-        public void onPreviewFrame(byte[] data, Camera camera) {
+        public void onPreviewFrame(final byte[] data, final Camera camera) {
             onFrameData(mCamera, data);
 
             if (sCamera != null) {
                 sCamera.addCallbackBuffer(sCameraBuffer);
             }
         }
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    private static int[] initCamera(String aContentType, int aCamera, int aWidth, int aHeight) {
+    private static int[] initCamera(final String aContentType, final int aCamera, final int aWidth,
+                                    final int aHeight) {
         // [0] = 0|1 (failure/success)
         // [1] = width
         // [2] = height
         // [3] = fps
         int[] result = new int[4];
         result[0] = 0;
 
         if (Camera.getNumberOfCameras() == 0) {
@@ -1691,17 +1695,17 @@ public class GeckoAppShell
     }
 
     @WrapForJNI(calledFrom = "gecko")
     private static void disableScreenOrientationNotifications() {
         GeckoScreenOrientation.getInstance().disableNotifications();
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    private static void lockScreenOrientation(int aOrientation) {
+    private static void lockScreenOrientation(final int aOrientation) {
         // TODO: don't vector through GeckoAppShell.
         GeckoScreenOrientation.getInstance().lock(aOrientation);
     }
 
     @WrapForJNI(calledFrom = "gecko")
     private static void unlockScreenOrientation() {
         // TODO: don't vector through GeckoAppShell.
         GeckoScreenOrientation.getInstance().unlock();
@@ -1732,17 +1736,18 @@ public class GeckoAppShell
         if (profile != null) {
             File lock = profile.getFile(".parentlock");
             return lock != null && lock.exists() && lock.delete();
         }
         return false;
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    private static String getProxyForURI(String spec, String scheme, String host, int port) {
+    private static String getProxyForURI(final String spec, final String scheme, final String host,
+                                         final int port) {
         final ProxySelector ps = new ProxySelector();
 
         Proxy proxy = ps.select(scheme, host);
         if (Proxy.NO_PROXY.equals(proxy)) {
             return "DIRECT";
         }
 
         switch (proxy.type()) {
@@ -1751,24 +1756,25 @@ public class GeckoAppShell
             case SOCKS:
                 return "SOCKS " + proxy.address().toString();
         }
 
         return "DIRECT";
     }
 
     @WrapForJNI
-    private static InputStream createInputStream(URLConnection connection) throws IOException {
+    private static InputStream createInputStream(final URLConnection connection)
+            throws IOException {
         return connection.getInputStream();
     }
 
     private static class BitmapConnection extends URLConnection {
         private Bitmap bitmap;
 
-        BitmapConnection(Bitmap b) throws MalformedURLException, IOException {
+        BitmapConnection(final Bitmap b) throws MalformedURLException, IOException {
             super(null);
             bitmap = b;
         }
 
         @Override
         public void connect() {}
 
         @Override
@@ -1780,18 +1786,19 @@ public class GeckoAppShell
         public String getContentType() {
             return "image/png";
         }
 
         private final class BitmapInputStream extends PipedInputStream {
             private boolean mHaveConnected = false;
 
             @Override
-            public synchronized int read(byte[] buffer, int byteOffset, int byteCount)
-                                    throws IOException {
+            public synchronized int read(final byte[] buffer, final int byteOffset,
+                                         final int byteCount)
+            throws IOException {
                 if (mHaveConnected) {
                     return super.read(buffer, byteOffset, byteCount);
                 }
 
                 final PipedOutputStream output = new PipedOutputStream();
                 connect(output);
 
                 ThreadUtils.postToBackgroundThread(
@@ -1807,17 +1814,17 @@ public class GeckoAppShell
                     });
                 mHaveConnected = true;
                 return super.read(buffer, byteOffset, byteCount);
             }
         }
     }
 
     @WrapForJNI
-    private static URLConnection getConnection(String url) {
+    private static URLConnection getConnection(final String url) {
         try {
             String spec;
             if (url.startsWith("android://")) {
                 spec = url.substring(10);
             } else {
                 spec = url.substring(8);
             }
 
@@ -1845,17 +1852,17 @@ public class GeckoAppShell
             }
         } catch (Exception ex) {
             return null;
         }
         return null;
     }
 
     @WrapForJNI
-    private static String connectionGetMimeType(URLConnection connection) {
+    private static String connectionGetMimeType(final URLConnection connection) {
         return connection.getContentType();
     }
 
     @WrapForJNI(calledFrom = "gecko")
     private static int getMaxTouchPoints() {
         PackageManager pm = getApplicationContext().getPackageManager();
         if (pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND)) {
             // at least, 5+ fingers.
@@ -1875,17 +1882,17 @@ public class GeckoAppShell
 
     /*
      * Keep in sync with PointerCapabilities in ServoTypes.h
     */
     static private final int NO_POINTER            = 0x00000000;
     static private final int COARSE_POINTER        = 0x00000001;
     static private final int FINE_POINTER          = 0x00000002;
     static private final int HOVER_CAPABLE_POINTER = 0x00000004;
-    private static int getPointerCapabilities(InputDevice inputDevice) {
+    private static int getPointerCapabilities(final InputDevice inputDevice) {
         int result = NO_POINTER;
         int sources = inputDevice.getSources();
 
         if (hasInputDeviceSource(sources, InputDevice.SOURCE_TOUCHSCREEN) ||
             hasInputDeviceSource(sources, InputDevice.SOURCE_JOYSTICK)) {
             result |= COARSE_POINTER;
         } else if (hasInputDeviceSource(sources, InputDevice.SOURCE_MOUSE) ||
                    hasInputDeviceSource(sources, InputDevice.SOURCE_STYLUS) ||
@@ -1939,17 +1946,17 @@ public class GeckoAppShell
             // We need information only for the primary pointer.
             // (Assumes that the primary pointer appears first in the list)
             break;
         }
 
         return result;
     }
 
-    private static boolean hasInputDeviceSource(int sources, int inputDeviceSource) {
+    private static boolean hasInputDeviceSource(final int sources, final int inputDeviceSource) {
         return (sources & inputDeviceSource) == inputDeviceSource;
     }
 
     public static synchronized void setScreenSizeOverride(final Rect size) {
         sScreenSizeOverride = size;
     }
 
     @WrapForJNI(calledFrom = "gecko")
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoBatteryManager.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoBatteryManager.java
@@ -73,17 +73,17 @@ public class GeckoBatteryManager extends
         mIsEnabled = false;
     }
 
     @WrapForJNI(calledFrom = "ui", dispatchTo = "gecko")
     private static native void onBatteryChange(double level, boolean charging,
                                                double remainingTime);
 
     @Override
-    public void onReceive(Context context, Intent intent) {
+    public void onReceive(final Context context, final Intent intent) {
         if (!intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {
             Log.e(LOGTAG, "Got an unexpected intent!");
             return;
         }
 
         boolean previousCharging = isCharging();
         double previousLevel = getLevel();
 
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoEditableChild.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoEditableChild.java
@@ -31,52 +31,53 @@ public final class GeckoEditableChild ex
 
     private final class RemoteChild extends IGeckoEditableChild.Stub {
         @Override // IGeckoEditableChild
         public void transferParent(final IGeckoEditableParent editableParent) {
             GeckoEditableChild.this.transferParent(editableParent);
         }
 
         @Override // IGeckoEditableChild
-        public void onKeyEvent(int action, int keyCode, int scanCode, int metaState,
-                               int keyPressMetaState, long time, int domPrintableKeyValue,
-                               int repeatCount, int flags, boolean isSynthesizedImeKey,
-                               KeyEvent event) {
+        public void onKeyEvent(final int action, final int keyCode, final int scanCode,
+                               final int metaState, final int keyPressMetaState, final long time,
+                               final int domPrintableKeyValue, final int repeatCount,
+                               final int flags, final boolean isSynthesizedImeKey,
+                               final KeyEvent event) {
             GeckoEditableChild.this.onKeyEvent(
                     action, keyCode, scanCode, metaState, keyPressMetaState, time,
                     domPrintableKeyValue, repeatCount, flags, isSynthesizedImeKey, event);
         }
 
         @Override // IGeckoEditableChild
         public void onImeSynchronize() {
             GeckoEditableChild.this.onImeSynchronize();
         }
 
         @Override // IGeckoEditableChild
-        public void onImeReplaceText(int start, int end, String text) {
+        public void onImeReplaceText(final int start, final int end, final String text) {
             GeckoEditableChild.this.onImeReplaceText(start, end, text);
         }
 
         @Override // IGeckoEditableChild
-        public void onImeAddCompositionRange(int start, int end, int rangeType,
-                                             int rangeStyles, int rangeLineStyle,
-                                             boolean rangeBoldLine, int rangeForeColor,
-                                             int rangeBackColor, int rangeLineColor) {
+        public void onImeAddCompositionRange(final int start, final int end, final int rangeType,
+                                             final int rangeStyles, final int rangeLineStyle,
+                                             final boolean rangeBoldLine, final int rangeForeColor,
+                                             final int rangeBackColor, final int rangeLineColor) {
             GeckoEditableChild.this.onImeAddCompositionRange(
                     start, end, rangeType, rangeStyles, rangeLineStyle, rangeBoldLine,
                     rangeForeColor, rangeBackColor, rangeLineColor);
         }
 
         @Override // IGeckoEditableChild
-        public void onImeUpdateComposition(int start, int end, int flags) {
+        public void onImeUpdateComposition(final int start, final int end, final int flags) {
             GeckoEditableChild.this.onImeUpdateComposition(start, end, flags);
         }
 
         @Override // IGeckoEditableChild
-        public void onImeRequestCursorUpdates(int requestMode) {
+        public void onImeRequestCursorUpdates(final int requestMode) {
             GeckoEditableChild.this.onImeRequestCursorUpdates(requestMode);
         }
     }
 
     private final IGeckoEditableChild mEditableChild;
     private final boolean mIsDefault;
 
     private IGeckoEditableParent mEditableParent;
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoNetworkManager.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoNetworkManager.java
@@ -119,17 +119,17 @@ public class GeckoNetworkManager extends
         return new double[] {
                 connectionType.value,
                 connectionType == ConnectionType.WIFI ? 1.0 : 0.0,
                 connectionType == ConnectionType.WIFI ? wifiDhcpGatewayAddress(applicationContext) : 0.0
         };
     }
 
     @Override
-    public void onReceive(Context aContext, Intent aIntent) {
+    public void onReceive(final Context aContext, final Intent aIntent) {
         handleManagerEvent(ManagerEvent.receivedUpdate);
     }
 
     public void start(final Context context) {
         this.context = context;
         handleManagerEvent(ManagerEvent.start);
     }
 
@@ -147,17 +147,17 @@ public class GeckoNetworkManager extends
 
     /**
      * For a given event, figure out the next state, run any transition by-product actions, and switch
      * current state to the next state. If event is invalid for the current state, this is a no-op.
      *
      * @param event Incoming event
      * @return Boolean indicating if transition was performed.
      */
-    private synchronized boolean handleManagerEvent(ManagerEvent event) {
+    private synchronized boolean handleManagerEvent(final ManagerEvent event) {
         final ManagerState nextState = getNextState(currentState, event);
 
         Log.d(LOGTAG, "Incoming event " + event + " for state " + currentState + " -> " + nextState);
         if (nextState == null) {
             Log.w(LOGTAG, "Invalid event " + event + " for state " + currentState);
             return false;
         }
 
@@ -189,17 +189,18 @@ public class GeckoNetworkManager extends
     /**
      * Defines a transition matrix for our state machine. For a given state/event pair, returns nextState.
      *
      * @param currentState Current state against which we have an incoming event
      * @param event Incoming event for which we'd like to figure out the next state
      * @return State into which we should transition as result of given event
      */
     @Nullable
-    public static ManagerState getNextState(@NonNull ManagerState currentState, @NonNull ManagerEvent event) {
+    public static ManagerState getNextState(final @NonNull ManagerState currentState,
+                                            final @NonNull ManagerEvent event) {
         switch (currentState) {
             case OffNoListeners:
                 switch (event) {
                     case start:
                         return ManagerState.OnNoListeners;
                     case enableNotifications:
                         return ManagerState.OffWithListeners;
                     default:
@@ -461,17 +462,17 @@ public class GeckoNetworkManager extends
         int ip = info.getIpAddress();
         if (ip == 0) {
             callback.sendError("Cannot get IPv4 address");
             return;
         }
         callback.sendSuccess(Formatter.formatIpAddress(ip));
     }
 
-    private static int getNetworkOperator(InfoType type, Context context) {
+    private static int getNetworkOperator(final InfoType type, final Context context) {
         if (null == context) {
             return -1;
         }
 
         TelephonyManager tel = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
         if (tel == null) {
             Log.e(LOGTAG, "Telephony service does not exist");
             return -1;
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoProfile.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoProfile.java
@@ -158,56 +158,58 @@ public final class GeckoProfile {
             informIfCustomProfileIsUnavailable(profileName, false);
             // Get the default profile for the Activity.
             return getDefaultProfile(context);
         }
 
         return GeckoProfile.get(context, profileName, profilePath);
     }
 
-    private static GeckoProfile getDefaultProfile(Context context) {
+    private static GeckoProfile getDefaultProfile(final Context context) {
         try {
             return get(context, getDefaultProfileName(context));
 
         } catch (final NoMozillaDirectoryException e) {
             // If this failed, we're screwed.
             Log.wtf(LOGTAG, "Unable to get default profile name.", e);
             throw new RuntimeException(e);
         }
     }
 
-    public static GeckoProfile get(Context context) {
+    public static GeckoProfile get(final Context context) {
         return get(context, null, (File) null);
     }
 
-    public static GeckoProfile get(Context context, String profileName) {
+    public static GeckoProfile get(final Context context, final String profileName) {
         if (profileName != null) {
             GeckoProfile profile = sProfileCache.get(profileName);
             if (profile != null)
                 return profile;
         }
         return get(context, profileName, (File)null);
     }
 
     @RobocopTarget
-    public static GeckoProfile get(Context context, String profileName, String profilePath) {
+    public static GeckoProfile get(final Context context, final String profileName,
+                                   final String profilePath) {
         File dir = null;
         if (!TextUtils.isEmpty(profilePath)) {
             dir = new File(profilePath);
             if (!dir.exists() || !dir.isDirectory()) {
                 Log.w(LOGTAG, "requested profile directory missing: " + profilePath);
             }
         }
         return get(context, profileName, dir);
     }
 
     // Note that the profile cache respects only the profile name!
     // If the directory changes, the returned GeckoProfile instance will be mutated.
     @RobocopTarget
-    public static GeckoProfile get(Context context, String profileName, File profileDir) {
+    public static GeckoProfile get(final Context context, final String profileName,
+                                   final File profileDir) {
         if (context == null) {
             throw new IllegalArgumentException("context must be non-null");
         }
 
         // Null name? | Null dir? | Returned profile
         // ------------------------------------------
         //     Yes    |    Yes    | Active profile or default profile.
         //     No     |    Yes    | Profile with specified name at default dir.
@@ -335,17 +337,18 @@ public final class GeckoProfile {
 
         try {
             return profileDir.getCanonicalPath().equals(getGuestDir(context).getCanonicalPath());
         } catch (final IOException e) {
             return false;
         }
     }
 
-    private GeckoProfile(Context context, String profileName, File profileDir) throws NoMozillaDirectoryException {
+    private GeckoProfile(final Context context, final String profileName, final File profileDir)
+            throws NoMozillaDirectoryException {
         if (profileName == null) {
             throw new IllegalArgumentException("Unable to create GeckoProfile for empty profile name.");
         }
 
         mName = profileName;
         mMozillaDir = GeckoProfileDirectories.getMozillaDirectory(context);
 
         mProfileDir = profileDir;
@@ -401,17 +404,17 @@ public final class GeckoProfile {
      * #getLock()}.
      *
      * @param data Custom data object
      */
     public void setData(final Object data) {
         mData = data;
     }
 
-    private void setDir(File dir) {
+    private void setDir(final File dir) {
         if (dir != null && dir.exists() && dir.isDirectory()) {
             synchronized (this) {
                 mProfileDir = dir;
                 mInGuestMode = null;
             }
         }
     }
 
@@ -469,17 +472,17 @@ public final class GeckoProfile {
                 // If it doesn't exist, create it.
                 mProfileDir = createProfileDir();
             }
         } catch (IOException ioe) {
             Log.e(LOGTAG, "Error getting profile dir", ioe);
         }
     }
 
-    public File getFile(String aFile) {
+    public File getFile(final String aFile) {
         File f = getDir();
         if (f == null)
             return null;
 
         return new File(f, aFile);
     }
 
     /**
@@ -658,17 +661,17 @@ public final class GeckoProfile {
      * hold the previous session (where it is used to read the "tabs from last time").
      * If we're not restoring tabs automatically, sessionstore.js needs to be moved to
      * sessionstore.old, so we can display the correct "tabs from last time".
      * If we *are* restoring tabs, we need to delete outdated copies of sessionstore.old,
      * so we don't continue showing stale "tabs from last time" indefinitely.
      *
      * @param shouldRestore Pass true if we are automatically restoring last session's tabs.
      */
-    public void updateSessionFile(boolean shouldRestore) {
+    public void updateSessionFile(final boolean shouldRestore) {
         File sessionFilePrevious = getFile(SESSION_FILE_PREVIOUS);
         if (!shouldRestore) {
             File sessionFile = getFile(SESSION_FILE);
             if (sessionFile != null && sessionFile.exists()) {
                 sessionFile.renameTo(sessionFilePrevious);
             }
         } else {
             if (sessionFilePrevious != null && sessionFilePrevious.exists() &&
@@ -701,33 +704,33 @@ public final class GeckoProfile {
      * In general, sessionstore.js holds the current session, and
      * sessionstore.bak holds a backup copy in case of interrupted writes.
      *
      * @param readBackup if true, the session is read from sessionstore.bak;
      *                   otherwise, the session is read from sessionstore.js
      *
      * @return the session string
      */
-    public String readSessionFile(boolean readBackup) {
+    public String readSessionFile(final boolean readBackup) {
         return readSessionFile(readBackup ? SESSION_FILE_BACKUP : SESSION_FILE);
     }
 
     /**
      * Get the string from last session's session file.
      *
      * If we are not restoring tabs automatically, sessionstore.old will contain
      * the previous session.
      *
      * @return the session string
      */
     public String readPreviousSessionFile() {
         return readSessionFile(SESSION_FILE_PREVIOUS);
     }
 
-    private String readSessionFile(String fileName) {
+    private String readSessionFile(final String fileName) {
         File sessionFile = getFile(fileName);
 
         try {
             if (sessionFile != null && sessionFile.exists()) {
                 return readFile(sessionFile);
             }
         } catch (IOException ioe) {
             Log.e(LOGTAG, "Unable to read session file", ioe);
@@ -807,42 +810,42 @@ public final class GeckoProfile {
         try {
             jsonArray = new JSONArray(fileContent);
         } catch (JSONException e) {
             jsonArray = new JSONArray();
         }
         return jsonArray;
     }
 
-    public String readFile(String filename) throws IOException {
+    public String readFile(final String filename) throws IOException {
         File dir = getDir();
         if (dir == null) {
             throw new IOException("No profile directory found");
         }
         File target = new File(dir, filename);
         return readFile(target);
     }
 
-    private String readFile(File target) throws IOException {
+    private String readFile(final File target) throws IOException {
         FileReader fr = new FileReader(target);
         try {
             StringBuilder sb = new StringBuilder();
             char[] buf = new char[8192];
             int read = fr.read(buf);
             while (read >= 0) {
                 sb.append(buf, 0, read);
                 read = fr.read(buf);
             }
             return sb.toString();
         } finally {
             fr.close();
         }
     }
 
-    public boolean deleteFileFromProfileDir(String fileName) throws IllegalArgumentException {
+    public boolean deleteFileFromProfileDir(final String fileName) throws IllegalArgumentException {
         if (TextUtils.isEmpty(fileName)) {
             throw new IllegalArgumentException("Filename cannot be empty.");
         }
         File file = new File(getDir(), fileName);
         return file.delete();
     }
 
     private boolean remove() {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoProfileDirectories.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoProfileDirectories.java
@@ -20,69 +20,69 @@ import android.content.Context;
  * names to salted profile directory paths, as well as the default profile name.
  *
  * This class will eventually come to encapsulate the remaining logic embedded
  * in profiles.ini; for now it's a read-only wrapper.
  */
 public class GeckoProfileDirectories {
     @SuppressWarnings("serial")
     public static class NoMozillaDirectoryException extends Exception {
-        public NoMozillaDirectoryException(Throwable cause) {
+        public NoMozillaDirectoryException(final Throwable cause) {
             super(cause);
         }
 
-        public NoMozillaDirectoryException(String reason) {
+        public NoMozillaDirectoryException(final String reason) {
             super(reason);
         }
 
-        public NoMozillaDirectoryException(String reason, Throwable cause) {
+        public NoMozillaDirectoryException(final String reason, final Throwable cause) {
             super(reason, cause);
         }
     }
 
     @SuppressWarnings("serial")
     public static class NoSuchProfileException extends Exception {
-        public NoSuchProfileException(String detailMessage, Throwable cause) {
+        public NoSuchProfileException(final String detailMessage, final Throwable cause) {
             super(detailMessage, cause);
         }
 
-        public NoSuchProfileException(String detailMessage) {
+        public NoSuchProfileException(final String detailMessage) {
             super(detailMessage);
         }
     }
 
     private interface INISectionPredicate {
         public boolean matches(INISection section);
     }
 
     private static final String MOZILLA_DIR_NAME = "mozilla";
 
     /**
      * Returns true if the supplied profile entry represents the default profile.
      */
     private static final INISectionPredicate sectionIsDefault = new INISectionPredicate() {
         @Override
-        public boolean matches(INISection section) {
+        public boolean matches(final INISection section) {
             return section.getIntProperty("Default") == 1;
         }
     };
 
     /**
      * Returns true if the supplied profile entry has a 'Name' field.
      */
     private static final INISectionPredicate sectionHasName = new INISectionPredicate() {
         @Override
-        public boolean matches(INISection section) {
+        public boolean matches(final INISection section) {
             final String name = section.getStringProperty("Name");
             return name != null;
         }
     };
 
     @RobocopTarget
-    public static INIParser getProfilesINI(File mozillaDir) {
+    public static INIParser getProfilesINI(final File mozillaDir) {
         return new INIParser(new File(mozillaDir, "profiles.ini"));
     }
 
     /**
      * Utility method to compute a salted profile name: eight random alphanumeric
      * characters, followed by a period, followed by the profile name.
      */
     public static String saltProfileName(final String name) {
@@ -110,17 +110,18 @@ public class GeckoProfileDirectories {
      * This method is package-scoped so that new {@link GeckoProfile} instances can
      * contextualize themselves.
      *
      * @return a new File object for the Mozilla directory.
      * @throws NoMozillaDirectoryException
      *             if the directory did not exist and could not be created.
      */
     @RobocopTarget
-    public static File getMozillaDirectory(Context context) throws NoMozillaDirectoryException {
+    public static File getMozillaDirectory(final Context context)
+            throws NoMozillaDirectoryException {
         final File mozillaDir = new File(context.getFilesDir(), MOZILLA_DIR_NAME);
         if (mozillaDir.mkdirs() || mozillaDir.isDirectory()) {
             return mozillaDir;
         }
 
         // Although this leaks a path to the system log, the path is
         // predictable (unlike a profile directory), so this is fine.
         throw new NoMozillaDirectoryException("Unable to create mozilla directory at " + mozillaDir.getAbsolutePath());
@@ -182,17 +183,18 @@ public class GeckoProfileDirectories {
      *            a predicate to use when evaluating whether to include a
      *            particular INI section.
      * @param stopOnSuccess
      *            if true, this method will return with the first result that
      *            matches the predicate; if false, all matching results are
      *            included.
      * @return a {@link Map} from name to path.
      */
-    public static Map<String, String> getMatchingProfiles(final File mozillaDir, INISectionPredicate predicate, boolean stopOnSuccess) {
+    public static Map<String, String> getMatchingProfiles(final File mozillaDir,
+            final INISectionPredicate predicate, final boolean stopOnSuccess) {
         final HashMap<String, String> result = new HashMap<String, String>();
         final INIParser parser = GeckoProfileDirectories.getProfilesINI(mozillaDir);
 
         if (parser.getSections() != null) {
             for (Enumeration<INISection> e = parser.getSections().elements(); e.hasMoreElements(); ) {
                 final INISection section = e.nextElement();
                 if (predicate == null || predicate.matches(section)) {
                     final String name = section.getStringProperty("Name");
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoScreenOrientation.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoScreenOrientation.java
@@ -36,23 +36,23 @@ public class GeckoScreenOrientation {
         PORTRAIT(PORTRAIT_PRIMARY.value | PORTRAIT_SECONDARY.value),
         LANDSCAPE_PRIMARY(1 << 2),
         LANDSCAPE_SECONDARY(1 << 3),
         LANDSCAPE(LANDSCAPE_PRIMARY.value | LANDSCAPE_SECONDARY.value),
         DEFAULT(1 << 4);
 
         public final short value;
 
-        private ScreenOrientation(int value) {
+        private ScreenOrientation(final int value) {
             this.value = (short)value;
         }
 
         private final static ScreenOrientation[] sValues = ScreenOrientation.values();
 
-        public static ScreenOrientation get(int value) {
+        public static ScreenOrientation get(final int value) {
             for (ScreenOrientation orient: sValues) {
                 if (orient.value == value) {
                     return orient;
                 }
             }
             return NONE;
         }
     }
@@ -82,25 +82,25 @@ public class GeckoScreenOrientation {
     private GeckoScreenOrientation() {
         mListeners = new ArrayList<>();
         update();
     }
 
     /**
      * Add a listener that will be notified when the screen orientation has changed.
      */
-    public void addListener(OrientationChangeListener aListener) {
+    public void addListener(final OrientationChangeListener aListener) {
         ThreadUtils.assertOnUiThread();
         mListeners.add(aListener);
     }
 
     /**
      * Remove a OrientationChangeListener again.
      */
-    public void removeListener(OrientationChangeListener aListener) {
+    public void removeListener(final OrientationChangeListener aListener) {
         ThreadUtils.assertOnUiThread();
         mListeners.remove(aListener);
     }
 
     /*
      * Enable Gecko screen orientation events on update.
      */
     public void enableNotifications() {
@@ -134,32 +134,32 @@ public class GeckoScreenOrientation {
      * Update screen orientation given the android orientation.
      * Retrieve rotation via GeckoAppShell.
      *
      * @param aAndroidOrientation
      *        Android screen orientation from Configuration.orientation.
      *
      * @return Whether the screen orientation has changed.
      */
-    public boolean update(int aAndroidOrientation) {
+    public boolean update(final int aAndroidOrientation) {
         return update(getScreenOrientation(aAndroidOrientation, getRotation()));
     }
 
     @WrapForJNI(dispatchTo = "gecko")
     private static native void onOrientationChange(short screenOrientation, short angle);
 
     /*
      * Update screen orientation given the screen orientation.
      *
      * @param aScreenOrientation
      *        Gecko screen orientation based on android orientation and rotation.
      *
      * @return Whether the screen orientation has changed.
      */
-    public synchronized boolean update(ScreenOrientation aScreenOrientation) {
+    public synchronized boolean update(final ScreenOrientation aScreenOrientation) {
         if (mScreenOrientation == aScreenOrientation) {
             return false;
         }
         mScreenOrientation = aScreenOrientation;
         Log.d(LOGTAG, "updating to new orientation " + mScreenOrientation);
         notifyListeners(mScreenOrientation);
         if (mShouldNotify) {
             // Gecko expects a definite screen orientation, so we default to the
@@ -219,30 +219,30 @@ public class GeckoScreenOrientation {
     }
 
     /**
      * Lock screen orientation given the Gecko screen orientation.
      *
      * @param aGeckoOrientation
      *        The Gecko orientation provided.
      */
-    public void lock(int aGeckoOrientation) {
+    public void lock(final int aGeckoOrientation) {
         lock(ScreenOrientation.get(aGeckoOrientation));
     }
 
     /**
      * Lock screen orientation given the Gecko screen orientation.
      *
      * @param aScreenOrientation
      *        Gecko screen orientation derived from Android orientation and
      *        rotation.
      *
      * @return Whether the locking was successful.
      */
-    public boolean lock(ScreenOrientation aScreenOrientation) {
+    public boolean lock(final ScreenOrientation aScreenOrientation) {
         Log.d(LOGTAG, "locking to " + aScreenOrientation);
         final ScreenOrientationDelegate delegate = GeckoAppShell.getScreenOrientationDelegate();
         final int activityInfoOrientation = screenOrientationToActivityInfoOrientation(aScreenOrientation);
         synchronized (this) {
             if (delegate.setRequestedOrientationForCurrentActivity(activityInfoOrientation)) {
                 update(aScreenOrientation);
                 return true;
             } else {
@@ -275,17 +275,18 @@ public class GeckoScreenOrientation {
      *
      * @param aAndroidOrientation
      *        Android orientation from Configuration.orientation.
      * @param aRotation
      *        Device rotation from Display.getRotation().
      *
      * @return Gecko screen orientation.
      */
-    private ScreenOrientation getScreenOrientation(int aAndroidOrientation, int aRotation) {
+    private ScreenOrientation getScreenOrientation(final int aAndroidOrientation,
+                                                   final int aRotation) {
         boolean isPrimary = aRotation == Surface.ROTATION_0 || aRotation == Surface.ROTATION_90;
         if (aAndroidOrientation == Configuration.ORIENTATION_PORTRAIT) {
             if (isPrimary) {
                 // Non-rotated portrait device or landscape device rotated
                 // to primary portrait mode counter-clockwise.
                 return ScreenOrientation.PORTRAIT_PRIMARY;
             }
             return ScreenOrientation.PORTRAIT_SECONDARY;
@@ -336,17 +337,17 @@ public class GeckoScreenOrientation {
     /*
      * Retrieve the screen orientation from an array string.
      *
      * @param aArray
      *        String containing comma-delimited strings.
      *
      * @return First parsed Gecko screen orientation.
      */
-    public static ScreenOrientation screenOrientationFromArrayString(String aArray) {
+    public static ScreenOrientation screenOrientationFromArrayString(final String aArray) {
         List<String> orientations = Arrays.asList(aArray.split(","));
         if ("".equals(aArray) || orientations.size() == 0) {
             // If nothing is listed, return default.
             Log.w(LOGTAG, "screenOrientationFromArrayString: no orientation in string");
             return ScreenOrientation.DEFAULT;
         }
 
         // We don't support multiple orientations yet. To avoid developer
@@ -357,17 +358,17 @@ public class GeckoScreenOrientation {
     /*
      * Retrieve the screen orientation from a string.
      *
      * @param aStr
      *        String hopefully containing a screen orientation name.
      * @return Gecko screen orientation if matched, DEFAULT_SCREEN_ORIENTATION
      *         otherwise.
      */
-    public static ScreenOrientation screenOrientationFromString(String aStr) {
+    public static ScreenOrientation screenOrientationFromString(final String aStr) {
         switch (aStr) {
             case "portrait":
                 return ScreenOrientation.PORTRAIT;
             case "landscape":
                 return ScreenOrientation.LANDSCAPE;
             case "portrait-primary":
                 return ScreenOrientation.PORTRAIT_PRIMARY;
             case "portrait-secondary":
@@ -386,17 +387,18 @@ public class GeckoScreenOrientation {
      * Convert Gecko screen orientation to Android orientation.
      *
      * @param aScreenOrientation
      *        Gecko screen orientation.
      * @return Android orientation. This conversion is lossy, the Android
      *         orientation does not differentiate between primary and secondary
      *         orientations.
      */
-    public static int screenOrientationToAndroidOrientation(ScreenOrientation aScreenOrientation) {
+    public static int screenOrientationToAndroidOrientation(
+            final ScreenOrientation aScreenOrientation) {
         switch (aScreenOrientation) {
             case PORTRAIT:
             case PORTRAIT_PRIMARY:
             case PORTRAIT_SECONDARY:
                 return Configuration.ORIENTATION_PORTRAIT;
             case LANDSCAPE:
             case LANDSCAPE_PRIMARY:
             case LANDSCAPE_SECONDARY:
@@ -413,17 +415,18 @@ public class GeckoScreenOrientation {
      * This is yet another orientation used by Android, but it's more detailed
      * than the Android orientation.
      * It is required for screen orientation locking and unlocking.
      *
      * @param aScreenOrientation
      *        Gecko screen orientation.
      * @return Android ActivityInfo orientation.
      */
-    public static int screenOrientationToActivityInfoOrientation(ScreenOrientation aScreenOrientation) {
+    public static int screenOrientationToActivityInfoOrientation(
+            final ScreenOrientation aScreenOrientation) {
         switch (aScreenOrientation) {
             case PORTRAIT:
                 return ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT;
             case PORTRAIT_PRIMARY:
                 return ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
             case PORTRAIT_SECONDARY:
                 return ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT;
             case LANDSCAPE:
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSharedPrefs.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSharedPrefs.java
@@ -80,88 +80,90 @@ public final class GeckoSharedPrefs {
 
     // For optimizing the migration check in subsequent get() calls
     private static volatile boolean migrationDone;
 
     public enum Flags {
         DISABLE_MIGRATIONS
     }
 
-    public static SharedPreferences forApp(Context context) {
+    public static SharedPreferences forApp(final Context context) {
         return forApp(context, EnumSet.noneOf(Flags.class));
     }
 
     /**
      * Returns an app-scoped SharedPreferences instance. You can disable
      * migrations by using the DISABLE_MIGRATIONS flag.
      */
-    public static SharedPreferences forApp(Context context, EnumSet<Flags> flags) {
+    public static SharedPreferences forApp(final Context context, final EnumSet<Flags> flags) {
         if (flags != null && !flags.contains(Flags.DISABLE_MIGRATIONS)) {
             migrateIfNecessary(context);
         }
 
         return context.getSharedPreferences(APP_PREFS_NAME, 0);
     }
 
-    public static SharedPreferences forCrashReporter(Context context) {
+    public static SharedPreferences forCrashReporter(final Context context) {
         return forCrashReporter(context, EnumSet.noneOf(Flags.class));
     }
 
     /**
      * Returns a crash-reporter-scoped SharedPreferences instance. You can disable
      * migrations by using the DISABLE_MIGRATIONS flag.
      */
-    public static SharedPreferences forCrashReporter(Context context, EnumSet<Flags> flags) {
+    public static SharedPreferences forCrashReporter(final Context context,
+                                                     final EnumSet<Flags> flags) {
         if (flags != null && !flags.contains(Flags.DISABLE_MIGRATIONS)) {
             migrateIfNecessary(context);
         }
 
         return context.getSharedPreferences(CRASH_PREFS_NAME, 0);
     }
 
-    public static SharedPreferences forProfile(Context context) {
+    public static SharedPreferences forProfile(final Context context) {
         return forProfile(context, EnumSet.noneOf(Flags.class));
     }
 
     /**
      * Returns a SharedPreferences instance scoped to the current profile
      * in the app. You can disable migrations by using the DISABLE_MIGRATIONS
      * flag.
      */
-    public static SharedPreferences forProfile(Context context, EnumSet<Flags> flags) {
+    public static SharedPreferences forProfile(final Context context, final EnumSet<Flags> flags) {
         String profileName = GeckoProfile.get(context).getName();
         if (profileName == null) {
             throw new IllegalStateException("Could not get current profile name");
         }
 
         return forProfileName(context, profileName, flags);
     }
 
-    public static SharedPreferences forProfileName(Context context, String profileName) {
+    public static SharedPreferences forProfileName(final Context context,
+                                                   final String profileName) {
         return forProfileName(context, profileName, EnumSet.noneOf(Flags.class));
     }
 
     /**
      * Returns an SharedPreferences instance scoped to the given profile name.
      * You can disable migrations by using the DISABLE_MIGRATION flag.
      */
-    public static SharedPreferences forProfileName(Context context, String profileName,
-            EnumSet<Flags> flags) {
+    public static SharedPreferences forProfileName(final Context context, final String profileName,
+            final EnumSet<Flags> flags) {
         if (flags != null && !flags.contains(Flags.DISABLE_MIGRATIONS)) {
             migrateIfNecessary(context);
         }
 
         final String prefsName = PROFILE_PREFS_NAME_PREFIX + profileName;
         return context.getSharedPreferences(prefsName, 0);
     }
 
     /**
      * Returns the current version of the prefs.
      */
-    public static int getVersion(Context context) {
+    public static int getVersion(final Context context) {
         return forApp(context, disableMigrations).getInt(PREFS_VERSION_KEY, 0);
     }
 
     /**
      * Resets migration flag. Should only be used in tests.
      */
     public static synchronized void reset() {
         migrationDone = false;
@@ -188,17 +190,17 @@ public final class GeckoSharedPrefs {
         // Avoid strict mode warnings when doing so.
         try (StrictModeContext unused = StrictModeContext.allowDiskWrites()) {
             performMigration(context);
         }
 
         migrationDone = true;
     }
 
-    private static void performMigration(Context context) {
+    private static void performMigration(final Context context) {
         final SharedPreferences appPrefs = forApp(context, disableMigrations);
 
         final int currentVersion = appPrefs.getInt(PREFS_VERSION_KEY, 0);
         Log.d(LOGTAG, "Current version = " + currentVersion + ", prefs version = " + PREFS_VERSION);
 
         if (currentVersion == PREFS_VERSION) {
             return;
         }
@@ -251,18 +253,20 @@ public final class GeckoSharedPrefs {
         Log.d(LOGTAG, "All keys have been migrated");
     }
 
     /**
      * Moves all preferences stored in PreferenceManager's default prefs
      * to either app or profile scopes. The profile-scoped keys are defined
      * in given profileKeys list, all other keys are moved to the app scope.
      */
-    private static Editor migrateFromPreferenceManager(Context context, Editor appEditor,
-            Editor profileEditor, List<String> profileKeys) {
+    private static Editor migrateFromPreferenceManager(final Context context,
+                                                       final Editor appEditor,
+                                                       final Editor profileEditor,
+                                                       final List<String> profileKeys) {
         Log.d(LOGTAG, "Migrating from PreferenceManager");
 
         final SharedPreferences pmPrefs =
                 PreferenceManager.getDefaultSharedPreferences(context);
 
         for (Map.Entry<String, ?> entry : pmPrefs.getAll().entrySet()) {
             final String key = entry.getKey();
 
@@ -280,40 +284,42 @@ public final class GeckoSharedPrefs {
         // and return the Editor to be committed.
         return pmPrefs.edit().clear();
     }
 
     /**
      * Moves the crash reporter's preferences from the app-wide prefs
      * into its own shared prefs to avoid cross-process pref accesses.
      */
-    private static void migrateCrashReporterSettings(SharedPreferences appPrefs, Editor appEditor,
-                                                    Editor crashEditor, List<String> profileKeys) {
+    private static void migrateCrashReporterSettings(final SharedPreferences appPrefs,
+                                                     final Editor appEditor,
+                                                     final Editor crashEditor,
+                                                     final List<String> profileKeys) {
         Log.d(LOGTAG, "Migrating crash reporter settings");
 
         for (Map.Entry<String, ?> entry : appPrefs.getAll().entrySet()) {
             final String key = entry.getKey();
 
             if (profileKeys.contains(key)) {
                 putEntry(crashEditor, key, entry.getValue());
                 appEditor.remove(key);
             }
         }
     }
 
-    private static void putEntry(Editor to, String key, Object value) {
+    private static void putEntry(final Editor to, final String key, final Object value) {
         Log.d(LOGTAG, "Migrating key = " + key + " with value = " + value);
 
         if (value instanceof String) {
             to.putString(key, (String) value);
         } else if (value instanceof Boolean) {
             to.putBoolean(key, (Boolean) value);
         } else if (value instanceof Long) {
             to.putLong(key, (Long) value);
         } else if (value instanceof Float) {
             to.putFloat(key, (Float) value);
         } else if (value instanceof Integer) {
             to.putInt(key, (Integer) value);
         } else {
             throw new IllegalStateException("Unrecognized value type for key: " + key);
         }
     }
-}
\ No newline at end of file
+}
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSystemStateListener.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSystemStateListener.java
@@ -48,17 +48,17 @@ public class GeckoSystemStateListener
             context.getSystemService(Context.INPUT_SERVICE);
         mInputManager.registerInputDeviceListener(listenerInstance, ThreadUtils.getUiHandler());
 
         sApplicationContext = context;
         ContentResolver contentResolver = sApplicationContext.getContentResolver();
         Uri animationSetting = Settings.System.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE);
         mContentObserver = new ContentObserver(new Handler(Looper.getMainLooper())) {
             @Override
-            public void onChange(boolean selfChange) {
+            public void onChange(final boolean selfChange) {
                 onDeviceChanged();
             }
         };
         contentResolver.registerContentObserver(animationSetting, false, mContentObserver);
 
         initialized = true;
     }
 
@@ -117,35 +117,35 @@ public class GeckoSystemStateListener
             nativeOnDeviceChanged();
         } else {
             GeckoThread.queueNativeCallUntil(
                     GeckoThread.State.PROFILE_READY, GeckoSystemStateListener.class,
                     "nativeOnDeviceChanged");
         }
     }
 
-    private void notifyDeviceChanged(int deviceId) {
+    private void notifyDeviceChanged(final int deviceId) {
         InputDevice device = InputDevice.getDevice(deviceId);
         if (device == null ||
             !InputDeviceUtils.isPointerTypeDevice(device)) {
             return;
         }
         onDeviceChanged();
     }
 
     @Override
-    public void onInputDeviceAdded(int deviceId) {
+    public void onInputDeviceAdded(final int deviceId) {
         notifyDeviceChanged(deviceId);
     }
 
     @Override
-    public void onInputDeviceRemoved(int deviceId) {
+    public void onInputDeviceRemoved(final int deviceId) {
         // Call onDeviceChanged directly without checking device source types
         // since we can no longer get a valid `InputDevice` in the case of
         // device removal.
         onDeviceChanged();
     }
 
     @Override
-    public void onInputDeviceChanged(int deviceId) {
+    public void onInputDeviceChanged(final int deviceId) {
         notifyDeviceChanged(deviceId);
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java
@@ -66,17 +66,17 @@ public class GeckoThread extends Thread 
          * that are available for use. During startup and up to the RUNNING state, the
          * rank value increases because more components are initialized and available for
          * use. During shutdown and up to the EXITED state, the rank value decreases as
          * components are shut down and become unavailable. EXITING has the same rank as
          * LIBS_READY because both states have a similar amount of components available.
          */
         private final int rank;
 
-        private State(int rank) {
+        private State(final int rank) {
             this.rank = rank;
         }
 
         @Override
         public boolean is(final NativeQueue.State other) {
             return this == other;
         }
 
@@ -591,17 +591,17 @@ public class GeckoThread extends Thread 
     public static void waitOnGeckoForever() {
         nativeWaitOnGecko(0);
     }
 
     public static boolean waitOnGecko() {
         return waitOnGecko(DEFAULT_TIMEOUT);
     }
 
-    public static boolean waitOnGecko(long timeoutMillis) {
+    public static boolean waitOnGecko(final long timeoutMillis) {
         return nativeWaitOnGecko(timeoutMillis);
     }
 
     @WrapForJNI(stubName = "OnPause", dispatchTo = "gecko")
     private static native void nativeOnPause();
 
     public static void onPause() {
         if (isStateAtLeast(State.PROFILE_READY)) {
@@ -641,17 +641,17 @@ public class GeckoThread extends Thread 
 
     @WrapForJNI(dispatchTo = "gecko")
     public static native void forceQuit();
 
     @WrapForJNI(dispatchTo = "gecko")
     public static native void crash();
 
     @WrapForJNI
-    private static void requestUiThreadCallback(long delay) {
+    private static void requestUiThreadCallback(final long delay) {
         ThreadUtils.getUiHandler().postDelayed(UI_THREAD_CALLBACK, delay);
     }
 
     /**
      * Queue a call to the given static method until Gecko is in the RUNNING state.
      */
     public static void queueNativeCall(final Class<?> cls, final String methodName,
                                        final Object... args) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/InputMethods.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/InputMethods.java
@@ -30,37 +30,38 @@ final public class InputMethods {
     public static final String METHOD_SONY = "com.sonyericsson.textinput.uxp/.glue.InputMethodServiceGlue";
     public static final String METHOD_SWIFTKEY = "com.touchtype.swiftkey/com.touchtype.KeyboardService";
     public static final String METHOD_SWYPE = "com.swype.android.inputmethod/.SwypeInputMethod";
     public static final String METHOD_SWYPE_BETA = "com.nuance.swype.input/.IME";
     public static final String METHOD_TOUCHPAL_KEYBOARD = "com.cootek.smartinputv5/com.cootek.smartinput5.TouchPalIME";
 
     private InputMethods() {}
 
-    public static String getCurrentInputMethod(Context context) {
+    public static String getCurrentInputMethod(final Context context) {
         String inputMethod = Secure.getString(context.getContentResolver(), Secure.DEFAULT_INPUT_METHOD);
         return (inputMethod != null ? inputMethod : "");
     }
 
-    public static InputMethodInfo getInputMethodInfo(Context context, String inputMethod) {
+    public static InputMethodInfo getInputMethodInfo(final Context context,
+                                                     final String inputMethod) {
         InputMethodManager imm = getInputMethodManager(context);
         Collection<InputMethodInfo> infos = imm.getEnabledInputMethodList();
         for (InputMethodInfo info : infos) {
             if (info.getId().equals(inputMethod)) {
                 return info;
             }
         }
         return null;
     }
 
-    public static InputMethodManager getInputMethodManager(Context context) {
+    public static InputMethodManager getInputMethodManager(final Context context) {
         return (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
     }
 
-    public static void restartInput(Context context, View view) {
+    public static void restartInput(final Context context, final View view) {
         final InputMethodManager imm = getInputMethodManager(context);
         if (imm != null) {
             imm.restartInput(view);
         }
     }
 
     public static boolean needsSoftResetWorkaround(final String inputMethod) {
         // Stock latin IME on Android 4.2 and above
@@ -83,16 +84,16 @@ final public class InputMethods {
                inputMethod.startsWith(METHOD_ATOK_OEM_PREFIX) ||
                METHOD_ATOK_OEM_SOFTBANK.equals(inputMethod);
     }
 
     public static boolean shouldCommitCharAsKey(final String inputMethod) {
         return METHOD_HTC_TOUCH_INPUT.equals(inputMethod);
     }
 
-    public static boolean needsRestartOnReplaceRemove(Context context) {
+    public static boolean needsRestartOnReplaceRemove(final Context context) {
         String inputMethod = getCurrentInputMethod(context);
         return METHOD_SONY.equals(inputMethod);
     }
 
     // TODO: Replace usages by definition in EditorInfoCompat once available (bug 1385726).
     public static final int IME_FLAG_NO_PERSONALIZED_LEARNING = 0x1000000;
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/NSSBridge.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/NSSBridge.java
@@ -11,41 +11,43 @@ import org.mozilla.gecko.annotation.Robo
 
 public class NSSBridge {
     private static final String LOGTAG = "NSSBridge";
 
     private static native String nativeEncrypt(String aDb, String aValue);
     private static native String nativeDecrypt(String aDb, String aValue);
 
     @RobocopTarget
-    static public String encrypt(Context context, String aValue)
+    static public String encrypt(final Context context, final String aValue)
       throws Exception {
         GeckoLoader.loadNSSLibs(context);
 
         String path = GeckoProfile.get(context).getDir().toString();
         return nativeEncrypt(path, aValue);
     }
 
     @RobocopTarget
-    static public String encrypt(Context context, String profilePath, String aValue)
+    static public String encrypt(final Context context, final String profilePath,
+                                 final String aValue)
       throws Exception {
         GeckoLoader.loadNSSLibs(context);
 
         return nativeEncrypt(profilePath, aValue);
     }
 
     @RobocopTarget
-    static public String decrypt(Context context, String aValue)
+    static public String decrypt(final Context context, final String aValue)
       throws Exception {
         GeckoLoader.loadNSSLibs(context);
 
         String path = GeckoProfile.get(context).getDir().toString();
         return nativeDecrypt(path, aValue);
     }
 
     @RobocopTarget
-    static public String decrypt(Context context, String profilePath, String aValue)
+    static public String decrypt(final Context context, final String profilePath,
+                                 final String aValue)
       throws Exception {
         GeckoLoader.loadNSSLibs(context);
 
         return nativeDecrypt(profilePath, aValue);
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/PrefsHelper.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/PrefsHelper.java
@@ -207,17 +207,16 @@ public final class PrefsHelper {
                     String[].class, namesToUnobserve);
         }
     }
 
     @WrapForJNI(calledFrom = "gecko")
     private static void callPrefHandler(final PrefHandler handler, final int originalType,
                                         final String pref, final boolean originalBoolVal,
                                         final int intVal, final String originalStrVal) {
-
         // Some Gecko preferences use integers or strings to reference state instead of
         // directly representing the value.  Since the Java UI uses the type to determine
         // which ui elements to show and how to handle them, we need to normalize these
         // preferences to the correct type.
         int type = originalType;
         String strVal = originalStrVal;
         boolean boolVal = originalBoolVal;
 
@@ -284,29 +283,29 @@ public final class PrefsHelper {
         void prefValue(String pref, boolean value);
         void prefValue(String pref, int value);
         void prefValue(String pref, String value);
         void finish();
     }
 
     public static abstract class PrefHandlerBase implements PrefHandler {
         @Override
-        public void prefValue(String pref, boolean value) {
+        public void prefValue(final String pref, final boolean value) {
             throw new UnsupportedOperationException(
                     "Unhandled boolean pref " + pref + "; wrong type?");
         }
 
         @Override
-        public void prefValue(String pref, int value) {
+        public void prefValue(final String pref, final int value) {
             throw new UnsupportedOperationException(
                     "Unhandled int pref " + pref + "; wrong type?");
         }
 
         @Override
-        public void prefValue(String pref, String value) {
+        public void prefValue(final String pref, final String value) {
             throw new UnsupportedOperationException(
                     "Unhandled String pref " + pref + "; wrong type?");
         }
 
         @Override
         public void finish() {
         }
     }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/SpeechSynthesisService.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/SpeechSynthesisService.java
@@ -32,17 +32,17 @@ public class SpeechSynthesisService  {
         if (sTTS != null) {
             return;
         }
 
         final Context ctx = GeckoAppShell.getApplicationContext();
 
         sTTS = new TextToSpeech(ctx, new TextToSpeech.OnInitListener() {
             @Override
-            public void onInit(int status) {
+            public void onInit(final int status) {
                 if (status != TextToSpeech.SUCCESS) {
                     Log.w(LOGTAG, "Failed to initialize TextToSpeech");
                     return;
                 }
 
                 setUtteranceListener();
                 registerVoicesByLocale();
             }
@@ -85,17 +85,18 @@ public class SpeechSynthesisService  {
 
     @WrapForJNI(dispatchTo = "gecko")
     private static native void registerVoice(String uri, String name, String locale, boolean isNetwork, boolean isDefault);
 
     @WrapForJNI(dispatchTo = "gecko")
     private static native void doneRegisteringVoices();
 
     @WrapForJNI(calledFrom = "gecko")
-    public static String speak(final String uri, final String text, float rate, float pitch, float volume) {
+    public static String speak(final String uri, final String text, final float rate,
+                               final float pitch, final float volume) {
         if (sTTS == null) {
             Log.w(LOGTAG, "TextToSpeech is not initialized");
             return null;
         }
 
         HashMap<String, String> params = new HashMap<String, String>();
         final String utteranceId = UUID.randomUUID().toString();
         params.put(TextToSpeech.Engine.KEY_PARAM_VOLUME, Float.toString(volume));
@@ -114,41 +115,42 @@ public class SpeechSynthesisService  {
     private static void setUtteranceListener() {
         if (sTTS == null) {
             Log.w(LOGTAG, "TextToSpeech is not initialized");
             return;
         }
 
         sTTS.setOnUtteranceProgressListener(new UtteranceProgressListener() {
             @Override
-            public void onDone(String utteranceId) {
+            public void onDone(final String utteranceId) {
                 dispatchEnd(utteranceId);
             }
 
             @Override
-            public void onError(String utteranceId) {
+            public void onError(final String utteranceId) {
                 dispatchError(utteranceId);
             }
 
             @Override
-            public void onStart(String utteranceId) {
+            public void onStart(final String utteranceId) {
                 dispatchStart(utteranceId);
             }
 
             @Override
-            public void onStop(String utteranceId, boolean interrupted) {
+            public void onStop(final String utteranceId, final boolean interrupted) {
                 if (interrupted) {
                     dispatchEnd(utteranceId);
                 } else {
                     // utterance isn't started yet.
                     dispatchError(utteranceId);
                 }
             }
 
-            public void onRangeStart (String utteranceId, int start, int end, int frame) {
+            public void onRangeStart(final String utteranceId, final int start, final int end,
+                                     final int frame) {
                 dispatchBoundary(utteranceId, start, end);
             }
         });
     }
 
     @WrapForJNI(dispatchTo = "gecko")
     private static native void dispatchStart(String utteranceId);
 
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/SysInfo.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/SysInfo.java
@@ -58,17 +58,17 @@ public final class SysInfo {
         try (StrictModeContext unused = StrictModeContext.allowDiskReads()) {
             return readCPUCount();
         }
     }
 
     private static int readCPUCount() {
         class CpuFilter implements FileFilter {
             @Override
-            public boolean accept(File pathname) {
+            public boolean accept(final File pathname) {
                 return Pattern.matches("cpu[0-9]+", pathname.getName());
             }
         }
         try {
             final File dir = new File("/sys/devices/system/cpu/");
             return cpuCount = dir.listFiles(new CpuFilter()).length;
         } catch (Exception e) {
             Log.w(LOG_TAG, "Assuming 1 CPU; got exception.", e);
@@ -76,17 +76,18 @@ public final class SysInfo {
         }
     }
 
     /**
      * Helper functions used to extract key/value data from /proc/meminfo
      * Pulled from:
      * http://androidxref.com/4.2_r1/xref/frameworks/base/core/java/com/android/internal/util/MemInfoReader.java
      */
-    private static boolean matchMemText(byte[] buffer, int index, int bufferLength, byte[] text) {
+    private static boolean matchMemText(final byte[] buffer, final int index,
+                                        final int bufferLength, final byte[] text) {
         final int N = text.length;
         if ((index + N) >= bufferLength) {
             return false;
         }
         for (int i = 0; i < N; i++) {
             if (buffer[index + i] != text[i]) {
                 return false;
             }
@@ -99,17 +100,17 @@ public final class SysInfo {
      *
      *  MemTotal: 1605324 kB
      *
      * into 1605324.
      *
      * @return the first uninterrupted sequence of digits following the
      *         specified index, parsed as an integer value in KB.
      */
-    private static int extractMemValue(byte[] buffer, int offset, int length) {
+    private static int extractMemValue(final byte[] buffer, final int offset, final int length) {
         if (offset >= length) {
             return 0;
         }
 
         int i = offset;
         while (i < length && buffer[i] != '\n') {
             if (buffer[i] >= '0' && buffer[i] <= '9') {
                 int start = i++;
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/TelemetryUtils.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/TelemetryUtils.java
@@ -39,26 +39,26 @@ public class TelemetryUtils {
     }
 
     public static long realtime() {
         return SystemClock.elapsedRealtime();
     }
 
     // Define new histograms in:
     // toolkit/components/telemetry/Histograms.json
-    public static void addToHistogram(String name, int value) {
+    public static void addToHistogram(final String name, final int value) {
         if (GeckoThread.isRunning()) {
             nativeAddHistogram(name, value);
         } else {
             GeckoThread.queueNativeCall(TelemetryUtils.class, "nativeAddHistogram",
                                         String.class, name, value);
         }
     }
 
-    public static void addToKeyedHistogram(String name, String key, int value) {
+    public static void addToKeyedHistogram(final String name, final String key, final int value) {
         if (GeckoThread.isRunning()) {
             nativeAddKeyedHistogram(name, key, value);
         } else {
             GeckoThread.queueNativeCall(TelemetryUtils.class, "nativeAddKeyedHistogram",
                                         String.class, name, String.class, key, value);
         }
     }
 
@@ -66,17 +66,17 @@ public class TelemetryUtils {
         private final long mStartTime;
         private final String mName;
 
         private volatile boolean mHasFinished;
         private volatile long mElapsed = -1;
 
         protected abstract long now();
 
-        public Timer(String name) {
+        public Timer(final String name) {
             mName = name;
             mStartTime = now();
         }
 
         public void cancel() {
             mHasFinished = true;
         }
 
@@ -104,28 +104,28 @@ public class TelemetryUtils {
                 return;
             }
 
             addToHistogram(mName, (int) (elapsed));
         }
     }
 
     public static class RealtimeTimer extends Timer {
-        public RealtimeTimer(String name) {
+        public RealtimeTimer(final String name) {
             super(name);
         }
 
         @Override
         protected long now() {
             return TelemetryUtils.realtime();
         }
     }
 
     public static class UptimeTimer extends Timer {
-        public UptimeTimer(String name) {
+        public UptimeTimer(final String name) {
             super(name);
         }
 
         @Override
         protected long now() {
             return TelemetryUtils.uptime();
         }
     }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoSurface.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoSurface.java
@@ -23,51 +23,51 @@ public final class GeckoSurface extends 
     private volatile boolean mIsAvailable;
     private boolean mOwned = true;
 
     private int mMyPid;
     // Locally allocated surface/texture. Do not pass it over IPC.
     private GeckoSurface mSyncSurface;
 
     @WrapForJNI(exceptionMode = "nsresult")
-    public GeckoSurface(GeckoSurfaceTexture gst) {
+    public GeckoSurface(final GeckoSurfaceTexture gst) {
         super(gst);
         mHandle = gst.getHandle();
         mIsSingleBuffer = gst.isSingleBuffer();
         mIsAvailable = true;
         mMyPid = android.os.Process.myPid();
     }
 
-    public GeckoSurface(Parcel p, SurfaceTexture dummy) {
+    public GeckoSurface(final Parcel p, final SurfaceTexture dummy) {
         // A no-arg constructor exists, but is hidden in the SDK. We need to create a dummy
         // SurfaceTexture here in order to create the instance. This is used to transfer the
         // GeckoSurface across binder.
         super(dummy);
 
         readFromParcel(p);
         mHandle = p.readInt();
         mIsSingleBuffer = p.readByte() == 1 ? true : false;
         mIsAvailable = (p.readByte() == 1 ? true : false);
         mMyPid = p.readInt();
 
         dummy.release();
     }
 
     public static final Parcelable.Creator<GeckoSurface> CREATOR = new Parcelable.Creator<GeckoSurface>() {
-        public GeckoSurface createFromParcel(Parcel p) {
+        public GeckoSurface createFromParcel(final Parcel p) {
             return new GeckoSurface(p, new SurfaceTexture(0));
         }
 
-        public GeckoSurface[] newArray(int size) {
+        public GeckoSurface[] newArray(final int size) {
             return new GeckoSurface[size];
         }
     };
 
     @Override
-    public void writeToParcel(Parcel out, int flags) {
+    public void writeToParcel(final Parcel out, final int flags) {
         super.writeToParcel(out, flags);
         out.writeInt(mHandle);
         out.writeByte((byte) (mIsSingleBuffer ? 1 : 0));
         out.writeByte((byte) (mIsAvailable ? 1 : 0));
         out.writeInt(mMyPid);
 
         mOwned = false;
     }
@@ -94,25 +94,25 @@ public final class GeckoSurface extends 
     }
 
     @WrapForJNI
     public boolean getAvailable() {
         return mIsAvailable;
     }
 
     @WrapForJNI
-    public void setAvailable(boolean available) {
+    public void setAvailable(final boolean available) {
         mIsAvailable = available;
     }
 
     /* package */ boolean inProcess() {
         return android.os.Process.myPid() == mMyPid;
     }
 
-    /* package */ SyncConfig initSyncSurface(int width, int height) {
+    /* package */ SyncConfig initSyncSurface(final int width, final int height) {
         if (DEBUG_BUILD) {
             if (inProcess()) {
                 throw new AssertionError("no need for sync when allocated in process");
             }
         }
         if (GeckoSurfaceTexture.lookup(mHandle) != null) {
             throw new AssertionError("texture#" + mHandle + " already in use.");
         }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoSurfaceTexture.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoSurfaceTexture.java
@@ -35,39 +35,39 @@ import org.mozilla.gecko.mozglue.JNIObje
 
     private GeckoSurfaceTexture.Callbacks mListener;
     private AtomicInteger mUseCount;
     private boolean mFinalized;
 
     private int mUpstream;
     private NativeGLBlitHelper mBlitter;
 
-    private GeckoSurfaceTexture(int handle) {
+    private GeckoSurfaceTexture(final int handle) {
         super(0);
         init(handle, false);
     }
 
     @RequiresApi(api = Build.VERSION_CODES.KITKAT)
-    private GeckoSurfaceTexture(int handle, boolean singleBufferMode) {
+    private GeckoSurfaceTexture(final int handle, final boolean singleBufferMode) {
         super(0, singleBufferMode);
         init(handle, singleBufferMode);
     }
 
     @Override
     protected void finalize() throws Throwable {
         // We only want finalize() to be called once
         if (mFinalized) {
             return;
         }
 
         mFinalized = true;
         super.finalize();
     }
 
-    private void init(int handle, boolean singleBufferMode) {
+    private void init(final int handle, final boolean singleBufferMode) {
         mHandle = handle;
         mIsSingleBuffer = singleBufferMode;
         mUseCount = new AtomicInteger(1);
 
         // Start off detached
         detachFromGLContext();
     }
 
@@ -77,17 +77,17 @@ import org.mozilla.gecko.mozglue.JNIObje
     }
 
     @WrapForJNI
     public int getTexName() {
         return mTexName;
     }
 
     @WrapForJNI(exceptionMode = "nsresult")
-    public synchronized void attachToGLContext(long context, int texName) {
+    public synchronized void attachToGLContext(final long context, final int texName) {
         if (context == mAttachedContext && texName == mTexName) {
             return;
         }
 
         attachToGLContext(texName);
 
         mAttachedContext = context;
         mTexName = texName;
@@ -97,17 +97,17 @@ import org.mozilla.gecko.mozglue.JNIObje
     @WrapForJNI(exceptionMode = "nsresult")
     public synchronized void detachFromGLContext() {
         super.detachFromGLContext();
 
         mAttachedContext = mTexName = 0;
     }
 
     @WrapForJNI
-    public synchronized boolean isAttachedToGLContext(long context) {
+    public synchronized boolean isAttachedToGLContext(final long context) {
         return mAttachedContext == context;
     }
 
     @WrapForJNI
     public boolean isSingleBuffer() {
         return mIsSingleBuffer;
     }
 
@@ -155,17 +155,17 @@ import org.mozilla.gecko.mozglue.JNIObje
             if (mListener != null) {
                 mListener.onReleaseTexImage();
             }
         } catch (Exception e) {
             Log.w(LOGTAG, "releaseTexImage() failed", e);
         }
     }
 
-    public synchronized void setListener(GeckoSurfaceTexture.Callbacks listener) {
+    public synchronized void setListener(final GeckoSurfaceTexture.Callbacks listener) {
         mListener = listener;
     }
 
     @WrapForJNI
     public static boolean isSingleBufferSupported() {
         return Build.VERSION.SDK_INT >= 19;
     }
 
@@ -196,17 +196,17 @@ import org.mozilla.gecko.mozglue.JNIObje
                     sUnusedTextures.put(mAttachedContext, list);
                 }
                 list.addFirst(this);
             }
         }
     }
 
     @WrapForJNI
-    public static void destroyUnused(long context) {
+    public static void destroyUnused(final long context) {
         LinkedList<GeckoSurfaceTexture> list;
         synchronized (sUnusedTextures) {
             list = sUnusedTextures.remove(context);
         }
 
         if (list == null) {
             return;
         }
@@ -229,31 +229,31 @@ import org.mozilla.gecko.mozglue.JNIObje
                 }
             } catch (Exception e) {
                 Log.e(LOGTAG, "Failed to destroy SurfaceTexture", e);
             }
         }
     }
 
     @WrapForJNI
-    public static void detachAllFromGLContext(long context) {
+    public static void detachAllFromGLContext(final long context) {
         synchronized (sSurfaceTextures) {
             for (GeckoSurfaceTexture tex : sSurfaceTextures.values()) {
                 try {
                     if (tex.isAttachedToGLContext(context)) {
                         tex.detachFromGLContext();
                     }
                 } catch (Exception e) {
                     Log.e(LOGTAG, "Failed to detach SurfaceTexture with handle: " + tex.mHandle, e);
                 }
             }
         }
     }
 
-    public static GeckoSurfaceTexture acquire(boolean singleBufferMode, int handle) {
+    public static GeckoSurfaceTexture acquire(final boolean singleBufferMode, final int handle) {
         if (singleBufferMode && !isSingleBufferSupported()) {
             throw new IllegalArgumentException("single buffer mode not supported on API version < 19");
         }
 
         synchronized (sSurfaceTextures) {
             // We want to limit the maximum number of SurfaceTextures at any one time.
             // This is because they use a large number of fds, and once the process' limit
             // is reached bad things happen. See bug 1421586.
@@ -280,27 +280,28 @@ import org.mozilla.gecko.mozglue.JNIObje
             }
 
             sSurfaceTextures.put(resolvedHandle, gst);
             return gst;
         }
     }
 
     @WrapForJNI
-    public static GeckoSurfaceTexture lookup(int handle) {
+    public static GeckoSurfaceTexture lookup(final int handle) {
         synchronized (sSurfaceTextures) {
             return sSurfaceTextures.get(handle);
         }
     }
 
-    /* package */ synchronized void track(int upstream) {
+    /* package */ synchronized void track(final int upstream) {
         mUpstream = upstream;
     }
 
-    /* package */ synchronized void configureSnapshot(GeckoSurface target, int width, int height) {
+    /* package */ synchronized void configureSnapshot(final GeckoSurface target,
+                                                      final int width, final int height) {
         mBlitter = NativeGLBlitHelper.create(mHandle, target, width, height);
     }
 
     /* package */ synchronized void takeSnapshot() {
         mBlitter.blit();
     }
 
     public interface Callbacks {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/StackScroller.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/StackScroller.java
@@ -29,17 +29,17 @@ import org.mozilla.gecko.annotation.Wrap
 
     private static float sViscousFluidScale;
     private static float sViscousFluidNormalize;
 
     /**
      * Creates an StackScroller with a viscous fluid scroll interpolator and flywheel.
      * @param context
      */
-    public StackScroller(Context context) {
+    public StackScroller(final Context context) {
         mFlywheel = true;
         mScrollerX = new SplineStackScroller(context);
         mScrollerY = new SplineStackScroller(context);
         initContants();
     }
 
     private static void initContants() {
         // This controls the viscous fluid effect (how much of it)
@@ -62,17 +62,17 @@ import org.mozilla.gecko.annotation.Wrap
     /**
      * Force the finished field to a particular value. Contrary to
      * {@link #abortAnimation()}, forcing the animation to finished
      * does NOT cause the scroller to move to the final x and y
      * position.
      *
      * @param finished The new finished value.
      */
-    public final void forceFinished(boolean finished) {
+    public final void forceFinished(final boolean finished) {
         mScrollerX.mFinished = mScrollerY.mFinished = finished;
     }
 
     /**
      * Returns the current X offset in the scroll.
      *
      * @return The new X offset as an absolute distance from the origin.
      */
@@ -115,17 +115,17 @@ import org.mozilla.gecko.annotation.Wrap
         return mScrollerY.mFinal;
     }
 
     /**
      * Sets where the scroll will end.  Valid only for "fling" scrolls.
      *
      * @param x The final X offset as an absolute distance from the origin.
      */
-    public final void setFinalX(int x) {
+    public final void setFinalX(final int x) {
         mScrollerX.setFinalPosition(x);
     }
 
     private static float viscousFluid(final float x) {
         float y = x * sViscousFluidScale;
         if (y < 1.0f) {
             y -= (1.0f - (float) Math.exp(-y));
         } else {
@@ -136,17 +136,17 @@ import org.mozilla.gecko.annotation.Wrap
         y *= sViscousFluidNormalize;
         return y;
     }
 
     /**
      * Call this when you want to know the new location. If it returns true, the
      * animation is not yet finished.
      */
-    public boolean computeScrollOffset(long time) {
+    public boolean computeScrollOffset(final long time) {
         if (isFinished()) {
             return false;
         }
 
         switch (mMode) {
             case SCROLL_MODE:
                 // Any scroller can be used for time, since they were started
                 // together in scroll mode. We use X here.
@@ -197,17 +197,18 @@ import org.mozilla.gecko.annotation.Wrap
      * @param startY Starting vertical scroll offset in pixels. Positive numbers
      *        will scroll the content up.
      * @param dx Horizontal distance to travel. Positive numbers will scroll the
      *        content to the left.
      * @param dy Vertical distance to travel. Positive numbers will scroll the
      *        content up.
      * @param duration Duration of the scroll in milliseconds.
      */
-    public void startScroll(int startX, int startY, int dx, int dy, long startTime, int duration) {
+    public void startScroll(final int startX, final int startY, final int dx, final int dy,
+                            final long startTime, final int duration) {
         mMode = SCROLL_MODE;
         mScrollerX.startScroll(startX, dx, startTime, duration);
         mScrollerY.startScroll(startY, dy, startTime, duration);
     }
 
     /**
      * Call this when you want to 'spring back' into a valid coordinate range.
      *
@@ -216,17 +217,18 @@ import org.mozilla.gecko.annotation.Wrap
      * @param minX Minimum valid X value
      * @param maxX Maximum valid X value
      * @param minY Minimum valid Y value
      * @param maxY Minimum valid Y value
      * @return true if a springback was initiated, false if startX and startY were
      *          already within the valid range.
      */
     public boolean springBack(
-            int startX, int startY, int minX, int maxX, int minY, int maxY, long time) {
+            final int startX, final int startY, final int minX, final int maxX, final int minY,
+            final int maxY, final long time) {
         mMode = FLING_MODE;
 
         // Make sure both methods are called.
         final boolean spingbackX = mScrollerX.springback(startX, minX, maxX, time);
         final boolean spingbackY = mScrollerY.springback(startY, minY, maxY, time);
         return spingbackX || spingbackY;
     }
 
@@ -392,55 +394,56 @@ import org.mozilla.gecko.annotation.Wrap
                         yMin = y;
                     }
                 }
                 SPLINE_TIME[i] = coef * ((1.0f - y) * P1 + y * P2) + y * y * y;
             }
             SPLINE_POSITION[NB_SAMPLES] = SPLINE_TIME[NB_SAMPLES] = 1.0f;
         }
 
-        SplineStackScroller(Context context) {
+        SplineStackScroller(final Context context) {
             mFinished = true;
             final float ppi = context.getResources().getDisplayMetrics().density * 160.0f;
             mPhysicalCoeff = SensorManager.GRAVITY_EARTH // g (m/s^2)
                     * 39.37f // inch/meter
                     * ppi * 0.84f; // look and feel tuning
         }
 
-        void updateScroll(float q) {
+        void updateScroll(final float q) {
             mCurrentPosition = mStart + Math.round(q * (mFinal - mStart));
         }
 
         /*
          * Get a signed deceleration that will reduce the velocity.
          */
-        private static float getDeceleration(int velocity) {
+        private static float getDeceleration(final int velocity) {
             return velocity > 0 ? -GRAVITY : GRAVITY;
         }
 
         /*
          * Modifies mDuration to the duration it takes to get from start to newFinal using the
          * spline interpolation. The previous duration was needed to get to oldFinal.
          */
-        private void adjustDuration(int start, int oldFinal, int newFinal) {
+        private void adjustDuration(final int start, final int oldFinal, final int newFinal) {
             final int oldDistance = oldFinal - start;
             final int newDistance = newFinal - start;
             final float x = Math.abs((float) newDistance / oldDistance);
             final int index = (int) (NB_SAMPLES * x);
             if (index < NB_SAMPLES) {
                 final float xInf = (float) index / NB_SAMPLES;
                 final float xSup = (float) (index + 1) / NB_SAMPLES;
                 final float tInf = SPLINE_TIME[index];
                 final float tSup = SPLINE_TIME[index + 1];
                 final float timeCoef = tInf + (x - xInf) / (xSup - xInf) * (tSup - tInf);
                 mDuration *= timeCoef;
             }
         }
 
-        void startScroll(int start, int distance, long startTime, int duration) {
+        void startScroll(final int start, final int distance, final long startTime,
+                         final int duration) {
             mFinished = false;
 
             mStart = start;
             mFinal = start + distance;
 
             mStartTime = startTime;
             mDuration = duration;
 
@@ -452,22 +455,22 @@ import org.mozilla.gecko.annotation.Wrap
         void finish() {
             mCurrentPosition = mFinal;
             // Not reset since WebView relies on this value for fast fling.
             // TODO: restore when WebView uses the fast fling implemented in this class.
             // mCurrVelocity = 0.0f;
             mFinished = true;
         }
 
-        void setFinalPosition(int position) {
+        void setFinalPosition(final int position) {
             mFinal = position;
             mFinished = false;
         }
 
-        boolean springback(int start, int min, int max, long time) {
+        boolean springback(final int start, final int min, final int max, final long time) {
             mFinished = true;
 
             mStart = mFinal = start;
             mVelocity = 0;
 
             mStartTime = time;
             mDuration = 0;
 
@@ -475,31 +478,32 @@ import org.mozilla.gecko.annotation.Wrap
                 startSpringback(start, min, 0);
             } else if (start > max) {
                 startSpringback(start, max, 0);
             }
 
             return !mFinished;
         }
 
-        private void startSpringback(int start, int end, int velocity) {
+        private void startSpringback(final int start, final int end, final int velocity) {
             // mStartTime has been set
             mFinished = false;
             mState = CUBIC;
             mStart = start;
             mFinal = end;
             final int delta = start - end;
             mDeceleration = getDeceleration(delta);
             // TODO take velocity into account
             mVelocity = -delta; // only sign is used
             mOver = Math.abs(delta);
             mDuration = (int) (1000.0 * Math.sqrt(-2.0 * delta / mDeceleration));
         }
 
-        void fling(int start, int velocity, int min, int max, int over, long time) {
+        void fling(final int start, final int velocity, final int min, final int max,
+                   final int over, final long time) {
             mOver = over;
             mFinished = false;
             mCurrVelocity = mVelocity = velocity;
             mDuration = mSplineDuration = 0;
             mStartTime = time;
             mCurrentPosition = mStart = start;
 
             if (start > max || start < min) {
@@ -525,53 +529,54 @@ import org.mozilla.gecko.annotation.Wrap
             }
 
             if (mFinal > max) {
                 adjustDuration(mStart, mFinal, max);
                 mFinal = max;
             }
         }
 
-        private double getSplineDeceleration(int velocity) {
+        private double getSplineDeceleration(final int velocity) {
             return Math.log(INFLEXION * Math.abs(velocity) / (mFlingFriction * mPhysicalCoeff));
         }
 
-        private double getSplineFlingDistance(int velocity) {
+        private double getSplineFlingDistance(final int velocity) {
             final double l = getSplineDeceleration(velocity);
             final double decelMinusOne = DECELERATION_RATE - 1.0;
             return mFlingFriction * mPhysicalCoeff
                     * Math.exp(DECELERATION_RATE / decelMinusOne * l);
         }
 
         /* Returns the duration, expressed in milliseconds */
-        private int getSplineFlingDuration(int velocity) {
+        private int getSplineFlingDuration(final int velocity) {
             final double l = getSplineDeceleration(velocity);
             final double decelMinusOne = DECELERATION_RATE - 1.0;
             return (int) (1000.0 * Math.exp(l / decelMinusOne));
         }
 
-        private void fitOnBounceCurve(int start, int end, int velocity) {
+        private void fitOnBounceCurve(final int start, final int end, final int velocity) {
             // Simulate a bounce that started from edge
             final float durationToApex = -velocity / mDeceleration;
             final float distanceToApex = velocity * velocity / 2.0f / Math.abs(mDeceleration);
             final float distanceToEdge = Math.abs(end - start);
             final float totalDuration = (float) Math.sqrt(
                     2.0 * (distanceToApex + distanceToEdge) / Math.abs(mDeceleration));
             mStartTime -= (int) (1000.0f * (totalDuration - durationToApex));
             mStart = end;
             mVelocity = (int) (-mDeceleration * totalDuration);
         }
 
-        private void startBounceAfterEdge(int start, int end, int velocity) {
+        private void startBounceAfterEdge(final int start, final int end, final int velocity) {
             mDeceleration = getDeceleration(velocity == 0 ? start - end : velocity);
             fitOnBounceCurve(start, end, velocity);
             onEdgeReached();
         }
 
-        private void startAfterEdge(int start, int min, int max, int velocity, long time) {
+        private void startAfterEdge(final int start, final int min, final int max,
+                                    final int velocity, final long time) {
             if (start > min && start < max) {
                 Log.e("StackScroller", "startAfterEdge called from a valid position");
                 mFinished = true;
                 return;
             }
             final boolean positive = start > max;
             final int edge = positive ? max : min;
             final int overDistance = start - edge;
@@ -602,17 +607,17 @@ import org.mozilla.gecko.annotation.Wrap
             }
 
             mOver = (int) distance;
             mState = BALLISTIC;
             mFinal = mStart + (int) (mVelocity > 0 ? distance : -distance);
             mDuration = -(int) (1000.0f * mVelocity / mDeceleration);
         }
 
-        boolean continueWhenFinished(long time) {
+        boolean continueWhenFinished(final long time) {
             switch (mState) {
                 case SPLINE:
                     // Duration from start to null velocity
                     if (mDuration < mSplineDuration) {
                         // If the animation was clamped, we reached the edge
                         mStart = mFinal;
                         // TODO Better compute speed when edge was reached
                         mVelocity = (int) mCurrVelocity;
@@ -636,17 +641,17 @@ import org.mozilla.gecko.annotation.Wrap
             return true;
         }
 
         /*
          * Update the current position and velocity for current time. Returns
          * true if update has been done and false if animation duration has been
          * reached.
          */
-        boolean update(long time) {
+        boolean update(final long time) {
             final long currentTime = time - mStartTime;
 
             if (((mState == SPLINE) && (mSplineDuration <= 0)) ||
                     ((mState == CUBIC) && (mDuration <= 0))) {
                 return false;
             }
 
             if (currentTime > mDuration) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceAllocator.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceAllocator.java
@@ -34,17 +34,18 @@ import org.mozilla.gecko.GeckoAppShell;
 
         // FIXME: may not want to auto create
         if (!GeckoAppShell.getApplicationContext().bindService(intent, sConnection, Context.BIND_AUTO_CREATE)) {
             throw new Exception("Failed to connect to surface allocator service!");
         }
     }
 
     @WrapForJNI
-    public static GeckoSurface acquireSurface(int width, int height, boolean singleBufferMode) {
+    public static GeckoSurface acquireSurface(final int width, final int height,
+                                              final boolean singleBufferMode) {
         try {
             ensureConnection();
 
             if (singleBufferMode && !GeckoSurfaceTexture.isSingleBufferSupported()) {
                 return null;
             }
             ISurfaceAllocator allocator = sConnection.getAllocator();
             GeckoSurface surface = allocator.acquireSurface(width, height, singleBufferMode);
@@ -54,17 +55,17 @@ import org.mozilla.gecko.GeckoAppShell;
             return surface;
         } catch (Exception e) {
             Log.w(LOGTAG, "Failed to acquire GeckoSurface", e);
             return null;
         }
     }
 
     @WrapForJNI
-    public static void disposeSurface(GeckoSurface surface) {
+    public static void disposeSurface(final GeckoSurface surface) {
         try {
             ensureConnection();
         } catch (Exception e) {
             Log.w(LOGTAG, "Failed to dispose surface, no connection");
             return;
         }
 
         // Release the SurfaceTexture on the other side
@@ -77,17 +78,17 @@ import org.mozilla.gecko.GeckoAppShell;
         // And now our Surface
         try {
             surface.release();
         } catch (Exception e) {
             Log.w(LOGTAG, "Failed to release surface", e);
         }
     }
 
-    public static void sync(int upstream) {
+    public static void sync(final int upstream) {
         try {
             ensureConnection();
         } catch (Exception e) {
             Log.w(LOGTAG, "Failed to sync texture, no connection");
             return;
         }
 
         // Release the SurfaceTexture on the other side
@@ -107,19 +108,20 @@ import org.mozilla.gecko.GeckoAppShell;
                     this.wait();
                 } catch (InterruptedException e) { }
             }
 
             return mAllocator;
         }
 
         @Override
-        public synchronized void onServiceConnected(ComponentName name, IBinder service) {
+        public synchronized void onServiceConnected(final ComponentName name,
+                                                    final IBinder service) {
             mAllocator = ISurfaceAllocator.Stub.asInterface(service);
             this.notifyAll();
         }
 
         @Override
-        public synchronized void onServiceDisconnected(ComponentName name) {
+        public synchronized void onServiceDisconnected(final ComponentName name) {
             mAllocator = null;
         }
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceAllocatorService.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceAllocatorService.java
@@ -14,52 +14,53 @@ public final class SurfaceAllocatorServi
 
     private static final String LOGTAG = "SurfaceAllocatorService";
 
     public int onStartCommand(final Intent intent, final int flags, final int startId) {
         return Service.START_STICKY;
     }
 
     private Binder mBinder = new ISurfaceAllocator.Stub() {
-        public GeckoSurface acquireSurface(int width, int height, boolean singleBufferMode) {
+        public GeckoSurface acquireSurface(final int width, final int height,
+                                           final boolean singleBufferMode) {
             GeckoSurfaceTexture gst = GeckoSurfaceTexture.acquire(singleBufferMode, 0);
 
             if (gst == null) {
                 return null;
             }
 
             if (width > 0 && height > 0) {
                 gst.setDefaultBufferSize(width, height);
             }
 
             return new GeckoSurface(gst);
         }
 
-        public void releaseSurface(int handle) {
+        public void releaseSurface(final int handle) {
             final GeckoSurfaceTexture gst = GeckoSurfaceTexture.lookup(handle);
             if (gst != null) {
                 gst.decrementUse();
             }
         }
 
-        public void configureSync(SyncConfig config) {
+        public void configureSync(final SyncConfig config) {
             final GeckoSurfaceTexture gst = GeckoSurfaceTexture.lookup(config.sourceTextureHandle);
             if (gst != null) {
                 gst.configureSnapshot(config.targetSurface, config.width, config.height);
             }
         }
 
-        public void sync(int handle) {
+        public void sync(final int handle) {
             final GeckoSurfaceTexture gst = GeckoSurfaceTexture.lookup(handle);
             if (gst != null) {
                 gst.takeSnapshot();
             }
         }
     };
 
     public IBinder onBind(final Intent intent) {
         return mBinder;
     }
 
-    public boolean onUnbind(Intent intent) {
+    public boolean onUnbind(final Intent intent) {
         return false;
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceTextureListener.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceTextureListener.java
@@ -24,17 +24,17 @@ import android.graphics.SurfaceTexture;
     protected void finalize() {
         disposeNative();
     }
 
     @WrapForJNI(stubName = "OnFrameAvailable")
     private native void nativeOnFrameAvailable();
 
     @Override // SurfaceTexture.OnFrameAvailableListener
-    public void onFrameAvailable(SurfaceTexture surfaceTexture) {
+    public void onFrameAvailable(final SurfaceTexture surfaceTexture) {
         try {
             nativeOnFrameAvailable();
         } catch (final NullPointerException e) {
             // Ignore exceptions caused by a disposed object, i.e.
             // getting a callback after this listener is no longer in use.
         }
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SyncConfig.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SyncConfig.java
@@ -4,51 +4,51 @@ import android.os.Parcel;
 import android.os.Parcelable;
 
 /* package */ final class SyncConfig implements Parcelable {
     final int sourceTextureHandle;
     final GeckoSurface targetSurface;
     final int width;
     final int height;
 
-    /* package */ SyncConfig(int sourceTextureHandle,
-                             GeckoSurface targetSurface,
-                             int width,
-                             int height) {
+    /* package */ SyncConfig(final int sourceTextureHandle,
+                             final GeckoSurface targetSurface,
+                             final int width,
+                             final int height) {
         this.sourceTextureHandle = sourceTextureHandle;
         this.targetSurface = targetSurface;
         this.width = width;
         this.height = height;
     }
 
     public static final Creator<SyncConfig> CREATOR =
         new Creator<SyncConfig>() {
             @Override
-            public SyncConfig createFromParcel(Parcel parcel) {
+            public SyncConfig createFromParcel(final Parcel parcel) {
                 return new SyncConfig(parcel);
             }
 
             @Override
-            public SyncConfig[] newArray(int i) {
+            public SyncConfig[] newArray(final int i) {
                 return new SyncConfig[i];
             }
         };
 
-    private SyncConfig(Parcel parcel) {
+    private SyncConfig(final Parcel parcel) {
         sourceTextureHandle = parcel.readInt();
         targetSurface = GeckoSurface.CREATOR.createFromParcel(parcel);
         width = parcel.readInt();
         height = parcel.readInt();
     }
 
     @Override
     public int describeContents() {
         return 0;
     }
 
     @Override
-    public void writeToParcel(Parcel parcel, int flags) {
+    public void writeToParcel(final Parcel parcel, final int flags) {
         parcel.writeInt(sourceTextureHandle);
         targetSurface.writeToParcel(parcel, flags);
         parcel.writeInt(width);
         parcel.writeInt(height);
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/VsyncSource.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/VsyncSource.java
@@ -40,30 +40,30 @@ import org.mozilla.gecko.GeckoAppShell;
             }
         });
     }
 
     @WrapForJNI(stubName = "NotifyVsync")
     private static native void nativeNotifyVsync();
 
     // Choreographer callback implementation.
-    public void doFrame(long frameTimeNanos) {
+    public void doFrame(final long frameTimeNanos) {
         if (mObservingVsync) {
             mChoreographer.postFrameCallback(this);
             nativeNotifyVsync();
         }
     }
 
     /**
      * Start/stop observing Vsync event.
      * @param enable true to start observing; false to stop.
      * @return true if observing and false if not.
      */
     @WrapForJNI
-    public synchronized boolean observeVsync(boolean enable) {
+    public synchronized boolean observeVsync(final boolean enable) {
         if (mObservingVsync != enable) {
             mObservingVsync = enable;
 
             if (mChoreographer != null) {
                 if (enable) {
                     mChoreographer.postFrameCallback(this);
                 } else {
                     mChoreographer.removeFrameCallback(this);
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/AsyncCodecFactory.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/AsyncCodecFactory.java
@@ -4,16 +4,16 @@
 
 package org.mozilla.gecko.media;
 
 import android.os.Build;
 
 import java.io.IOException;
 
 public final class AsyncCodecFactory {
-    public static AsyncCodec create(String name) throws IOException {
+    public static AsyncCodec create(final String name) throws IOException {
         // A bug that getInputBuffer() could fail after flush() then start() wasn't fixed until MR1.
         // See: https://android.googlesource.com/platform/frameworks/av/+/d9e0603a1be07dbb347c55050c7d4629ea7492e8
         return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1
                ? new LollipopAsyncCodec(name)
                : new JellyBeanAsyncCodec(name);
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/BaseHlsPlayer.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/BaseHlsPlayer.java
@@ -17,32 +17,32 @@ public interface BaseHlsPlayer {
 
     public enum ResourceError {
         BASE(-100),
         UNKNOWN(-101),
         PLAYER(-102),
         UNSUPPORTED(-103);
 
         private int mNumVal;
-        private ResourceError(int numVal) {
+        private ResourceError(final int numVal) {
             mNumVal = numVal;
         }
         public int code() {
             return mNumVal;
         }
     }
 
     public enum DemuxerError {
         BASE(-200),
         UNKNOWN(-201),
         PLAYER(-202),
         UNSUPPORTED(-203);
 
         private int mNumVal;
-        private DemuxerError(int numVal) {
+        private DemuxerError(final int numVal) {
             mNumVal = numVal;
         }
         public int code() {
             return mNumVal;
         }
     }
 
     public interface DemuxerCallbacks {
@@ -88,9 +88,9 @@ public interface BaseHlsPlayer {
 
     public void resume();
 
     public void play();
 
     public void pause();
 
     public void release();
-}
\ No newline at end of file
+}
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/Codec.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/Codec.java
@@ -29,32 +29,33 @@ import org.mozilla.gecko.gfx.GeckoSurfac
     private static final boolean DEBUG = false;
 
     public enum Error {
         DECODE, FATAL
     }
 
     private final class Callbacks implements AsyncCodec.Callbacks {
         @Override
-        public void onInputBufferAvailable(AsyncCodec codec, int index) {
+        public void onInputBufferAvailable(final AsyncCodec codec, final int index) {
             mInputProcessor.onBuffer(index);
         }
 
         @Override
-        public void onOutputBufferAvailable(AsyncCodec codec, int index, MediaCodec.BufferInfo info) {
+        public void onOutputBufferAvailable(final AsyncCodec codec, final int index,
+                                            final MediaCodec.BufferInfo info) {
             mOutputProcessor.onBuffer(index, info);
         }
 
         @Override
-        public void onError(AsyncCodec codec, int error) {
+        public void onError(final AsyncCodec codec, final int error) {
             reportError(Error.FATAL, new Exception("codec error:" + error));
         }
 
         @Override
-        public void onOutputFormatChanged(AsyncCodec codec, MediaFormat format) {
+        public void onOutputFormatChanged(final AsyncCodec codec, final MediaFormat format) {
             mOutputProcessor.onFormatChanged(format);
         }
     }
 
     private static final class Input {
         public final Sample sample;
         public boolean reported;
 
@@ -65,23 +66,23 @@ import org.mozilla.gecko.gfx.GeckoSurfac
 
     private final class InputProcessor {
         private boolean mHasInputCapacitySet;
         private Queue<Integer> mAvailableInputBuffers = new LinkedList<>();
         private Queue<Sample> mDequeuedSamples = new LinkedList<>();
         private Queue<Input> mInputSamples = new LinkedList<>();
         private boolean mStopped;
 
-        private synchronized Sample onAllocate(int size) {
+        private synchronized Sample onAllocate(final int size) {
             Sample sample = mSamplePool.obtainInput(size);
             mDequeuedSamples.add(sample);
             return sample;
         }
 
-        private synchronized void onSample(Sample sample) {
+        private synchronized void onSample(final Sample sample) {
             if (sample == null) {
                 // Ignore empty input.
                 mSamplePool.recycleInput(mDequeuedSamples.remove());
                 Log.w(LOGTAG, "WARN: empty input sample");
                 return;
             }
 
             if (sample.isEOS()) {
@@ -92,30 +93,30 @@ import org.mozilla.gecko.gfx.GeckoSurfac
             Sample dequeued = mDequeuedSamples.remove();
             dequeued.info = sample.info;
             dequeued.cryptoInfo = sample.cryptoInfo;
             queueSample(dequeued);
 
             sample.dispose();
         }
 
-        private void queueSample(Sample sample) {
+        private void queueSample(final Sample sample) {
             if (!mInputSamples.offer(new Input(sample))) {
                 reportError(Error.FATAL, new Exception("FAIL: input sample queue is full"));
                 return;
             }
 
             try {
                 feedSampleToBuffer();
             } catch (Exception e) {
                 reportError(Error.FATAL, e);
             }
         }
 
-        private synchronized void onBuffer(int index) {
+        private synchronized void onBuffer(final int index) {
             if (mStopped || !isValidBuffer(index)) {
                 return;
             }
 
             if (!mHasInputCapacitySet) {
                 int capacity = mCodec.getInputBuffer(index).capacity();
                 if (capacity > 0) {
                     mSamplePool.setInputBufferSize(capacity);
@@ -221,33 +222,33 @@ import org.mozilla.gecko.gfx.GeckoSurfac
             reset();
         }
     }
 
     private static final class Output {
         public final Sample sample;
         public final int index;
 
-        public Output(final Sample sample, int index) {
+        public Output(final Sample sample, final int index) {
             this.sample = sample;
             this.index = index;
         }
     }
 
     private class OutputProcessor {
         private final boolean mRenderToSurface;
         private boolean mHasOutputCapacitySet;
         private Queue<Output> mSentOutputs = new LinkedList<>();
         private boolean mStopped;
 
-        private OutputProcessor(boolean renderToSurface) {
+        private OutputProcessor(final boolean renderToSurface) {
             mRenderToSurface = renderToSurface;
         }
 
-        private synchronized void onBuffer(int index, MediaCodec.BufferInfo info) {
+        private synchronized void onBuffer(final int index, final MediaCodec.BufferInfo info) {
             if (mStopped || !isValidBuffer(index)) {
                 return;
             }
 
             try {
                 Sample output = obtainOutputSample(index, info);
                 mSentOutputs.add(new Output(output, index));
                 mCallbacks.onOutput(output);
@@ -266,17 +267,17 @@ import org.mozilla.gecko.gfx.GeckoSurfac
             try {
                 return (mCodec.getOutputBuffer(index) != null) || mRenderToSurface;
             } catch (IllegalStateException e) {
                 if (DEBUG) { Log.e(LOGTAG, "invalid buffer#" + index, e); }
                 return false;
             }
         }
 
-        private Sample obtainOutputSample(int index, MediaCodec.BufferInfo info) {
+        private Sample obtainOutputSample(final int index, final MediaCodec.BufferInfo info) {
             Sample sample = mSamplePool.obtainOutput(info);
 
             if (mRenderToSurface) {
                 return sample;
             }
 
             ByteBuffer output = mCodec.getOutputBuffer(index);
             if (!mHasOutputCapacitySet) {
@@ -293,29 +294,29 @@ import org.mozilla.gecko.gfx.GeckoSurfac
                 } catch (IOException e) {
                     Log.e(LOGTAG, "Fail to read output buffer:" + e.getMessage());
                 }
             }
 
             return sample;
         }
 
-        private synchronized void onRelease(Sample sample, boolean render) {
+        private synchronized void onRelease(final Sample sample, final boolean render) {
             final Output output = mSentOutputs.poll();
             if (output == null) {
                 if (DEBUG) { Log.d(LOGTAG, sample + " already released"); }
                 return;
             }
             mCodec.releaseOutputBuffer(output.index, render);
             mSamplePool.recycleOutput(output.sample);
 
             sample.dispose();
         }
 
-        private void onFormatChanged(MediaFormat format) {
+        private void onFormatChanged(final MediaFormat format) {
             try {
                 mCallbacks.onOutputFormatChanged(new FormatParam(format));
             } catch (RemoteException re) {
                 // Dead recipient.
                 re.printStackTrace();
             }
         }
 
@@ -348,37 +349,37 @@ import org.mozilla.gecko.gfx.GeckoSurfac
     private InputProcessor mInputProcessor;
     private OutputProcessor mOutputProcessor;
     private SamplePool mSamplePool;
     // Values will be updated after configure called.
     private volatile boolean mIsAdaptivePlaybackSupported = false;
     private volatile boolean mIsHardwareAccelerated = false;
     private boolean mIsTunneledPlaybackSupported = false;
 
-    public synchronized void setCallbacks(ICodecCallbacks callbacks) throws RemoteException {
+    public synchronized void setCallbacks(final ICodecCallbacks callbacks) throws RemoteException {
         mCallbacks = callbacks;
         callbacks.asBinder().linkToDeath(this, 0);
     }
 
     // IBinder.DeathRecipient
     @Override
     public synchronized void binderDied() {
         Log.e(LOGTAG, "Callbacks is dead");
         try {
             release();
         } catch (RemoteException e) {
             // Nowhere to report the error.
         }
     }
 
     @Override
-    public synchronized boolean configure(FormatParam format,
-                                          GeckoSurface surface,
-                                          int flags,
-                                          String drmStubId) throws RemoteException {
+    public synchronized boolean configure(final FormatParam format,
+                                          final GeckoSurface surface,
+                                          final int flags,
+                                          final String drmStubId) throws RemoteException {
         if (mCallbacks == null) {
             Log.e(LOGTAG, "FAIL: callbacks must be set before calling configure()");
             return false;
         }
 
         if (mCodec != null) {
             if (DEBUG) { Log.d(LOGTAG, "release existing codec: " + mCodec); }
             mCodec.release();
@@ -496,17 +497,17 @@ import org.mozilla.gecko.gfx.GeckoSurfac
         mOutputProcessor.start();
         try {
             mCodec.start();
         } catch (Exception e) {
             reportError(Error.FATAL, e);
         }
     }
 
-    private void reportError(Error error, Exception e) {
+    private void reportError(final Error error, final Exception e) {
         if (e != null) {
             e.printStackTrace();
         }
         try {
             mCallbacks.onError(error == Error.FATAL);
         } catch (NullPointerException ne) {
             // mCallbacks has been disposed by release().
         } catch (RemoteException re) {
@@ -540,45 +541,45 @@ import org.mozilla.gecko.gfx.GeckoSurfac
             mOutputProcessor.start();
             mCodec.resumeReceivingInputs();
         } catch (Exception e) {
             reportError(Error.FATAL, e);
         }
     }
 
     @Override
-    public synchronized Sample dequeueInput(int size) throws RemoteException {
+    public synchronized Sample dequeueInput(final int size) throws RemoteException {
         try {
             return mInputProcessor.onAllocate(size);
         } catch (Exception e) {
             // Translate allocation error to remote exception.
             throw new RemoteException(e.getMessage());
         }
     }
 
     @Override
-    public synchronized void queueInput(Sample sample) throws RemoteException {
+    public synchronized void queueInput(final Sample sample) throws RemoteException {
         try {
             mInputProcessor.onSample(sample);
         } catch (Exception e) {
             throw new RemoteException(e.getMessage());
         }
     }
 
     @Override
-    public synchronized void setRates(int newBitRate) {
+    public synchronized void setRates(final int newBitRate) {
         try {
             mCodec.setRates(newBitRate);
         } catch (Exception e) {
             reportError(Error.FATAL, e);
         }
     }
 
     @Override
-    public synchronized void releaseOutput(Sample sample, boolean render) {
+    public synchronized void releaseOutput(final Sample sample, final boolean render) {
         try {
             mOutputProcessor.onRelease(sample, render);
         } catch (Exception e) {
             reportError(Error.FATAL, e);
         }
     }
 
     @Override
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/CodecProxy.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/CodecProxy.java
@@ -55,96 +55,99 @@ public final class CodecProxy {
             throw new UnsupportedOperationException();
         }
     }
 
     private class CallbacksForwarder extends ICodecCallbacks.Stub {
         private final Callbacks mCallbacks;
         private boolean mCodecProxyReleased;
 
-        CallbacksForwarder(Callbacks callbacks) {
+        CallbacksForwarder(final Callbacks callbacks) {
             mCallbacks = callbacks;
         }
 
         @Override
-        public synchronized void onInputQueued(long timestamp) throws RemoteException {
+        public synchronized void onInputQueued(final long timestamp) throws RemoteException {
             if (!mCodecProxyReleased) {
                 mCallbacks.onInputStatus(timestamp, true /* processed */);
             }
         }
 
         @Override
-        public synchronized void onInputPending(long timestamp) throws RemoteException {
+        public synchronized void onInputPending(final long timestamp) throws RemoteException {
             if (!mCodecProxyReleased) {
                 mCallbacks.onInputStatus(timestamp, false /* processed */);
             }
         }
 
         @Override
-        public synchronized void onOutputFormatChanged(FormatParam format) throws RemoteException {
+        public synchronized void onOutputFormatChanged(final FormatParam format)
+                throws RemoteException {
             if (!mCodecProxyReleased) {
                 mCallbacks.onOutputFormatChanged(format.asFormat());
             }
         }
 
         @Override
-        public synchronized void onOutput(Sample sample) throws RemoteException {
+        public synchronized void onOutput(final Sample sample) throws RemoteException {
             if (mCodecProxyReleased) {
                 sample.dispose();
                 return;
             }
             if (mOutputSurface != null) {
                 // Don't render to surface just yet. Callback will make that happen when it's time.
                 mSurfaceOutputs.offer(sample);
             }
             mCallbacks.onOutput(sample);
         }
 
         @Override
-        public void onError(boolean fatal) throws RemoteException {
+        public void onError(final boolean fatal) throws RemoteException {
             reportError(fatal);
         }
 
-        private synchronized void reportError(boolean fatal) {
+        private synchronized void reportError(final boolean fatal) {
             if (!mCodecProxyReleased) {
                 mCallbacks.onError(fatal);
             }
         }
 
         private synchronized void setCodecProxyReleased() {
             mCodecProxyReleased = true;
         }
     }
 
     @WrapForJNI
-    public static CodecProxy create(boolean isEncoder,
-                                    MediaFormat format,
-                                    GeckoSurface surface,
-                                    Callbacks callbacks,
-                                    String drmStubId) {
+    public static CodecProxy create(final boolean isEncoder,
+                                    final MediaFormat format,
+                                    final GeckoSurface surface,
+                                    final Callbacks callbacks,
+                                    final String drmStubId) {
         return RemoteManager.getInstance().createCodec(isEncoder, format, surface, callbacks, drmStubId);
     }
 
-    public static CodecProxy createCodecProxy(boolean isEncoder,
-                                              MediaFormat format,
-                                              GeckoSurface surface,
-                                              Callbacks callbacks,
-                                              String drmStubId) {
+    public static CodecProxy createCodecProxy(final boolean isEncoder,
+                                              final MediaFormat format,
+                                              final GeckoSurface surface,
+                                              final Callbacks callbacks,
+                                              final String drmStubId) {
         return new CodecProxy(isEncoder, format, surface, callbacks, drmStubId);
     }
 
-    private CodecProxy(boolean isEncoder, MediaFormat format, GeckoSurface surface, Callbacks callbacks, String drmStubId) {
+    private CodecProxy(final boolean isEncoder, final MediaFormat format,
+                       final GeckoSurface surface, final Callbacks callbacks,
+                       final String drmStubId) {
         mIsEncoder = isEncoder;
         mFormat = new FormatParam(format);
         mOutputSurface = surface;
         mRemoteDrmStubId = drmStubId;
         mCallbacks = new CallbacksForwarder(callbacks);
     }
 
-    boolean init(ICodec remote) {
+    boolean init(final ICodec remote) {
         try {
             remote.setCallbacks(mCallbacks);
             if (!remote.configure(mFormat, mOutputSurface, mIsEncoder ? MediaCodec.CONFIGURE_FLAG_ENCODE : 0, mRemoteDrmStubId)) {
                 return false;
             }
             remote.start();
         } catch (RemoteException e) {
             e.printStackTrace();
@@ -208,17 +211,18 @@ public final class CodecProxy {
             return mRemote.isTunneledPlaybackSupported();
         } catch (RemoteException e) {
             e.printStackTrace();
             return false;
         }
     }
 
     @WrapForJNI
-    public synchronized boolean input(ByteBuffer bytes, BufferInfo info, CryptoInfo cryptoInfo) {
+    public synchronized boolean input(final ByteBuffer bytes, final BufferInfo info,
+                                      final CryptoInfo cryptoInfo) {
         if (mRemote == null) {
             Log.e(LOGTAG, "cannot send input to an ended codec");
             return false;
         }
 
         boolean eos = info.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM;
 
         if (eos) {
@@ -232,17 +236,17 @@ public final class CodecProxy {
         } catch (IOException e) {
             Log.e(LOGTAG, "fail to copy input data.", e);
             // Balance dequeue/queue.
             sendInput(null);
         }
         return false;
     }
 
-    private boolean sendInput(Sample sample) {
+    private boolean sendInput(final Sample sample) {
         try {
             mRemote.queueInput(sample);
             if (sample != null) {
                 sample.dispose();
                 mFlushed = false;
             }
         } catch (Exception e) {
             Log.e(LOGTAG, "fail to queue input:" + sample, e);
@@ -306,17 +310,17 @@ public final class CodecProxy {
                 e.printStackTrace();
                 return false;
             }
             return true;
         }
     }
 
     @WrapForJNI
-    public synchronized boolean setRates(int newBitRate) {
+    public synchronized boolean setRates(final int newBitRate) {
         if (!mIsEncoder) {
             Log.w(LOGTAG, "this api is encoder-only");
             return false;
         }
 
         if (android.os.Build.VERSION.SDK_INT < 19) {
             Log.w(LOGTAG, "this api was added in API level 19");
             return false;
@@ -332,17 +336,17 @@ public final class CodecProxy {
         } catch (RemoteException e) {
             Log.e(LOGTAG, "remote fail to set rates:" + newBitRate);
             e.printStackTrace();
         }
         return true;
     }
 
     @WrapForJNI
-    public synchronized boolean releaseOutput(Sample sample, boolean render) {
+    public synchronized boolean releaseOutput(final Sample sample, final boolean render) {
         if (mOutputSurface != null) {
             if (!mSurfaceOutputs.remove(sample)) {
                 if (mRemote != null) Log.w(LOGTAG, "already released: " + sample);
                 return true;
             }
 
             if (DEBUG && !render) {
                 Log.d(LOGTAG, "drop output:" + sample.info.presentationTimeUs);
@@ -361,12 +365,12 @@ public final class CodecProxy {
             Log.e(LOGTAG, "remote fail to release output:" + sample.info.presentationTimeUs);
             e.printStackTrace();
         }
         sample.dispose();
 
         return true;
     }
 
-    /* package */ void reportError(boolean fatal) {
+    /* package */ void reportError(final boolean fatal) {
         mCallbacks.reportError(fatal);
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/FormatParam.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/FormatParam.java
@@ -34,48 +34,48 @@ public final class FormatParam implement
     private static final String KEY_CONFIG_1 = "csd-1";
 
     private MediaFormat mFormat;
 
     public MediaFormat asFormat() {
         return mFormat;
     }
 
-    public FormatParam(MediaFormat format) {
+    public FormatParam(final MediaFormat format) {
         mFormat = format;
     }
 
-    protected FormatParam(Parcel in) {
+    protected FormatParam(final Parcel in) {
         mFormat = new MediaFormat();
         readFromParcel(in);
     }
 
     public static final Creator<FormatParam> CREATOR = new Creator<FormatParam>() {
         @Override
-        public FormatParam createFromParcel(Parcel in) {
+        public FormatParam createFromParcel(final Parcel in) {
             return new FormatParam(in);
         }
 
         @Override
-        public FormatParam[] newArray(int size) {
+        public FormatParam[] newArray(final int size) {
             return new FormatParam[size];
         }
     };
 
     @Override
     public int describeContents() {
         return 0;
     }
 
-    public void readFromParcel(Parcel in) {
+    public void readFromParcel(final Parcel in) {
         Bundle bundle = in.readBundle();
         fromBundle(bundle);
     }
 
-    private void fromBundle(Bundle bundle) {
+    private void fromBundle(final Bundle bundle) {
         if (bundle.containsKey(MediaFormat.KEY_MIME)) {
             mFormat.setString(MediaFormat.KEY_MIME,
                     bundle.getString(MediaFormat.KEY_MIME));
         }
         if (bundle.containsKey(MediaFormat.KEY_WIDTH)) {
             mFormat.setInteger(MediaFormat.KEY_WIDTH,
                     bundle.getInt(MediaFormat.KEY_WIDTH));
         }
@@ -117,17 +117,17 @@ public final class FormatParam implement
         }
         if (bundle.containsKey(MediaFormat.KEY_I_FRAME_INTERVAL)) {
             mFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL,
                     bundle.getInt(MediaFormat.KEY_I_FRAME_INTERVAL));
         }
     }
 
     @Override
-    public void writeToParcel(Parcel dest, int flags) {
+    public void writeToParcel(final Parcel dest, final int flags) {
         dest.writeBundle(toBundle());
     }
 
     private Bundle toBundle() {
         Bundle bundle = new Bundle();
         if (mFormat.containsKey(MediaFormat.KEY_MIME)) {
             bundle.putString(MediaFormat.KEY_MIME, mFormat.getString(MediaFormat.KEY_MIME));
         }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoAudioInfo.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoAudioInfo.java
@@ -12,18 +12,19 @@ import org.mozilla.gecko.annotation.Wrap
 public final class GeckoAudioInfo {
     final public byte[] codecSpecificData;
     final public int rate;
     final public int channels;
     final public int bitDepth;
     final public int profile;
     final public long duration;
     final public String mimeType;
-    public GeckoAudioInfo(int rate, int channels, int bitDepth, int profile,
-                          long duration, String mimeType, byte[] codecSpecificData) {
+    public GeckoAudioInfo(final int rate, final int channels, final int bitDepth, final int profile,
+                          final long duration, final String mimeType,
+                          final byte[] codecSpecificData) {
         this.rate = rate;
         this.channels = channels;
         this.bitDepth = bitDepth;
         this.profile = profile;
         this.duration = duration;
         this.mimeType = mimeType;
         this.codecSpecificData = codecSpecificData;
     }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHLSDemuxerWrapper.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHLSDemuxerWrapper.java
@@ -19,17 +19,17 @@ public final class GeckoHLSDemuxerWrappe
 
     // NOTE : These TRACK definitions should be synced with Gecko.
     public enum TrackType {
         UNDEFINED(0),
         AUDIO(1),
         VIDEO(2),
         TEXT(3);
         private int mType;
-        private TrackType(int type) {
+        private TrackType(final int type) {
             mType = type;
         }
         public int value() {
             return mType;
         }
     }
 
     private BaseHlsPlayer mPlayer = null;
@@ -49,23 +49,23 @@ public final class GeckoHLSDemuxerWrappe
         public native void onError(int errorCode);
 
         @Override // JNIObject
         protected void disposeNative() {
             throw new UnsupportedOperationException();
         }
     } // Callbacks
 
-    private static void assertTrue(boolean condition) {
+    private static void assertTrue(final boolean condition) {
         if (DEBUG && !condition) {
             throw new AssertionError("Expected condition to be true");
         }
     }
 
-    private BaseHlsPlayer.TrackType getPlayerTrackType(int trackType) {
+    private BaseHlsPlayer.TrackType getPlayerTrackType(final int trackType) {
         if (trackType == TrackType.AUDIO.value()) {
             return BaseHlsPlayer.TrackType.AUDIO;
         } else if (trackType == TrackType.VIDEO.value()) {
             return BaseHlsPlayer.TrackType.VIDEO;
         } else if (trackType == TrackType.TEXT.value()) {
             return BaseHlsPlayer.TrackType.TEXT;
         }
         return BaseHlsPlayer.TrackType.UNDEFINED;
@@ -73,68 +73,69 @@ public final class GeckoHLSDemuxerWrappe
 
     @WrapForJNI
     public long getBuffered() {
         assertTrue(mPlayer != null);
         return mPlayer.getBufferedPosition();
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    public static GeckoHLSDemuxerWrapper create(int id, BaseHlsPlayer.DemuxerCallbacks callback) {
+    public static GeckoHLSDemuxerWrapper create(final int id,
+                                                final BaseHlsPlayer.DemuxerCallbacks callback) {
         return new GeckoHLSDemuxerWrapper(id, callback);
     }
 
     @WrapForJNI
-    public int getNumberOfTracks(int trackType) {
+    public int getNumberOfTracks(final int trackType) {
         assertTrue(mPlayer != null);
         int tracks = mPlayer.getNumberOfTracks(getPlayerTrackType(trackType));
         if (DEBUG) Log.d(LOGTAG, "[GetNumberOfTracks] type : " + trackType + ", num = " + tracks);
         return tracks;
     }
 
     @WrapForJNI
-    public GeckoAudioInfo getAudioInfo(int index) {
+    public GeckoAudioInfo getAudioInfo(final int index) {
         assertTrue(mPlayer != null);
         if (DEBUG) Log.d(LOGTAG, "[getAudioInfo] formatIndex : " + index);
         GeckoAudioInfo aInfo = mPlayer.getAudioInfo(index);
         return aInfo;
     }
 
     @WrapForJNI
-    public GeckoVideoInfo getVideoInfo(int index) {
+    public GeckoVideoInfo getVideoInfo(final int index) {
         assertTrue(mPlayer != null);
         if (DEBUG) Log.d(LOGTAG, "[getVideoInfo] formatIndex : " + index);
         GeckoVideoInfo vInfo = mPlayer.getVideoInfo(index);
         return vInfo;
     }
 
     @WrapForJNI
-    public boolean seek(long seekTime) {
+    public boolean seek(final long seekTime) {
         // seekTime : microseconds.
         assertTrue(mPlayer != null);
         if (DEBUG) Log.d(LOGTAG, "seek  : " + seekTime + " (Us)");
         return mPlayer.seek(seekTime);
     }
 
-    GeckoHLSDemuxerWrapper(int id, BaseHlsPlayer.DemuxerCallbacks callback) {
+    GeckoHLSDemuxerWrapper(final int id, final BaseHlsPlayer.DemuxerCallbacks callback) {
         if (DEBUG) Log.d(LOGTAG, "Constructing GeckoHLSDemuxerWrapper ...");
         assertTrue(callback != null);
         try {
             mPlayer = GeckoPlayerFactory.getPlayer(id);
             if (mPlayer != null) {
                 mPlayer.addDemuxerWrapperCallbackListener(callback);
             }
         } catch (Exception e) {
             Log.e(LOGTAG, "Constructing GeckoHLSDemuxerWrapper ... error", e);
             callback.onError(BaseHlsPlayer.DemuxerError.UNKNOWN.code());
         }
     }
 
     @WrapForJNI
-    private GeckoHLSSample[] getSamples(int mediaType, int number) {
+    private GeckoHLSSample[] getSamples(final int mediaType, final int number) {
         assertTrue(mPlayer != null);
         ConcurrentLinkedQueue<GeckoHLSSample> samples = null;
         // getA/VSamples will always return a non-null instance.
         samples = mPlayer.getSamples(getPlayerTrackType(mediaType), number);
         assertTrue(samples.size() <= number);
         return samples.toArray(new GeckoHLSSample[samples.size()]);
     }
 
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHLSResourceWrapper.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHLSResourceWrapper.java
@@ -30,33 +30,33 @@ public class GeckoHLSResourceWrapper {
         public native void onError(int errorCode);
 
         @Override // JNIObject
         protected void disposeNative() {
             throw new UnsupportedOperationException();
         }
     } // Callbacks
 
-    private GeckoHLSResourceWrapper(String url,
-                                    BaseHlsPlayer.ResourceCallbacks callback) {
+    private GeckoHLSResourceWrapper(final String url,
+                                    final BaseHlsPlayer.ResourceCallbacks callback) {
         if (DEBUG) Log.d(LOGTAG, "GeckoHLSResourceWrapper created with url = " + url);
         assertTrue(callback != null);
 
         mPlayer = GeckoPlayerFactory.getPlayer();
         try {
             mPlayer.init(url, callback);
         } catch (Exception e) {
             Log.e(LOGTAG, "Failed to create GeckoHlsResourceWrapper !", e);
             callback.onError(BaseHlsPlayer.ResourceError.UNKNOWN.code());
         }
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    public static GeckoHLSResourceWrapper create(String url,
-                                                 BaseHlsPlayer.ResourceCallbacks callback) {
+    public static GeckoHLSResourceWrapper create(final String url,
+                                                 final BaseHlsPlayer.ResourceCallbacks callback) {
         return new GeckoHLSResourceWrapper(url, callback);
     }
 
     @WrapForJNI(calledFrom = "gecko")
     public int getPlayerId() {
         // GeckoHLSResourceWrapper should always be created before others
         assertTrue(!mDestroy);
         assertTrue(mPlayer != null);
@@ -90,17 +90,17 @@ public class GeckoHLSResourceWrapper {
     @WrapForJNI(calledFrom = "gecko")
     public void pause() {
         if (DEBUG) Log.d(LOGTAG, "GeckoHLSResourceWrapper mediaelement paused");
         if (mPlayer != null) {
             mPlayer.pause();
         }
     }
 
-    private static void assertTrue(boolean condition) {
+    private static void assertTrue(final boolean condition) {
         if (DEBUG && !condition) {
             throw new AssertionError("Expected condition to be true");
         }
     }
 
     @WrapForJNI // Called when native object is mDestroy.
     private void destroy() {
         if (DEBUG) Log.d(LOGTAG, "destroy!! Native object is destroyed.");
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHLSSample.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHLSSample.java
@@ -32,39 +32,39 @@ public final class GeckoHLSSample {
     final public BufferInfo info;
 
     @WrapForJNI
     final public CryptoInfo cryptoInfo;
 
     private ByteBuffer buffer = null;
 
     @WrapForJNI
-    public void writeToByteBuffer(ByteBuffer dest) throws IOException {
+    public void writeToByteBuffer(final ByteBuffer dest) throws IOException {
         if (buffer != null && dest != null && info.size > 0) {
             dest.put(buffer);
         }
     }
 
     @WrapForJNI
     public boolean isEOS() {
         return (info.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0;
     }
 
     @WrapForJNI
     public boolean isKeyFrame() {
         return (info.flags & MediaCodec.BUFFER_FLAG_KEY_FRAME) != 0;
     }
 
-    public static GeckoHLSSample create(ByteBuffer src, BufferInfo info, CryptoInfo cryptoInfo,
-                                        int formatIndex) {
+    public static GeckoHLSSample create(final ByteBuffer src, final BufferInfo info,
+                                        final CryptoInfo cryptoInfo, final int formatIndex) {
         return new GeckoHLSSample(src, info, cryptoInfo, formatIndex);
     }
 
-    private GeckoHLSSample(ByteBuffer buffer, BufferInfo info, CryptoInfo cryptoInfo,
-                           int formatIndex) {
+    private GeckoHLSSample(final ByteBuffer buffer, final BufferInfo info,
+                           final CryptoInfo cryptoInfo, final int formatIndex) {
         this.formatIndex = formatIndex;
         duration = Long.MAX_VALUE;
         this.buffer = buffer;
         this.info = info;
         this.cryptoInfo = cryptoInfo;
     }
 
     @Override
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsAudioRenderer.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsAudioRenderer.java
@@ -20,25 +20,25 @@ import com.google.android.exoplayer2.dec
 import com.google.android.exoplayer2.mediacodec.MediaCodecInfo;
 import com.google.android.exoplayer2.mediacodec.MediaCodecSelector;
 import com.google.android.exoplayer2.mediacodec.MediaCodecUtil;
 import com.google.android.exoplayer2.util.MimeTypes;
 
 import java.nio.ByteBuffer;
 
 public class GeckoHlsAudioRenderer extends GeckoHlsRendererBase {
-    public GeckoHlsAudioRenderer(GeckoHlsPlayer.ComponentEventDispatcher eventDispatcher) {
+    public GeckoHlsAudioRenderer(final GeckoHlsPlayer.ComponentEventDispatcher eventDispatcher) {
         super(C.TRACK_TYPE_AUDIO, eventDispatcher);
         assertTrue(Build.VERSION.SDK_INT >= 16);
         LOGTAG = getClass().getSimpleName();
         DEBUG = !BuildConfig.MOZILLA_OFFICIAL;
     }
 
     @Override
-    public final int supportsFormat(Format format) {
+    public final int supportsFormat(final Format format) {
         /*
          * FORMAT_EXCEEDS_CAPABILITIES : The Renderer is capable of rendering
          *                               formats with the same mime type, but
          *                               the properties of the format exceed
          *                               the renderer's capability.
          * FORMAT_UNSUPPORTED_SUBTYPE : The Renderer is a general purpose
          *                              renderer for formats of the same
          *                              top-level type, but is not capable of
@@ -93,33 +93,34 @@ public class GeckoHlsAudioRenderer exten
 
     @Override
     protected void resetRenderer() {
         mInputBuffer = null;
         mInitialized = false;
     }
 
     @Override
-    protected void handleReconfiguration(DecoderInputBuffer bufferForRead) {
+    protected void handleReconfiguration(final DecoderInputBuffer bufferForRead) {
         // Do nothing
     }
 
     @Override
-    protected void handleFormatRead(DecoderInputBuffer bufferForRead) throws ExoPlaybackException {
+    protected void handleFormatRead(final DecoderInputBuffer bufferForRead)
+            throws ExoPlaybackException {
         onInputFormatChanged(mFormatHolder.format);
     }
 
     @Override
-    protected void handleEndOfStream(DecoderInputBuffer bufferForRead) {
+    protected void handleEndOfStream(final DecoderInputBuffer bufferForRead) {
         mInputStreamEnded = true;
         mDemuxedInputSamples.offer(GeckoHLSSample.EOS);
     }
 
     @Override
-    protected void handleSamplePreparation(DecoderInputBuffer bufferForRead) {
+    protected void handleSamplePreparation(final DecoderInputBuffer bufferForRead) {
         int size = bufferForRead.data.limit();
         byte[] realData = new byte[size];
         bufferForRead.data.get(realData, 0, size);
         ByteBuffer buffer = ByteBuffer.wrap(realData);
         mInputBuffer = bufferForRead.data;
         mInputBuffer.clear();
 
         CryptoInfo cryptoInfo = bufferForRead.isEncrypted() ? bufferForRead.cryptoInfo.getFrameworkCryptoInfoV16() : null;
@@ -152,12 +153,12 @@ public class GeckoHlsAudioRenderer exten
     @Override
     protected boolean clearInputSamplesQueue() {
         if (DEBUG) { Log.d(LOGTAG, "clearInputSamplesQueue"); }
         mDemuxedInputSamples.clear();
         return true;
     }
 
     @Override
-    protected void notifyPlayerInputFormatChanged(Format newFormat) {
+    protected void notifyPlayerInputFormatChanged(final Format newFormat) {
         mPlayerEventDispatcher.onAudioInputFormatChanged(newFormat);
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsPlayer.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsPlayer.java
@@ -91,17 +91,17 @@ public class GeckoHlsPlayer implements B
 
     private GeckoHlsVideoRenderer mVRenderer = null;
     private GeckoHlsAudioRenderer mARenderer = null;
 
     // Able to control if we only want V/A/V+A tracks from bitstream.
     private class RendererController {
         private final boolean mEnableV;
         private final boolean mEnableA;
-        RendererController(boolean enableVideoRenderer, boolean enableAudioRenderer) {
+        RendererController(final boolean enableVideoRenderer, final boolean enableAudioRenderer) {
             this.mEnableV = enableVideoRenderer;
             this.mEnableA = enableAudioRenderer;
         }
         boolean isVideoRendererEnabled() { return mEnableV; }
         boolean isAudioRendererEnabled() { return mEnableA; }
     }
     private RendererController mRendererController = new RendererController(true, true);
 
@@ -117,25 +117,25 @@ public class GeckoHlsPlayer implements B
         public void reset() {
             mNumVideoTracks = 0;
             mNumAudioTracks = 0;
             mVideoInfoUpdated = false;
             mAudioInfoUpdated = false;
             mVideoDataArrived = false;
             mAudioDataArrived = false;
         }
-        public void updateNumOfVideoTracks(int numOfTracks) { mNumVideoTracks = numOfTracks; }
-        public void updateNumOfAudioTracks(int numOfTracks) { mNumAudioTracks = numOfTracks; }
+        public void updateNumOfVideoTracks(final int numOfTracks) { mNumVideoTracks = numOfTracks; }
+        public void updateNumOfAudioTracks(final int numOfTracks) { mNumAudioTracks = numOfTracks; }
         public boolean hasVideo() { return mNumVideoTracks > 0; }
         public boolean hasAudio() { return mNumAudioTracks > 0; }
         public int getNumOfVideoTracks() { return mNumVideoTracks; }
         public int getNumOfAudioTracks() { return mNumAudioTracks; }
         public void onVideoInfoUpdated() { mVideoInfoUpdated = true; }
         public void onAudioInfoUpdated() { mAudioInfoUpdated = true; }
-        public void onDataArrived(int trackType) {
+        public void onDataArrived(final int trackType) {
             if (trackType == C.TRACK_TYPE_VIDEO) {
                 mVideoDataArrived = true;
             } else if (trackType == C.TRACK_TYPE_AUDIO) {
                 mAudioDataArrived = true;
             }
         }
         public boolean videoReady() {
             return !hasVideo() || (mVideoInfoUpdated && mVideoDataArrived);
@@ -147,17 +147,17 @@ public class GeckoHlsPlayer implements B
     private HlsMediaTracksInfo mTracksInfo = new HlsMediaTracksInfo();
 
     private boolean mIsPlayerInitDone = false;
     private boolean mIsDemuxerInitDone = false;
 
     private BaseHlsPlayer.DemuxerCallbacks mDemuxerCallbacks;
     private BaseHlsPlayer.ResourceCallbacks mResourceCallbacks;
 
-    private static void assertTrue(boolean condition) {
+    private static void assertTrue(final boolean condition) {
       if (DEBUG && !condition) {
         throw new AssertionError("Expected condition to be true");
       }
     }
 
     protected void checkInitDone() {
         if (mIsDemuxerInitDone) {
             return;
@@ -224,66 +224,68 @@ public class GeckoHlsPlayer implements B
             }
         }
     }
 
     public final class ComponentListener {
 
         // General purpose implementation
         // Called on GeckoHlsPlayerThread
-        public void onDataArrived(int trackType) {
+        public void onDataArrived(final int trackType) {
             synchronized (GeckoHlsPlayer.this) {
                 if (DEBUG) { Log.d(LOGTAG, "[CB][onDataArrived] id " + mPlayerId); }
                 if (!mIsPlayerInitDone) {
                     return;
                 }
                 mTracksInfo.onDataArrived(trackType);
                 mResourceCallbacks.onDataArrived();
                 checkInitDone();
             }
         }
 
         // Called on GeckoHlsPlayerThread
-        public void onVideoInputFormatChanged(Format format) {
+        public void onVideoInputFormatChanged(final Format format) {
             synchronized (GeckoHlsPlayer.this) {
                 if (DEBUG) {
                     Log.d(LOGTAG, "[CB] onVideoInputFormatChanged [" + format + "]");
                     Log.d(LOGTAG, "[CB] SampleMIMEType [" +
                             format.sampleMimeType + "], ContainerMIMEType [" +
                             format.containerMimeType + "], id : " + mPlayerId);
                 }
                 if (!mIsPlayerInitDone) {
                     return;
                 }
                 mTracksInfo.onVideoInfoUpdated();
                 checkInitDone();
             }
         }
 
         // Called on GeckoHlsPlayerThread
-        public void onAudioInputFormatChanged(Format format) {
+        public void onAudioInputFormatChanged(final Format format) {
             synchronized (GeckoHlsPlayer.this) {
                 if (DEBUG) {
                     Log.d(LOGTAG, "[CB] onAudioInputFormatChanged [" + format + "], mPlayerId :" + mPlayerId);
                 }
                 if (!mIsPlayerInitDone) {
                     return;
                 }
                 mTracksInfo.onAudioInfoUpdated();
                 checkInitDone();
             }
         }
     }
 
-    private DataSource.Factory buildDataSourceFactory(Context ctx, DefaultBandwidthMeter bandwidthMeter) {
+    private DataSource.Factory buildDataSourceFactory(final Context ctx,
+                                                      final DefaultBandwidthMeter bandwidthMeter) {
         return new DefaultDataSourceFactory(ctx, bandwidthMeter,
                 buildHttpDataSourceFactory(bandwidthMeter));
     }
 
-    private HttpDataSource.Factory buildHttpDataSourceFactory(DefaultBandwidthMeter bandwidthMeter) {
+    private HttpDataSource.Factory buildHttpDataSourceFactory(
+            final DefaultBandwidthMeter bandwidthMeter) {
         return new DefaultHttpDataSourceFactory(
             BuildConfig.USER_AGENT_GECKOVIEW_MOBILE,
             bandwidthMeter /* listener */,
             DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS,
             DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS,
             true /* allowCrossProtocolRedirects */
         );
     }
@@ -311,76 +313,78 @@ public class GeckoHlsPlayer implements B
     // Called on Gecko's main thread
     @Override
     public int getId() {
         return mPlayerId;
     }
 
     // Called on Gecko's main thread
     @Override
-    public synchronized void addDemuxerWrapperCallbackListener(BaseHlsPlayer.DemuxerCallbacks callback) {
+    public synchronized void addDemuxerWrapperCallbackListener(
+            final BaseHlsPlayer.DemuxerCallbacks callback) {
         if (DEBUG) { Log.d(LOGTAG, " addDemuxerWrapperCallbackListener ..."); }
         mDemuxerCallbacks = callback;
     }
 
     // Called on GeckoHlsPlayerThread from ExoPlayer
     @Override
-    public synchronized void onLoadingChanged(boolean isLoading) {
+    public synchronized void onLoadingChanged(final boolean isLoading) {
         if (DEBUG) { Log.d(LOGTAG, "loading [" + isLoading + "]"); }
         if (!isLoading) {
             if (mMediaDecoderPlayState != MediaDecoderPlayState.PLAY_STATE_PLAYING) {
                 suspendExoplayer();
             }
             // To update buffered position.
             mComponentEventDispatcher.onDataArrived(C.TRACK_TYPE_DEFAULT);
         }
     }
 
     // Called on GeckoHlsPlayerThread from ExoPlayer
     @Override
-    public synchronized void onPlayerStateChanged(boolean playWhenReady, int state) {
+    public synchronized void onPlayerStateChanged(final boolean playWhenReady, final int state) {
         if (DEBUG) { Log.d(LOGTAG, "state [" + playWhenReady + ", " + getStateString(state) + "]"); }
         if (state == ExoPlayer.STATE_READY &&
             !mExoplayerSuspended &&
             mMediaDecoderPlayState == MediaDecoderPlayState.PLAY_STATE_PLAYING) {
             resumeExoplayer();
         }
     }
 
     // Called on GeckoHlsPlayerThread from ExoPlayer
     @Override
     public void onPositionDiscontinuity() {
         if (DEBUG) { Log.d(LOGTAG, "positionDiscontinuity"); }
     }
 
     // Called on GeckoHlsPlayerThread from ExoPlayer
     @Override
-    public void onPlaybackParametersChanged(PlaybackParameters playbackParameters) {
+    public void onPlaybackParametersChanged(final PlaybackParameters playbackParameters) {
         if (DEBUG) {
             Log.d(LOGTAG, "playbackParameters " +
                   String.format("[speed=%.2f, pitch=%.2f]", playbackParameters.speed, playbackParameters.pitch));
         }
     }
 
     // Called on GeckoHlsPlayerThread from ExoPlayer
     @Override
-    public synchronized void onPlayerError(ExoPlaybackException e) {
+    public synchronized void onPlayerError(final ExoPlaybackException e) {
         if (DEBUG) { Log.e(LOGTAG, "playerFailed" , e); }
         mIsPlayerInitDone = false;
         if (mResourceCallbacks != null) {
             mResourceCallbacks.onError(ResourceError.PLAYER.code());
         }
         if (mDemuxerCallbacks != null) {
             mDemuxerCallbacks.onError(DemuxerError.PLAYER.code());
         }
     }
 
     // Called on GeckoHlsPlayerThread from ExoPlayer
     @Override
-    public synchronized void onTracksChanged(TrackGroupArray ignored, TrackSelectionArray trackSelections) {
+    public synchronized void onTracksChanged(final TrackGroupArray ignored,
+                                             final TrackSelectionArray trackSelections) {
         if (DEBUG) {
             Log.d(LOGTAG, "onTracksChanged : TGA[" + ignored +
                           "], TSA[" + trackSelections + "]");
 
             MappedTrackInfo mappedTrackInfo = mTrackSelector.getCurrentMappedTrackInfo();
             if (mappedTrackInfo == null) {
                 Log.d(LOGTAG, "Tracks []");
                 return;
@@ -450,17 +454,17 @@ public class GeckoHlsPlayer implements B
             }
         }
         mTracksInfo.updateNumOfVideoTracks(numVideoTracks);
         mTracksInfo.updateNumOfAudioTracks(numAudioTracks);
     }
 
     // Called on GeckoHlsPlayerThread from ExoPlayer
     @Override
-    public synchronized void onTimelineChanged(Timeline timeline, Object manifest) {
+    public synchronized void onTimelineChanged(final Timeline timeline, final Object manifest) {
         // For now, we use the interface ExoPlayer.getDuration() for gecko,
         // so here we create local variable 'window' & 'peroid' to obtain
         // the dynamic duration.
         // See. http://google.github.io/ExoPlayer/doc/reference/com/google/android/exoplayer2/Timeline.html
         // for further information.
         Timeline.Window window = new Timeline.Window();
         mIsTimelineStatic = !timeline.isEmpty()
                 && !timeline.getWindow(timeline.getWindowCount() - 1, window).isDynamic;
@@ -485,69 +489,70 @@ public class GeckoHlsPlayer implements B
         // with the one calculated from multi-timelines/windows.
         if (DEBUG) {
             Log.d(LOGTAG, "Media duration (from Timeline) = " + mDurationUs +
                           "(us)" + " player.getDuration() = " + mPlayer.getDuration() +
                           "(ms)");
         }
     }
 
-    private static String getStateString(int state) {
+    private static String getStateString(final int state) {
         switch (state) {
             case ExoPlayer.STATE_BUFFERING:
                 return "B";
             case ExoPlayer.STATE_ENDED:
                 return "E";
             case ExoPlayer.STATE_IDLE:
                 return "I";
             case ExoPlayer.STATE_READY:
                 return "R";
             default:
                 return "?";
         }
     }
 
-    private static String getFormatSupportString(int formatSupport) {
+    private static String getFormatSupportString(final int formatSupport) {
         switch (formatSupport) {
           case RendererCapabilities.FORMAT_HANDLED:
             return "YES";
           case RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES:
             return "NO_EXCEEDS_CAPABILITIES";
           case RendererCapabilities.FORMAT_UNSUPPORTED_SUBTYPE:
             return "NO_UNSUPPORTED_TYPE";
           case RendererCapabilities.FORMAT_UNSUPPORTED_TYPE:
             return "NO";
           default:
             return "?";
         }
       }
 
-    private static String getAdaptiveSupportString(int trackCount, int adaptiveSupport) {
+    private static String getAdaptiveSupportString(final int trackCount,
+                                                   final int adaptiveSupport) {
         if (trackCount < 2) {
           return "N/A";
         }
         switch (adaptiveSupport) {
           case RendererCapabilities.ADAPTIVE_SEAMLESS:
             return "YES";
           case RendererCapabilities.ADAPTIVE_NOT_SEAMLESS:
             return "YES_NOT_SEAMLESS";
           case RendererCapabilities.ADAPTIVE_NOT_SUPPORTED:
             return "NO";
           default:
             return "?";
         }
       }
 
-      private static String getTrackStatusString(TrackSelection selection, TrackGroup group,
-                                                 int trackIndex) {
+      private static String getTrackStatusString(final TrackSelection selection,
+                                                 final TrackGroup group, final int trackIndex) {
         return getTrackStatusString(selection != null && selection.getTrackGroup() == group
                 && selection.indexOf(trackIndex) != C.INDEX_UNSET);
       }
 
-      private static String getTrackStatusString(boolean enabled) {
+      private static String getTrackStatusString(final boolean enabled) {
         return enabled ? "[X]" : "[ ]";
       }
 
     // Called on GeckoHlsPlayerThread
     private synchronized void createExoPlayer(final String url) {
         Context ctx = GeckoAppShell.getApplicationContext();
         mComponentListener = new ComponentListener();
         mComponentEventDispatcher = new ComponentEventDispatcher();
@@ -587,17 +592,18 @@ public class GeckoHlsPlayer implements B
         mPlayer.prepare(mMediaSource);
         mIsPlayerInitDone = true;
     }
     // =======================================================================
     // API for GeckoHLSResourceWrapper
     // =======================================================================
     // Called on Gecko Main Thread
     @Override
-    public synchronized void init(final String url, BaseHlsPlayer.ResourceCallbacks callback) {
+    public synchronized void init(final String url,
+                                  final BaseHlsPlayer.ResourceCallbacks callback) {
         if (DEBUG) { Log.d(LOGTAG, " init"); }
         assertTrue(callback != null);
         assertTrue(!mIsPlayerInitDone);
 
         mResourceCallbacks = callback;
         mThread = new HandlerThread("GeckoHlsPlayerThread");
         mThread.start();
         mMainHandler = new Handler(mThread.getLooper());
@@ -615,18 +621,18 @@ public class GeckoHlsPlayer implements B
     public boolean isLiveStream() {
         return !mIsTimelineStatic;
     }
     // =======================================================================
     // API for GeckoHLSDemuxerWrapper
     // =======================================================================
     // Called on HLSDemuxer's TaskQueue
     @Override
-    public synchronized ConcurrentLinkedQueue<GeckoHLSSample> getSamples(TrackType trackType,
-                                                            int number) {
+    public synchronized ConcurrentLinkedQueue<GeckoHLSSample> getSamples(
+            final TrackType trackType, final int number) {
         if (trackType == TrackType.VIDEO) {
             return mVRenderer != null ? mVRenderer.getQueuedSamples(number) :
                                         new ConcurrentLinkedQueue<GeckoHLSSample>();
         } else if (trackType == TrackType.AUDIO) {
             return mARenderer != null ? mARenderer.getQueuedSamples(number) :
                                         new ConcurrentLinkedQueue<GeckoHLSSample>();
         } else {
             return new ConcurrentLinkedQueue<GeckoHLSSample>();
@@ -639,29 +645,29 @@ public class GeckoHlsPlayer implements B
         // Value returned by getBufferedPosition() is in milliseconds.
         long bufferedPos = mPlayer == null ? 0L : Math.max(0L, mPlayer.getBufferedPosition() * 1000L);
         if (DEBUG) { Log.d(LOGTAG, "getBufferedPosition : " + bufferedPos + "(Us)"); }
         return bufferedPos;
     }
 
     // Called on MFR's TaskQueue
     @Override
-    public synchronized int getNumberOfTracks(TrackType trackType) {
+    public synchronized int getNumberOfTracks(final TrackType trackType) {
         if (DEBUG) { Log.d(LOGTAG, "getNumberOfTracks : type " + trackType); }
         if (trackType == TrackType.VIDEO) {
             return mTracksInfo.getNumOfVideoTracks();
         } else if (trackType == TrackType.AUDIO) {
             return mTracksInfo.getNumOfAudioTracks();
         }
         return 0;
     }
 
     // Called on MFR's TaskQueue
     @Override
-    public synchronized GeckoVideoInfo getVideoInfo(int index) {
+    public synchronized GeckoVideoInfo getVideoInfo(final int index) {
         if (DEBUG) { Log.d(LOGTAG, "getVideoInfo"); }
         assertTrue(mVRenderer != null);
         if (!mTracksInfo.hasVideo()) {
             return null;
         }
         Format fmt = mVRenderer.getFormat(index);
         if (fmt == null) {
             return null;
@@ -671,17 +677,17 @@ public class GeckoHlsPlayer implements B
                                                   fmt.rotationDegrees, fmt.stereoMode,
                                                   getDuration(), fmt.sampleMimeType,
                                                   null, null);
         return vInfo;
     }
 
     // Called on MFR's TaskQueue
     @Override
-    public synchronized GeckoAudioInfo getAudioInfo(int index) {
+    public synchronized GeckoAudioInfo getAudioInfo(final int index) {
         if (DEBUG) { Log.d(LOGTAG, "getAudioInfo"); }
         assertTrue(mARenderer != null);
         if (!mTracksInfo.hasAudio()) {
             return null;
         }
         Format fmt = mARenderer.getFormat(index);
         if (fmt == null) {
             return null;
@@ -699,17 +705,17 @@ public class GeckoHlsPlayer implements B
         GeckoAudioInfo aInfo = new GeckoAudioInfo(fmt.sampleRate, fmt.channelCount,
                                                   16, 0, getDuration(),
                                                   fmt.sampleMimeType, csd);
         return aInfo;
     }
 
     // Called on HLSDemuxer's TaskQueue
     @Override
-    public synchronized boolean seek(long positionUs) {
+    public synchronized boolean seek(final long positionUs) {
         if (mPlayer == null) {
             Log.d(LOGTAG, "Seek operation won't be performed as no player exists!");
             return false;
         }
 
         // Need to temporarily resume Exoplayer to download the chunks for getting the demuxed
         // keyframe sample when HTMLMediaElement is paused. Suspend Exoplayer when collecting enough
         // samples in onLoadingChanged.
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsRendererBase.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsRendererBase.java
@@ -50,23 +50,24 @@ public abstract class GeckoHlsRendererBa
     protected abstract void resetRenderer();
     protected abstract boolean clearInputSamplesQueue();
     protected abstract void notifyPlayerInputFormatChanged(Format newFormat);
 
     private DecoderInputBuffer mBufferForRead =
         new DecoderInputBuffer(DecoderInputBuffer.BUFFER_REPLACEMENT_MODE_NORMAL);
     private final DecoderInputBuffer mflagsOnlyBuffer = DecoderInputBuffer.newFlagsOnlyInstance();
 
-    protected void assertTrue(boolean condition) {
+    protected void assertTrue(final boolean condition) {
         if (DEBUG && !condition) {
             throw new AssertionError("Expected condition to be true");
         }
     }
 
-    public GeckoHlsRendererBase(int trackType, GeckoHlsPlayer.ComponentEventDispatcher eventDispatcher) {
+    public GeckoHlsRendererBase(final int trackType,
+                                final GeckoHlsPlayer.ComponentEventDispatcher eventDispatcher) {
         super(trackType);
         mPlayerEventDispatcher = eventDispatcher;
     }
 
     private boolean isQueuedEnoughData() {
         if (mDemuxedInputSamples.isEmpty()) {
             return false;
         }
@@ -80,26 +81,26 @@ public abstract class GeckoHlsRendererBa
         long lastPTS = firstPTS;
         while (iter.hasNext()) {
             GeckoHLSSample sample = iter.next();
             lastPTS = sample.info.presentationTimeUs;
         }
         return Math.abs(lastPTS - firstPTS) > QUEUED_INPUT_SAMPLE_DURATION_THRESHOLD;
     }
 
-    public Format getFormat(int index) {
+    public Format getFormat(final int index) {
         assertTrue(index >= 0);
         Format fmt = index < mFormats.size() ? mFormats.get(index) : null;
         if (DEBUG) { Log.d(LOGTAG, "getFormat : index = " + index + ", format : " + fmt); }
         return fmt;
     }
 
     public synchronized long getFirstSamplePTS() { return mFirstSampleStartTime; }
 
-    public synchronized ConcurrentLinkedQueue<GeckoHLSSample> getQueuedSamples(int number) {
+    public synchronized ConcurrentLinkedQueue<GeckoHLSSample> getQueuedSamples(final int number) {
         ConcurrentLinkedQueue<GeckoHLSSample> samples =
             new ConcurrentLinkedQueue<GeckoHLSSample>();
 
         GeckoHLSSample sample = null;
         int queuedSize = mDemuxedInputSamples.size();
         for (int i = 0; i < queuedSize; i++) {
             if (i >= number) {
                 break;
@@ -114,44 +115,44 @@ public abstract class GeckoHlsRendererBa
             mWaitingForData = true;
         } else if (mFirstSampleStartTime == Long.MIN_VALUE) {
             mFirstSampleStartTime = sample.info.presentationTimeUs;
             if (DEBUG) { Log.d(LOGTAG, "mFirstSampleStartTime = " + mFirstSampleStartTime); }
         }
         return samples;
     }
 
-    protected void handleDrmInitChanged(Format oldFormat, Format newFormat) {
+    protected void handleDrmInitChanged(final Format oldFormat, final Format newFormat) {
         Object oldDrmInit = oldFormat == null ? null : oldFormat.drmInitData;
         Object newDrnInit = newFormat.drmInitData;
 
         // TODO: Notify MFR if the content is encrypted or not.
         if (newDrnInit != oldDrmInit) {
             if (newDrnInit != null) {
             } else {
             }
         }
     }
 
-    protected boolean canReconfigure(Format oldFormat, Format newFormat) {
+    protected boolean canReconfigure(final Format oldFormat, final Format newFormat) {
         // Referring to ExoPlayer's MediaCodecBaseRenderer, the default is set
         // to false. Only override it in video renderer subclass.
         return false;
     }
 
     protected void prepareReconfiguration() {
         // Referring to ExoPlayer's MediaCodec related renderers, only video
         // renderer handles this.
     }
 
-    protected void updateCSDInfo(Format format) {
+    protected void updateCSDInfo(final Format format) {
         // do nothing.
     }
 
-    protected void onInputFormatChanged(Format newFormat) throws ExoPlaybackException {
+    protected void onInputFormatChanged(final Format newFormat) throws ExoPlaybackException {
         Format oldFormat;
         try {
             oldFormat = mFormats.get(mFormats.size() - 1);
         } catch (IndexOutOfBoundsException e) {
             oldFormat = null;
         }
         if (DEBUG) {
             Log.d(LOGTAG, "[onInputFormatChanged] old : " + oldFormat +
@@ -253,17 +254,17 @@ public abstract class GeckoHlsRendererBa
         mflagsOnlyBuffer.clear();
         int result = readSource(mFormatHolder, mflagsOnlyBuffer, true);
         if (result == C.RESULT_FORMAT_READ) {
             onInputFormatChanged(mFormatHolder.format);
         }
     }
 
     @Override
-    protected void onEnabled(boolean joining) {
+    protected void onEnabled(final boolean joining) {
         // Do nothing.
     }
 
     @Override
     protected void onDisabled() {
         mFormats.clear();
         resetRenderer();
     }
@@ -274,31 +275,32 @@ public abstract class GeckoHlsRendererBa
     }
 
     @Override
     public boolean isEnded() {
         return mInputStreamEnded;
     }
 
     @Override
-    protected synchronized void onPositionReset(long positionUs, boolean joining) {
+    protected synchronized void onPositionReset(final long positionUs, final boolean joining) {
         if (DEBUG) { Log.d(LOGTAG, "onPositionReset : positionUs = " + positionUs); }
         mInputStreamEnded = false;
         if (mInitialized) {
             clearInputSamplesQueue();
         }
     }
 
     /*
      * This is called by ExoPlayerImplInternal.java.
      * ExoPlayer checks the status of renderer, i.e. isReady() / isEnded(), and
      * calls renderer.render by passing its wall clock time.
      */
     @Override
-    public void render(long positionUs, long elapsedRealtimeUs) throws ExoPlaybackException {
+    public void render(final long positionUs, final long elapsedRealtimeUs)
+            throws ExoPlaybackException {
         if (BuildConfig.DEBUG_BUILD) {
             Log.d(LOGTAG, "positionUs = " + positionUs +
                           ", mInputStreamEnded = " + mInputStreamEnded);
         }
         if (mInputStreamEnded) {
             return;
         }
         if (mFormats.size() == 0) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsVideoRenderer.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoHlsVideoRenderer.java
@@ -48,30 +48,30 @@ public class GeckoHlsVideoRenderer exten
     private ConcurrentLinkedQueue<GeckoHLSSample> mDemuxedNoDurationSamples =
         new ConcurrentLinkedQueue<>();
 
     // Contain CSD-0(SPS)/CSD-1(PPS) information (in AnnexB format) for
     // prepending each keyframe. When video format changes, this information
     // changes accordingly.
     private byte[] mCSDInfo = null;
 
-    public GeckoHlsVideoRenderer(GeckoHlsPlayer.ComponentEventDispatcher eventDispatcher) {
+    public GeckoHlsVideoRenderer(final GeckoHlsPlayer.ComponentEventDispatcher eventDispatcher) {
         super(C.TRACK_TYPE_VIDEO, eventDispatcher);
         assertTrue(Build.VERSION.SDK_INT >= 16);
         LOGTAG = getClass().getSimpleName();
         DEBUG = !BuildConfig.MOZILLA_OFFICIAL;
     }
 
     @Override
     public final int supportsMixedMimeTypeAdaptation() {
         return ADAPTIVE_NOT_SEAMLESS;
     }
 
     @Override
-    public final int supportsFormat(Format format) {
+    public final int supportsFormat(final Format format) {
         /*
          * FORMAT_EXCEEDS_CAPABILITIES : The Renderer is capable of rendering
          *                               formats with the same mime type, but
          *                               the properties of the format exceed
          *                               the renderer's capability.
          * FORMAT_UNSUPPORTED_SUBTYPE : The Renderer is a general purpose
          *                              renderer for formats of the same
          *                              top-level type, but is not capable of
@@ -161,17 +161,17 @@ public class GeckoHlsVideoRenderer exten
             mRendererReconfigurationState = RECONFIGURATION_STATE.NONE;
             mInputBuffer = null;
             mCSDInfo = null;
             mInitialized = false;
         }
     }
 
     @Override
-    protected void handleReconfiguration(DecoderInputBuffer bufferForRead) {
+    protected void handleReconfiguration(final DecoderInputBuffer bufferForRead) {
         // For adaptive reconfiguration OMX decoders expect all reconfiguration
         // data to be supplied at the start of the buffer that also contains
         // the first frame in the new format.
         assertTrue(mFormats.size() > 0);
         if (mRendererReconfigurationState == RECONFIGURATION_STATE.WRITE_PENDING) {
             if (bufferForRead.data == null) {
                 if (DEBUG) { Log.d(LOGTAG, "[feedInput][WRITE_PENDING] bufferForRead.data is not initialized."); }
                 return;
@@ -182,44 +182,45 @@ public class GeckoHlsVideoRenderer exten
                 byte[] data = currentFormat.initializationData.get(i);
                 bufferForRead.data.put(data);
             }
             mRendererReconfigurationState = RECONFIGURATION_STATE.QUEUE_PENDING;
         }
     }
 
     @Override
-    protected void handleFormatRead(DecoderInputBuffer bufferForRead) throws ExoPlaybackException {
+    protected void handleFormatRead(final DecoderInputBuffer bufferForRead)
+            throws ExoPlaybackException {
         if (mRendererReconfigurationState == RECONFIGURATION_STATE.QUEUE_PENDING) {
             if (DEBUG) { Log.d(LOGTAG, "[feedInput][QUEUE_PENDING] 2 formats in a row."); }
             // We received two formats in a row. Clear the current buffer of any reconfiguration data
             // associated with the first format.
             bufferForRead.clear();
             mRendererReconfigurationState = RECONFIGURATION_STATE.WRITE_PENDING;
         }
         onInputFormatChanged(mFormatHolder.format);
     }
 
     @Override
-    protected void handleEndOfStream(DecoderInputBuffer bufferForRead) {
+    protected void handleEndOfStream(final DecoderInputBuffer bufferForRead) {
         if (mRendererReconfigurationState == RECONFIGURATION_STATE.QUEUE_PENDING) {
             if (DEBUG) { Log.d(LOGTAG, "[feedInput][QUEUE_PENDING] isEndOfStream."); }
             // We received a new format immediately before the end of the stream. We need to clear
             // the corresponding reconfiguration data from the current buffer, but re-write it into
             // a subsequent buffer if there are any (e.g. if the user seeks backwards).
             bufferForRead.clear();
             mRendererReconfigurationState = RECONFIGURATION_STATE.WRITE_PENDING;
         }
         mInputStreamEnded = true;
         GeckoHLSSample sample = GeckoHLSSample.EOS;
         calculatDuration(sample);
     }
 
     @Override
-    protected void handleSamplePreparation(DecoderInputBuffer bufferForRead) {
+    protected void handleSamplePreparation(final DecoderInputBuffer bufferForRead) {
         int csdInfoSize = mCSDInfo != null ? mCSDInfo.length : 0;
         int dataSize = bufferForRead.data.limit();
         int size = bufferForRead.isKeyFrame() ? csdInfoSize + dataSize : dataSize;
         byte[] realData = new byte[size];
         if (bufferForRead.isKeyFrame()) {
             // Prepend the CSD information to the sample if it's a key frame.
             System.arraycopy(mCSDInfo, 0, realData, 0, csdInfoSize);
             bufferForRead.data.get(realData, csdInfoSize, dataSize);
@@ -248,17 +249,17 @@ public class GeckoHlsVideoRenderer exten
 
         // There's no duration information from the ExoPlayer's sample, we need
         // to calculate it.
         calculatDuration(sample);
         mRendererReconfigurationState = RECONFIGURATION_STATE.NONE;
     }
 
     @Override
-    protected void onPositionReset(long positionUs, boolean joining) {
+    protected void onPositionReset(final long positionUs, final boolean joining) {
         super.onPositionReset(positionUs, joining);
         if (mInitialized && mRendererReconfigured && mFormats.size() != 0) {
             if (DEBUG) { Log.d(LOGTAG, "[onPositionReset] WRITE_PENDING"); }
             // Any reconfiguration data that we put shortly before the reset
             // may be invalid. We avoid this issue by sending reconfiguration
             // data following every position reset.
             mRendererReconfigurationState = RECONFIGURATION_STATE.WRITE_PENDING;
         }
@@ -268,69 +269,69 @@ public class GeckoHlsVideoRenderer exten
     protected boolean clearInputSamplesQueue() {
         if (DEBUG) { Log.d(LOGTAG, "clearInputSamplesQueue"); }
         mDemuxedInputSamples.clear();
         mDemuxedNoDurationSamples.clear();
         return true;
     }
 
     @Override
-    protected boolean canReconfigure(Format oldFormat, Format newFormat) {
+    protected boolean canReconfigure(final Format oldFormat, final Format newFormat) {
         boolean canReconfig = areAdaptationCompatible(oldFormat, newFormat)
           && newFormat.width <= mCodecMaxValues.width && newFormat.height <= mCodecMaxValues.height
           && newFormat.maxInputSize <= mCodecMaxValues.inputSize;
         if (DEBUG) { Log.d(LOGTAG, "[canReconfigure] : " + canReconfig); }
         return canReconfig;
     }
 
     @Override
     protected void prepareReconfiguration() {
         if (DEBUG) { Log.d(LOGTAG, "[onInputFormatChanged] starting reconfiguration !"); }
         mRendererReconfigured = true;
         mRendererReconfigurationState = RECONFIGURATION_STATE.WRITE_PENDING;
     }
 
     @Override
-    protected void updateCSDInfo(Format format) {
+    protected void updateCSDInfo(final Format format) {
         int size = 0;
         for (int i = 0; i < format.initializationData.size(); i++) {
             size += format.initializationData.get(i).length;
         }
         int startPos = 0;
         mCSDInfo = new byte[size];
         for (int i = 0; i < format.initializationData.size(); i++) {
             byte[] data = format.initializationData.get(i);
             System.arraycopy(data, 0, mCSDInfo, startPos, data.length);
             startPos += data.length;
         }
         if (DEBUG) { Log.d(LOGTAG, "mCSDInfo [" + Utils.bytesToHex(mCSDInfo) + "]"); }
     }
 
     @Override
-    protected void notifyPlayerInputFormatChanged(Format newFormat) {
+    protected void notifyPlayerInputFormatChanged(final Format newFormat) {
         mPlayerEventDispatcher.onVideoInputFormatChanged(newFormat);
     }
 
-    private void calculateSamplesWithin(GeckoHLSSample[] samples, int range) {
+    private void calculateSamplesWithin(final GeckoHLSSample[] samples, final int range) {
         // Calculate the first 'range' elements.
         for (int i = 0; i < range; i++) {
             // Comparing among samples in the window.
             for (int j = -2; j < 14; j++) {
                 if (i + j >= 0 &&
                     i + j < range &&
                     samples[i + j].info.presentationTimeUs > samples[i].info.presentationTimeUs) {
                     samples[i].duration =
                         Math.min(samples[i].duration,
                                  samples[i + j].info.presentationTimeUs - samples[i].info.presentationTimeUs);
                 }
             }
         }
     }
 
-    private void calculatDuration(GeckoHLSSample inputSample) {
+    private void calculatDuration(final GeckoHLSSample inputSample) {
         /*
          * NOTE :
          * Since we customized renderer as a demuxer. Here we're not able to
          * obtain duration from the DecoderInputBuffer as there's no duration inside.
          * So we calcualte it by referring to nearby samples' timestamp.
          * A temporary queue |mDemuxedNoDurationSamples| is used to queue demuxed
          * samples from HlsMediaSource which have no duration information at first.
          * We're choosing 16 as the comparing window size, because it's commonly
@@ -400,35 +401,36 @@ public class GeckoHlsVideoRenderer exten
                 nextKeyFrameTime = sample.info.presentationTimeUs;
                 break;
             }
         }
         return nextKeyFrameTime;
     }
 
     @Override
-    protected void onStreamChanged(Format[] formats) {
+    protected void onStreamChanged(final Format[] formats) {
         mStreamFormats = formats;
     }
 
-    private static CodecMaxValues getCodecMaxValues(Format format, Format[] streamFormats) {
+    private static CodecMaxValues getCodecMaxValues(final Format format,
+                                                    final Format[] streamFormats) {
         int maxWidth = format.width;
         int maxHeight = format.height;
         int maxInputSize = getMaxInputSize(format);
         for (Format streamFormat : streamFormats) {
             if (areAdaptationCompatible(format, streamFormat)) {
                 maxWidth = Math.max(maxWidth, streamFormat.width);
                 maxHeight = Math.max(maxHeight, streamFormat.height);
                 maxInputSize = Math.max(maxInputSize, getMaxInputSize(streamFormat));
             }
         }
         return new CodecMaxValues(maxWidth, maxHeight, maxInputSize);
     }
 
-    private static int getMaxInputSize(Format format) {
+    private static int getMaxInputSize(final Format format) {
         if (format.maxInputSize != Format.NO_VALUE) {
             // The format defines an explicit maximum input size.
             return format.maxInputSize;
         }
 
         if (format.width == Format.NO_VALUE || format.height == Format.NO_VALUE) {
             // We can't infer a maximum input size without video dimensions.
             return Format.NO_VALUE;
@@ -446,28 +448,28 @@ public class GeckoHlsVideoRenderer exten
             default:
                 // Leave the default max input size.
                 return Format.NO_VALUE;
         }
         // Estimate the maximum input size assuming three channel 4:2:0 subsampled input frames.
         return (maxPixels * 3) / (2 * minCompressionRatio);
     }
 
-    private static boolean areAdaptationCompatible(Format first, Format second) {
+    private static boolean areAdaptationCompatible(final Format first, final Format second) {
         return first.sampleMimeType.equals(second.sampleMimeType) &&
                getRotationDegrees(first) == getRotationDegrees(second);
     }
 
-    private static int getRotationDegrees(Format format) {
+    private static int getRotationDegrees(final Format format) {
         return format.rotationDegrees == Format.NO_VALUE ? 0 : format.rotationDegrees;
     }
 
     private static final class CodecMaxValues {
         public final int width;
         public final int height;
         public final int inputSize;
-        public CodecMaxValues(int width, int height, int inputSize) {
+        public CodecMaxValues(final int width, final int height, final int inputSize) {
             this.width = width;
             this.height = height;
             this.inputSize = inputSize;
         }
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV21.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV21.java
@@ -69,33 +69,33 @@ public class GeckoMediaDrmBridgeV21 impl
 
     // Store session data while provisioning
     private static class PendingCreateSessionData {
         public final int mToken;
         public final int mPromiseId;
         public final byte[] mInitData;
         public final String mMimeType;
 
-        private PendingCreateSessionData(int token, int promiseId,
-                                         byte[] initData, String mimeType) {
+        private PendingCreateSessionData(final int token, final int promiseId,
+                                         final byte[] initData, final String mimeType) {
             mToken = token;
             mPromiseId = promiseId;
             mInitData = initData;
             mMimeType = mimeType;
         }
     }
 
-    public boolean isSecureDecoderComonentRequired(String mimeType) {
+    public boolean isSecureDecoderComonentRequired(final String mimeType) {
         if (mCrypto != null) {
             return mCrypto.requiresSecureDecoderComponent(mimeType);
         }
         return false;
       }
 
-    private static void assertTrue(boolean condition) {
+    private static void assertTrue(final boolean condition) {
       if (DEBUG && !condition) {
         throw new AssertionError("Expected condition to be true");
       }
     }
 
     @SuppressLint("WrongConstant")
     private void configureVendorSpecificProperty() {
         assertTrue(mDrm != null);
@@ -105,17 +105,17 @@ public class GeckoMediaDrmBridgeV21 impl
         // Support L3 for now
         mDrm.setPropertyString("securityLevel", "L3");
         // Refer to chromium, set multi-session mode for Widevine.
         if (mSchemeUUID.equals(WIDEVINE_SCHEME_UUID)) {
             mDrm.setPropertyString("sessionSharing", "enable");
         }
     }
 
-    GeckoMediaDrmBridgeV21(String keySystem) throws Exception {
+    GeckoMediaDrmBridgeV21(final String keySystem) throws Exception {
         LOGTAG = getClass().getSimpleName();
         if (DEBUG) Log.d(LOGTAG, "GeckoMediaDrmBridgeV21 ctor");
 
         mProvisioningPromiseId = 0;
         mSessionIds = new HashSet<ByteBuffer>();
         mSessionMIMETypes = new HashMap<ByteBuffer, String>();
         mPendingCreateSessionDataQueue = new ArrayDeque<PendingCreateSessionData>();
 
@@ -136,26 +136,26 @@ public class GeckoMediaDrmBridgeV21 impl
         } catch (android.media.NotProvisionedException e) {
             if (DEBUG) Log.d(LOGTAG, "Device not provisioned:" + e.getMessage());
             startProvisioning(MAX_PROMISE_ID);
         }
 
     }
 
     @Override
-    public void setCallbacks(GeckoMediaDrm.Callbacks callbacks) {
+    public void setCallbacks(final GeckoMediaDrm.Callbacks callbacks) {
         assertTrue(callbacks != null);
         mCallbacks = callbacks;
     }
 
     @Override
-    public void createSession(int createSessionToken,
-                              int promiseId,
-                              String initDataType,
-                              byte[] initData) {
+    public void createSession(final int createSessionToken,
+                              final int promiseId,
+                              final String initDataType,
+                              final byte[] initData) {
         if (DEBUG) Log.d(LOGTAG, "createSession()");
         if (mDrm == null) {
             onRejectPromise(promiseId, "MediaDrm instance doesn't exist !!");
             return;
         }
 
         if (mProvisioningPromiseId > 0 && mCrypto == null) {
             if (DEBUG) Log.d(LOGTAG, "Pending createSession because it's provisioning !");
@@ -204,19 +204,19 @@ public class GeckoMediaDrmBridgeV21 impl
             }
             savePendingCreateSessionData(createSessionToken, promiseId,
                                          initData, initDataType);
             startProvisioning(promiseId);
         }
     }
 
     @Override
-    public void updateSession(int promiseId,
-                              String sessionId,
-                              byte[] response) {
+    public void updateSession(final int promiseId,
+                              final String sessionId,
+                              final byte[] response) {
         if (DEBUG) Log.d(LOGTAG, "updateSession(), sessionId = " + sessionId);
         if (mDrm == null) {
             onRejectPromise(promiseId, "MediaDrm instance doesn't exist !!");
             return;
         }
 
         ByteBuffer session = ByteBuffer.wrap(sessionId.getBytes(StringUtils.UTF_8));
         if (!sessionExists(session)) {
@@ -241,17 +241,17 @@ public class GeckoMediaDrmBridgeV21 impl
             onSessionError(session.array(), "Got exception during updateSession.");
             onRejectPromise(promiseId, "Got exception during updateSession.");
         }
         release();
         return;
     }
 
     @Override
-    public void closeSession(int promiseId, String sessionId) {
+    public void closeSession(final int promiseId, final String sessionId) {
         if (DEBUG) Log.d(LOGTAG, "closeSession()");
         if (mDrm == null) {
             onRejectPromise(promiseId, "MediaDrm instance doesn't exist !!");
             return;
         }
 
         ByteBuffer session = ByteBuffer.wrap(sessionId.getBytes(StringUtils.UTF_8));
         mSessionIds.remove(session);
@@ -310,83 +310,83 @@ public class GeckoMediaDrmBridgeV21 impl
         if (DEBUG) Log.d(LOGTAG, "setServerCertificate()");
         if (mDrm == null) {
             throw new IllegalStateException("MediaDrm instance doesn't exist !!");
         }
         mDrm.setPropertyByteArray("serviceCertificate", cert);
         return;
     }
 
-    protected void HandleKeyStatusChangeByDummyKey(String sessionId)
+    protected void HandleKeyStatusChangeByDummyKey(final String sessionId)
     {
         SessionKeyInfo[] keyInfos = new SessionKeyInfo[1];
         keyInfos[0] = new SessionKeyInfo(DUMMY_KEY_ID,
                                          MediaDrm.KeyStatus.STATUS_USABLE);
         onSessionBatchedKeyChanged(sessionId.getBytes(), keyInfos);
         if (DEBUG) Log.d(LOGTAG, "Key successfully added for session " + sessionId);
     }
 
-    protected void onSessionCreated(int createSessionToken,
-                                    int promiseId,
-                                    byte[] sessionId,
-                                    byte[] request) {
+    protected void onSessionCreated(final int createSessionToken,
+                                    final int promiseId,
+                                    final byte[] sessionId,
+                                    final byte[] request) {
         assertTrue(mCallbacks != null);
         if (mCallbacks != null) {
             mCallbacks.onSessionCreated(createSessionToken, promiseId, sessionId, request);
         }
     }
 
-    protected void onSessionUpdated(int promiseId, byte[] sessionId) {
+    protected void onSessionUpdated(final int promiseId, final byte[] sessionId) {
         assertTrue(mCallbacks != null);
         if (mCallbacks != null) {
             mCallbacks.onSessionUpdated(promiseId, sessionId);
         }
     }
 
-    protected void onSessionClosed(int promiseId, byte[] sessionId) {
+    protected void onSessionClosed(final int promiseId, final byte[] sessionId) {
         assertTrue(mCallbacks != null);
         if (mCallbacks != null) {
             mCallbacks.onSessionClosed(promiseId, sessionId);
         }
     }
 
-    protected void onSessionMessage(byte[] sessionId,
-                                    int sessionMessageType,
-                                    byte[] request) {
+    protected void onSessionMessage(final byte[] sessionId,
+                                    final int sessionMessageType,
+                                    final byte[] request) {
         assertTrue(mCallbacks != null);
         if (mCallbacks != null) {
             mCallbacks.onSessionMessage(sessionId, sessionMessageType, request);
         }
     }
 
-    protected void onSessionError(byte[] sessionId, String message) {
+    protected void onSessionError(final byte[] sessionId, final String message) {
         assertTrue(mCallbacks != null);
         if (mCallbacks != null) {
             mCallbacks.onSessionError(sessionId, message);
         }
     }
 
-    protected void  onSessionBatchedKeyChanged(byte[] sessionId,
-                                               SessionKeyInfo[] keyInfos) {
+    protected void  onSessionBatchedKeyChanged(final byte[] sessionId,
+                                               final SessionKeyInfo[] keyInfos) {
         assertTrue(mCallbacks != null);
         if (mCallbacks != null) {
             mCallbacks.onSessionBatchedKeyChanged(sessionId, keyInfos);
         }
     }
 
-    protected void onRejectPromise(int promiseId, String message) {
+    protected void onRejectPromise(final int promiseId, final String message) {
         assertTrue(mCallbacks != null);
         if (mCallbacks != null) {
             mCallbacks.onRejectPromise(promiseId, message);
         }
     }
 
-    private MediaDrm.KeyRequest getKeyRequest(ByteBuffer aSession,
-                                              byte[] data,
-                                              String mimeType)
+    private MediaDrm.KeyRequest getKeyRequest(final ByteBuffer aSession,
+                                              final byte[] data,
+                                              final String mimeType)
         throws android.media.NotProvisionedException {
         if (mProvisioningPromiseId > 0) {
             // Now provisioning.
             return null;
         }
 
         try {
             HashMap<String, String> optionalParameters = new HashMap<String, String>();
@@ -398,18 +398,18 @@ public class GeckoMediaDrmBridgeV21 impl
         } catch (Exception e) {
             Log.e(LOGTAG, "Got excpetion during MediaDrm.getKeyRequest", e);
         }
         return null;
     }
 
     private class MediaDrmListener implements MediaDrm.OnEventListener {
         @Override
-        public void onEvent(MediaDrm mediaDrm, byte[] sessionArray, int event,
-                            int extra, byte[] data) {
+        public void onEvent(final MediaDrm mediaDrm, final byte[] sessionArray, final int event,
+                            final int extra, final byte[] data) {
             if (DEBUG) Log.d(LOGTAG, "MediaDrmListener.onEvent()");
             if (sessionArray == null) {
                 if (DEBUG) Log.d(LOGTAG, "MediaDrmListener: Null session.");
                 return;
             }
             ByteBuffer session = ByteBuffer.wrap(sessionArray);
             if (!sessionExists(session)) {
                 if (DEBUG) Log.d(LOGTAG, "MediaDrmListener: Invalid session.");
@@ -454,17 +454,17 @@ public class GeckoMediaDrmBridgeV21 impl
         } catch (android.media.MediaDrmException e) {
             // Other MediaDrmExceptions (e.g. ResourceBusyException) are not
             // recoverable.
             release();
             return null;
         }
     }
 
-    protected boolean sessionExists(ByteBuffer session) {
+    protected boolean sessionExists(final ByteBuffer session) {
         if (mCryptoSessionId == null) {
             if (DEBUG) Log.d(LOGTAG, "Session doesn't exist because media crypto session is not created.");
             return false;
         }
         if (session == null) {
             if (DEBUG) Log.d(LOGTAG, "Session is null, not in map !");
             return false;
         }
@@ -474,24 +474,24 @@ public class GeckoMediaDrmBridgeV21 impl
     private class PostRequestTask extends AsyncTask<Void, Void, Void> {
         private static final String LOGTAG = "PostRequestTask";
 
         private int mPromiseId;
         private String mURL;
         private byte[] mDrmRequest;
         private byte[] mResponseBody;
 
-        PostRequestTask(int promiseId, String url, byte[] drmRequest) {
+        PostRequestTask(final int promiseId, final String url, final byte[] drmRequest) {
             this.mPromiseId = promiseId;
             this.mURL = url;
             this.mDrmRequest = drmRequest;
         }
 
         @Override
-        protected Void doInBackground(Void... params) {
+        protected Void doInBackground(final Void... params) {
             HttpURLConnection urlConnection = null;
             BufferedReader in = null;
             try {
                 URI finalURI = new URI(mURL + "&signedRequest=" + URLEncoder.encode(new String(mDrmRequest), "UTF-8"));
                 urlConnection = (HttpURLConnection) ProxySelector.openConnectionWithProxy(finalURI);
                 urlConnection.setRequestMethod("POST");
                 if (DEBUG) Log.d(LOGTAG, "Provisioning, posting url =" + finalURI.toString());
 
@@ -534,42 +534,42 @@ public class GeckoMediaDrmBridgeV21 impl
                 } catch (IOException e) {
                     Log.e(LOGTAG, "Exception during closing in ...", e);
                 }
             }
             return null;
         }
 
         @Override
-        protected void onPostExecute(Void v) {
+        protected void onPostExecute(final Void v) {
             onProvisionResponse(mPromiseId, mResponseBody);
         }
     }
 
-    private boolean provideProvisionResponse(byte[] response) {
+    private boolean provideProvisionResponse(final byte[] response) {
         if (response == null || response.length == 0) {
             if (DEBUG) Log.d(LOGTAG, "Invalid provision response.");
             return false;
         }
 
         try {
             mDrm.provideProvisionResponse(response);
             return true;
         } catch (android.media.DeniedByServerException e) {
             if (DEBUG) Log.d(LOGTAG, "Failed to provide provision response:" + e.getMessage());
         } catch (java.lang.IllegalStateException e) {
             if (DEBUG) Log.d(LOGTAG, "Failed to provide provision response:" + e.getMessage());
         }
         return false;
     }
 
-    private void savePendingCreateSessionData(int token,
-                                              int promiseId,
-                                              byte[] initData,
-                                              String mime) {
+    private void savePendingCreateSessionData(final int token,
+                                              final int promiseId,
+                                              final byte[] initData,
+                                              final String mime) {
         if (DEBUG) Log.d(LOGTAG, "savePendingCreateSessionData, promiseId : " + promiseId);
         mPendingCreateSessionDataQueue.offer(new PendingCreateSessionData(token, promiseId, initData, mime));
     }
 
     private void processPendingCreateSessionData() {
         if (DEBUG) Log.d(LOGTAG, "processPendingCreateSessionData ... ");
 
         assertTrue(mProvisioningPromiseId == 0);
@@ -603,17 +603,17 @@ public class GeckoMediaDrmBridgeV21 impl
             @Override
             public void run() {
                 processPendingCreateSessionData();
             }
         });
     }
 
     // Only triggered when failed on {openSession, getKeyRequest}
-    private void startProvisioning(int promiseId) {
+    private void startProvisioning(final int promiseId) {
         if (DEBUG) Log.d(LOGTAG, "startProvisioning()");
         if (mProvisioningPromiseId > 0) {
             // Already in provisioning.
             return;
         }
         try {
             mProvisioningPromiseId = promiseId;
             @SuppressLint("NewApi") MediaDrm.ProvisionRequest request = mDrm.getProvisionRequest();
@@ -621,17 +621,17 @@ public class GeckoMediaDrmBridgeV21 impl
                 new PostRequestTask(promiseId, request.getDefaultUrl(), request.getData());
             postTask.execute();
         } catch (Exception e) {
             onRejectPromise(promiseId, "Exception happened in startProvisioning !");
             mProvisioningPromiseId = 0;
         }
     }
 
-    private void onProvisionResponse(int promiseId, byte[] response) {
+    private void onProvisionResponse(final int promiseId, final byte[] response) {
         if (DEBUG) Log.d(LOGTAG, "onProvisionResponse()");
 
         mProvisioningPromiseId = 0;
         boolean success = provideProvisionResponse(response);
         if (success) {
             // Promise will either be resovled / rejected in createSession during
             // resuming operations.
             resumePendingOperations();
@@ -667,17 +667,17 @@ public class GeckoMediaDrmBridgeV21 impl
             release();
             return false;
         } catch (android.media.NotProvisionedException e) {
             if (DEBUG) Log.d(LOGTAG, "ensureMediaCryptoCreated::Device not provisioned:" + e.getMessage());
             throw e;
         }
     }
 
-    private UUID convertKeySystemToSchemeUUID(String keySystem) {
+    private UUID convertKeySystemToSchemeUUID(final String keySystem) {
       if (WIDEVINE_KEY_SYSTEM.equals(keySystem)) {
           return WIDEVINE_SCHEME_UUID;
       }
       if (DEBUG) Log.d(LOGTAG, "Cannot convert unsupported key system : " + keySystem);
       return new UUID(0L, 0L);
     }
 
     private String getCDMUserAgent() {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV23.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoMediaDrmBridgeV23.java
@@ -15,42 +15,42 @@ import java.lang.IllegalStateException;
 import java.nio.ByteBuffer;
 import java.util.HashMap;
 import java.util.List;
 
 @TargetApi(M)
 public class GeckoMediaDrmBridgeV23 extends GeckoMediaDrmBridgeV21 {
     private static final boolean DEBUG = false;
 
-    GeckoMediaDrmBridgeV23(String keySystem) throws Exception {
+    GeckoMediaDrmBridgeV23(final String keySystem) throws Exception {
         super(keySystem);
         if (DEBUG) Log.d(LOGTAG, "GeckoMediaDrmBridgeV23 ctor");
         mDrm.setOnKeyStatusChangeListener(new KeyStatusChangeListener(), null);
     }
 
     private class KeyStatusChangeListener implements MediaDrm.OnKeyStatusChangeListener {
         @Override
-        public void onKeyStatusChange(MediaDrm mediaDrm,
-                                      byte[] sessionId,
-                                      List<MediaDrm.KeyStatus> keyInformation,
-                                      boolean hasNewUsableKey) {
+        public void onKeyStatusChange(final MediaDrm mediaDrm,
+                                      final byte[] sessionId,
+                                      final List<MediaDrm.KeyStatus> keyInformation,
+                                      final boolean hasNewUsableKey) {
             if (DEBUG) Log.d(LOGTAG, "[onKeyStatusChange] hasNewUsableKey = " + hasNewUsableKey);
             if (keyInformation.size() == 0) {
                 return;
             }
             SessionKeyInfo[] keyInfos = new SessionKeyInfo[keyInformation.size()];
             for (int i = 0; i < keyInformation.size(); i++) {
                 MediaDrm.KeyStatus keyStatus = keyInformation.get(i);
                 keyInfos[i] = new SessionKeyInfo(keyStatus.getKeyId(),
                                                  keyStatus.getStatusCode());
             }
             onSessionBatchedKeyChanged(sessionId, keyInfos);
             if (DEBUG) Log.d(LOGTAG, "Key successfully added for session " + new String(sessionId));
         }
     }
 
     @Override
-    protected void HandleKeyStatusChangeByDummyKey(String sessionId)
+    protected void HandleKeyStatusChangeByDummyKey(final String sessionId)
     {
         // MediaDrm.KeyStatus information listener is supported on M+, there is no need to use
         // dummy key id to report key status anymore.
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoPlayerFactory.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoPlayerFactory.java
@@ -19,26 +19,26 @@ public final class GeckoPlayerFactory {
             sPlayerList.add(player);
             return player;
         } catch (Exception e) {
             Log.e("GeckoPlayerFactory", "Class GeckoHlsPlayer not found or failed to create", e);
         }
         return null;
     }
 
-    synchronized static BaseHlsPlayer getPlayer(int id) {
+    synchronized static BaseHlsPlayer getPlayer(final int id) {
         for (BaseHlsPlayer player : sPlayerList) {
             if (player.getId() == id) {
                 return player;
             }
         }
         Log.w("GeckoPlayerFactory", "No player found with id : " + id);
         return null;
     }
 
-    synchronized static void removePlayer(@NonNull BaseHlsPlayer player) {
+    synchronized static void removePlayer(final @NonNull BaseHlsPlayer player) {
         int index = sPlayerList.indexOf(player);
         if (index >= 0) {
             sPlayerList.remove(player);
             Log.d("GeckoPlayerFactory", "HlsPlayer with id(" + player.getId() + ") is removed.");
         }
     }
-}
\ No newline at end of file
+}
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoVideoInfo.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/GeckoVideoInfo.java
@@ -15,20 +15,21 @@ public final class GeckoVideoInfo {
     final public int displayWidth;
     final public int displayHeight;
     final public int pictureWidth;
     final public int pictureHeight;
     final public int rotation;
     final public int stereoMode;
     final public long duration;
     final public String mimeType;
-    public GeckoVideoInfo(int displayWidth, int displayHeight,
-                          int pictureWidth, int pictureHeight,
-                          int rotation, int stereoMode, long duration, String mimeType,
-                          byte[] extraData, byte[] codecSpecificData) {
+    public GeckoVideoInfo(final int displayWidth, final int displayHeight,
+                          final int pictureWidth, final int pictureHeight,
+                          final int rotation, final int stereoMode, final long duration,
+                          final String mimeType, final byte[] extraData,
+                          final byte[] codecSpecificData) {
         this.displayWidth = displayWidth;
         this.displayHeight = displayHeight;
         this.pictureWidth = pictureWidth;
         this.pictureHeight = pictureHeight;
         this.rotation = rotation;
         this.stereoMode = stereoMode;
         this.duration = duration;
         this.mimeType = mimeType;
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/JellyBeanAsyncCodec.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/JellyBeanAsyncCodec.java
@@ -29,17 +29,17 @@ final class JellyBeanAsyncCodec implemen
     private static final String LOGTAG = "GeckoAsyncCodecAPIv16";
     private static final boolean DEBUG = false;
 
     private static final int ERROR_CODEC = -10000;
 
     private abstract class CancelableHandler extends Handler {
         private static final int MSG_CANCELLATION = 0x434E434C; // 'CNCL'
 
-        protected CancelableHandler(Looper looper) {
+        protected CancelableHandler(final Looper looper) {
             super(looper);
         }
 
         protected void cancel() {
             removeCallbacksAndMessages(null);
             sendEmptyMessage(MSG_CANCELLATION);
             // Wait until handleMessageLocked() is done.
             synchronized (this) { }
@@ -48,17 +48,17 @@ final class JellyBeanAsyncCodec implemen
         protected boolean isCanceled() {
             return hasMessages(MSG_CANCELLATION);
         }
 
         // Subclass should implement this and return true if it handles msg.
         // Warning: Never, ever call super.handleMessage() in this method!
         protected abstract boolean handleMessageLocked(Message msg);
 
-        public final void handleMessage(Message msg) {
+        public final void handleMessage(final Message msg) {
             // Block cancel() during handleMessageLocked().
             synchronized (this) {
                 if (isCanceled() || handleMessageLocked(msg)) {
                     return;
                 }
             }
 
             switch (msg.what) {
@@ -76,62 +76,62 @@ final class JellyBeanAsyncCodec implemen
     // A handler to invoke AsyncCodec.Callbacks methods.
     private final class CallbackSender extends CancelableHandler {
         private static final int MSG_INPUT_BUFFER_AVAILABLE = 1;
         private static final int MSG_OUTPUT_BUFFER_AVAILABLE = 2;
         private static final int MSG_OUTPUT_FORMAT_CHANGE = 3;
         private static final int MSG_ERROR = 4;
         private Callbacks mCallbacks;
 
-        private CallbackSender(Looper looper, Callbacks callbacks) {
+        private CallbackSender(final Looper looper, final Callbacks callbacks) {
           super(looper);
           mCallbacks = callbacks;
         }
 
-        public void notifyInputBuffer(int index) {
+        public void notifyInputBuffer(final int index) {
             if (isCanceled()) {
                 return;
             }
 
             Message msg = obtainMessage(MSG_INPUT_BUFFER_AVAILABLE);
             msg.arg1 = index;
             processMessage(msg);
         }
 
-        private void processMessage(Message msg) {
+        private void processMessage(final Message msg) {
             if (Looper.myLooper() == getLooper()) {
                 handleMessage(msg);
             } else {
                 sendMessage(msg);
             }
         }
 
-        public void notifyOutputBuffer(int index, MediaCodec.BufferInfo info) {
+        public void notifyOutputBuffer(final int index, final MediaCodec.BufferInfo info) {
             if (isCanceled()) {
                 return;
             }
 
             Message msg = obtainMessage(MSG_OUTPUT_BUFFER_AVAILABLE, info);
             msg.arg1 = index;
             processMessage(msg);
         }
 
-        public void notifyOutputFormat(MediaFormat format) {
+        public void notifyOutputFormat(final MediaFormat format) {
             if (isCanceled()) {
                 return;
             }
             processMessage(obtainMessage(MSG_OUTPUT_FORMAT_CHANGE, format));
         }
 
-        public void notifyError(int result) {
+        public void notifyError(final int result) {
             Log.e(LOGTAG, "codec error:" + result);
             processMessage(obtainMessage(MSG_ERROR, result, 0));
         }
 
-        protected boolean handleMessageLocked(Message msg) {
+        protected boolean handleMessageLocked(final Message msg) {
             switch (msg.what) {
                 case MSG_INPUT_BUFFER_AVAILABLE: // arg1: buffer index.
                     mCallbacks.onInputBufferAvailable(JellyBeanAsyncCodec.this,
                                                       msg.arg1);
                     break;
                 case MSG_OUTPUT_BUFFER_AVAILABLE: // arg1: buffer index, obj: info.
                     mCallbacks.onOutputBufferAvailable(JellyBeanAsyncCodec.this,
                                                        msg.arg1,
@@ -158,47 +158,47 @@ final class JellyBeanAsyncCodec implemen
     // automatically polling more buffer, use cancel() it inherits from
     // CancelableHandler.
     private final class BufferPoller extends CancelableHandler {
         private static final int MSG_POLL_INPUT_BUFFERS = 1;
         private static final int MSG_POLL_OUTPUT_BUFFERS = 2;
 
         private static final long DEQUEUE_TIMEOUT_US = 10000;
 
-        public BufferPoller(Looper looper) {
+        public BufferPoller(final Looper looper) {
             super(looper);
         }
 
-        private void schedulePollingIfNotCanceled(int what) {
+        private void schedulePollingIfNotCanceled(final int what) {
             if (isCanceled()) {
                 return;
             }
 
             schedulePolling(what);
         }
 
-        private void schedulePolling(int what) {
+        private void schedulePolling(final int what) {
             if (needsBuffer(what)) {
                 sendEmptyMessage(what);
             }
         }
 
-        private boolean needsBuffer(int what) {
+        private boolean needsBuffer(final int what) {
             if (mOutputEnded && (what == MSG_POLL_OUTPUT_BUFFERS)) {
                 return false;
             }
 
             if (mInputEnded && (what == MSG_POLL_INPUT_BUFFERS)) {
                 return false;
             }
 
             return true;
         }
 
-        protected boolean handleMessageLocked(Message msg) {
+        protected boolean handleMessageLocked(final Message msg) {
             try {
                 switch (msg.what) {
                     case MSG_POLL_INPUT_BUFFERS:
                         pollInputBuffer();
                         break;
                     case MSG_POLL_OUTPUT_BUFFERS:
                         pollOutputBuffer();
                         break;
@@ -258,34 +258,34 @@ final class JellyBeanAsyncCodec implemen
     private AsyncCodec.Callbacks mCallbacks;
     private CallbackSender mCallbackSender;
 
     private BufferPoller mBufferPoller;
     private volatile boolean mInputEnded;
     private volatile boolean mOutputEnded;
 
     // Must be called on a thread with looper.
-    /* package */ JellyBeanAsyncCodec(String name) throws IOException {
+    /* package */ JellyBeanAsyncCodec(final String name) throws IOException {
         mCodec = MediaCodec.createByCodecName(name);
         initBufferPoller(name + " buffer poller");
     }
 
-    private void initBufferPoller(String name) {
+    private void initBufferPoller(final String name) {
         if (mBufferPoller != null) {
             Log.e(LOGTAG, "poller already initialized");
             return;
         }
         HandlerThread thread = new HandlerThread(name);
         thread.start();
         mBufferPoller = new BufferPoller(thread.getLooper());
         if (DEBUG) { Log.d(LOGTAG, "start poller for codec:" + this + ", thread=" + thread.getThreadId()); }
     }
 
     @Override
-    public void setCallbacks(AsyncCodec.Callbacks callbacks, Handler handler) {
+    public void setCallbacks(final AsyncCodec.Callbacks callbacks, final Handler handler) {
         if (callbacks == null) {
             return;
         }
 
         Looper looper = (handler == null) ? null : handler.getLooper();
         if (looper == null) {
             // Use this thread if no handler supplied.
             looper = Looper.myLooper();
@@ -294,24 +294,25 @@ final class JellyBeanAsyncCodec implemen
             // This thread has no looper. Use poller thread.
             looper = mBufferPoller.getLooper();
         }
         mCallbackSender = new CallbackSender(looper, callbacks);
         if (DEBUG) { Log.d(LOGTAG, "setCallbacks(): sender=" + mCallbackSender); }
     }
 
     @Override
-    public void configure(MediaFormat format, Surface surface, MediaCrypto crypto, int flags) {
+    public void configure(final MediaFormat format, final Surface surface,
+                          final MediaCrypto crypto, final int flags) {
         assertCallbacks();
 
         mCodec.configure(format, surface, crypto, flags);
     }
 
     @Override
-    public boolean isAdaptivePlaybackSupported(String mimeType) {
+    public boolean isAdaptivePlaybackSupported(final String mimeType) {
         return HardwareCodecCapabilityUtils.checkSupportsAdaptivePlayback(mCodec, mimeType);
     }
 
     @Override
     public boolean isTunneledPlaybackSupported(final String mimeType) {
         try {
             return android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP
                    && mCodec.getCodecInfo()
@@ -343,26 +344,27 @@ final class JellyBeanAsyncCodec implemen
     @Override
     public void resumeReceivingInputs() {
         for (int i = 0; i < mInputBuffers.length; i++) {
             mBufferPoller.schedulePolling(BufferPoller.MSG_POLL_INPUT_BUFFERS);
         }
     }
 
     @Override
-    public final void setRates(int newBitRate) {
+    public final void setRates(final int newBitRate) {
         if (android.os.Build.VERSION.SDK_INT >= 19) {
             Bundle params = new Bundle();
             params.putInt(MediaCodec.PARAMETER_KEY_VIDEO_BITRATE, newBitRate * 1000);
             mCodec.setParameters(params);
         }
     }
 
     @Override
-    public final void queueInputBuffer(int index, int offset, int size, long presentationTimeUs, int flags) {
+    public final void queueInputBuffer(final int index, final int offset, final int size,
+                                       final long presentationTimeUs, final int flags) {
         assertCallbacks();
 
         mInputEnded = (flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0;
 
         if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT
                 && ((flags & MediaCodec.BUFFER_FLAG_KEY_FRAME) != 0)) {
             Bundle params = new Bundle();
             params.putInt(MediaCodec.PARAMETER_KEY_REQUEST_SYNC_FRAME, 0);
@@ -377,21 +379,21 @@ final class JellyBeanAsyncCodec implemen
             return;
         }
 
         mBufferPoller.schedulePolling(BufferPoller.MSG_POLL_OUTPUT_BUFFERS);
         mBufferPoller.schedulePolling(BufferPoller.MSG_POLL_INPUT_BUFFERS);
     }
 
     @Override
-    public final void queueSecureInputBuffer(int index,
-                                             int offset,
-                                             MediaCodec.CryptoInfo cryptoInfo,
-                                             long presentationTimeUs,
-                                             int flags) {
+    public final void queueSecureInputBuffer(final int index,
+                                             final int offset,
+                                             final MediaCodec.CryptoInfo cryptoInfo,
+                                             final long presentationTimeUs,
+                                             final int flags) {
         assertCallbacks();
 
         mInputEnded = (flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0;
 
         try {
             mCodec.queueSecureInputBuffer(index, offset, cryptoInfo, presentationTimeUs, flags);
         } catch (IllegalStateException e) {
             e.printStackTrace();
@@ -399,31 +401,31 @@ final class JellyBeanAsyncCodec implemen
             return;
         }
 
         mBufferPoller.schedulePolling(BufferPoller.MSG_POLL_INPUT_BUFFERS);
         mBufferPoller.schedulePolling(BufferPoller.MSG_POLL_OUTPUT_BUFFERS);
     }
 
     @Override
-    public final void releaseOutputBuffer(int index, boolean render) {
+    public final void releaseOutputBuffer(final int index, final boolean render) {
         assertCallbacks();
 
         mCodec.releaseOutputBuffer(index, render);
     }
 
     @Override
-    public final ByteBuffer getInputBuffer(int index) {
+    public final ByteBuffer getInputBuffer(final int index) {
         assertCallbacks();
 
         return mInputBuffers[index];
     }
 
     @Override
-    public final ByteBuffer getOutputBuffer(int index) {
+    public final ByteBuffer getOutputBuffer(final int index) {
         assertCallbacks();
 
         return mOutputBuffers[index];
     }
 
     @Override
     public void flush() {
         assertCallbacks();
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/MediaDrmProxy.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/MediaDrmProxy.java
@@ -54,32 +54,32 @@ public final class MediaDrmProxy {
             if (DEBUG) Log.d(LOGTAG, "System Not supported !!, current SDK version is " + Build.VERSION.SDK_INT);
             return false;
         }
         return true;
     }
 
     @SuppressLint("NewApi")
     @WrapForJNI
-    public static boolean isSchemeSupported(String keySystem) {
+    public static boolean isSchemeSupported(final String keySystem) {
         if (!isSystemSupported()) {
             return false;
         }
         if (keySystem.equals(WIDEVINE_KEY_SYSTEM)) {
             return MediaDrm.isCryptoSchemeSupported(WIDEVINE_SCHEME_UUID)
                     && MediaCrypto.isCryptoSchemeSupported(WIDEVINE_SCHEME_UUID);
         }
         if (DEBUG) Log.d(LOGTAG, "isSchemeSupported key sytem = " + keySystem);
         return false;
     }
 
     @SuppressLint("NewApi")
     @WrapForJNI
-    public static boolean IsCryptoSchemeSupported(String keySystem,
-                                                  String container) {
+    public static boolean IsCryptoSchemeSupported(final String keySystem,
+                                                  final String container) {
         if (!isSystemSupported()) {
             return false;
         }
         if (keySystem.equals(WIDEVINE_KEY_SYSTEM)) {
             return MediaDrm.isCryptoSchemeSupported(WIDEVINE_SCHEME_UUID, container);
         }
         if (DEBUG) Log.d(LOGTAG, "cannot decrypt key sytem = " + keySystem + ", container = " + container);
         return false;
@@ -160,127 +160,127 @@ public final class MediaDrmProxy {
         }
     } // NativeMediaDrmProxyCallbacks
 
     // A proxy to callback from LocalMediaDrmBridge to native instance.
     public static class MediaDrmProxyCallbacks implements GeckoMediaDrm.Callbacks {
         private final Callbacks mNativeCallbacks;
         private final MediaDrmProxy mProxy;
 
-        public MediaDrmProxyCallbacks(MediaDrmProxy proxy, Callbacks callbacks) {
+        public MediaDrmProxyCallbacks(final MediaDrmProxy proxy, final Callbacks callbacks) {
             mNativeCallbacks = callbacks;
             mProxy = proxy;
         }
 
         @Override
-        public void onSessionCreated(int createSessionToken,
-                                     int promiseId,
-                                     byte[] sessionId,
-                                     byte[] request) {
+        public void onSessionCreated(final int createSessionToken,
+                                     final int promiseId,
+                                     final byte[] sessionId,
+                                     final byte[] request) {
             if (!mProxy.isDestroyed()) {
                 mNativeCallbacks.onSessionCreated(createSessionToken,
                                                   promiseId,
                                                   sessionId,
                                                   request);
             }
         }
 
         @Override
-        public void onSessionUpdated(int promiseId, byte[] sessionId) {
+        public void onSessionUpdated(final int promiseId, final byte[] sessionId) {
             if (!mProxy.isDestroyed()) {
                 mNativeCallbacks.onSessionUpdated(promiseId, sessionId);
             }
         }
 
         @Override
-        public void onSessionClosed(int promiseId, byte[] sessionId) {
+        public void onSessionClosed(final int promiseId, final byte[] sessionId) {
             if (!mProxy.isDestroyed()) {
                 mNativeCallbacks.onSessionClosed(promiseId, sessionId);
             }
         }
 
         @Override
-        public void onSessionMessage(byte[] sessionId,
-                                     int sessionMessageType,
-                                     byte[] request) {
+        public void onSessionMessage(final byte[] sessionId,
+                                     final int sessionMessageType,
+                                     final byte[] request) {
             if (!mProxy.isDestroyed()) {
                 mNativeCallbacks.onSessionMessage(sessionId, sessionMessageType, request);
             }
         }
 
         @Override
-        public void onSessionError(byte[] sessionId,
-                                   String message) {
+        public void onSessionError(final byte[] sessionId,
+                                   final String message) {
             if (!mProxy.isDestroyed()) {
                 mNativeCallbacks.onSessionError(sessionId, message);
             }
         }
 
         @Override
-        public void onSessionBatchedKeyChanged(byte[] sessionId,
-                                               SessionKeyInfo[] keyInfos) {
+        public void onSessionBatchedKeyChanged(final byte[] sessionId,
+                                               final SessionKeyInfo[] keyInfos) {
             if (!mProxy.isDestroyed()) {
                 mNativeCallbacks.onSessionBatchedKeyChanged(sessionId, keyInfos);
             }
         }
 
         @Override
-        public void onRejectPromise(int promiseId,
-                                    String message) {
+        public void onRejectPromise(final int promiseId,
+                                    final String message) {
             if (!mProxy.isDestroyed()) {
                 mNativeCallbacks.onRejectPromise(promiseId, message);
             }
         }
     } // MediaDrmProxyCallbacks
 
     public boolean isDestroyed() {
         return mDestroyed;
     }
 
     @WrapForJNI(calledFrom = "gecko")
-    public static MediaDrmProxy create(String keySystem,
-                                       Callbacks nativeCallbacks) {
+    public static MediaDrmProxy create(final String keySystem,
+                                       final Callbacks nativeCallbacks) {
         MediaDrmProxy proxy = new MediaDrmProxy(keySystem, nativeCallbacks);
         return proxy;
     }
 
-    MediaDrmProxy(String keySystem, Callbacks nativeCallbacks) {
+    MediaDrmProxy(final String keySystem, final Callbacks nativeCallbacks) {
         if (DEBUG) Log.d(LOGTAG, "Constructing MediaDrmProxy");
         try {
             mDrmStubId = UUID.randomUUID().toString();
             IMediaDrmBridge remoteBridge =
                 RemoteManager.getInstance().createRemoteMediaDrmBridge(keySystem, mDrmStubId);
             mImpl = new RemoteMediaDrmBridge(remoteBridge);
             mImpl.setCallbacks(new MediaDrmProxyCallbacks(this, nativeCallbacks));
             sProxyList.add(this);
         } catch (Exception e) {
             Log.e(LOGTAG, "Constructing MediaDrmProxy ... error", e);
         }
     }
 
     @WrapForJNI
-    private void createSession(int createSessionToken,
-                               int promiseId,
-                               String initDataType,
-                               byte[] initData) {
+    private void createSession(final int createSessionToken,
+                               final int promiseId,
+                               final String initDataType,
+                               final byte[] initData) {
         if (DEBUG) Log.d(LOGTAG, "createSession, promiseId = " + promiseId);
         mImpl.createSession(createSessionToken,
                             promiseId,
                             initDataType,
                             initData);
     }
 
     @WrapForJNI
-    private void updateSession(int promiseId, String sessionId, byte[] response) {
+    private void updateSession(final int promiseId, final String sessionId, final byte[] response) {
         if (DEBUG) Log.d(LOGTAG, "updateSession, primiseId(" + promiseId  + "sessionId(" + sessionId + ")");
         mImpl.updateSession(promiseId, sessionId, response);
     }
 
     @WrapForJNI
-    private void closeSession(int promiseId, String sessionId) {
+    private void closeSession(final int promiseId, final String sessionId) {
         if (DEBUG) Log.d(LOGTAG, "closeSession, primiseId(" + promiseId  + "sessionId(" + sessionId + ")");
         mImpl.closeSession(promiseId, sessionId);
     }
 
     @WrapForJNI(calledFrom = "gecko")
     private String getStubId() {
         return mDrmStubId;
     }
@@ -293,17 +293,17 @@ public final class MediaDrmProxy {
         } catch (RuntimeException e) {
             return false;
         }
     }
 
     // Get corresponding MediaCrypto object by a generated UUID for MediaCodec.
     // Will be called on MediaFormatReader's TaskQueue.
     @WrapForJNI
-    public static MediaCrypto getMediaCrypto(String stubId) {
+    public static MediaCrypto getMediaCrypto(final String stubId) {
         for (MediaDrmProxy proxy : sProxyList) {
             if (proxy.getStubId().equals(stubId)) {
                 return proxy.getMediaCryptoFromBridge();
             }
         }
         if (DEBUG) Log.d(LOGTAG, " NULL crytpo ");
         return null;
     }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/MediaManager.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/MediaManager.java
@@ -20,37 +20,37 @@ public final class MediaManager extends 
 
     private Binder mBinder = new IMediaManager.Stub() {
         @Override
         public ICodec createCodec() throws RemoteException {
             return new Codec();
         }
 
         @Override
-        public IMediaDrmBridge createRemoteMediaDrmBridge(String keySystem,
-                                                          String stubId)
+        public IMediaDrmBridge createRemoteMediaDrmBridge(final String keySystem,
+                                                          final String stubId)
             throws RemoteException {
             return new RemoteMediaDrmBridgeStub(keySystem, stubId);
         }
     };
 
     @Override
     public synchronized void onCreate() {
         if (!sNativeLibLoaded) {
             GeckoLoader.doLoadLibrary(this, "mozglue");
             GeckoLoader.suppressCrashDialog();
             sNativeLibLoaded = true;
         }
     }
 
     @Override
-    public IBinder onBind(Intent intent) {
+    public IBinder onBind(final Intent intent) {
         return mBinder;
     }
 
     @Override
-    public boolean onUnbind(Intent intent) {
+    public boolean onUnbind(final Intent intent) {
         Log.i(LOGTAG, "Media service has been unbound. Stopping.");
         stopSelf();
         Process.killProcess(Process.myPid());
         return false;
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteManager.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteManager.java
@@ -39,31 +39,31 @@ public final class RemoteManager impleme
 
     private List<CodecProxy> mCodecs = new LinkedList<CodecProxy>();
     private List<IMediaDrmBridge> mDrmBridges = new LinkedList<IMediaDrmBridge>();
 
     private volatile IMediaManager mRemote;
 
     private final class RemoteConnection implements ServiceConnection {
         @Override
-        public void onServiceConnected(ComponentName name, IBinder service) {
+        public void onServiceConnected(final ComponentName name, final IBinder service) {
             if (DEBUG) Log.d(LOGTAG, "service connected");
             try {
                 service.linkToDeath(RemoteManager.this, 0);
             } catch (RemoteException e) {
                 e.printStackTrace();
             }
             synchronized (this) {
                 mRemote = IMediaManager.Stub.asInterface(service);
                 notify();
             }
         }
 
         @Override
-        public void onServiceDisconnected(ComponentName name) {
+        public void onServiceDisconnected(final ComponentName name) {
             if (DEBUG) Log.d(LOGTAG, "service disconnected");
             unlink();
         }
 
         private boolean connect() {
             Context appCtxt = GeckoAppShell.getApplicationContext();
             appCtxt.bindService(new Intent(appCtxt, MediaManager.class),
                     mConnection, Context.BIND_AUTO_CREATE);
@@ -117,21 +117,21 @@ public final class RemoteManager impleme
         if (mRemote != null) {
             return true;
         }
 
         if (DEBUG) Log.d(LOGTAG, "init remote manager " + this);
         return mConnection.connect();
     }
 
-    public synchronized CodecProxy createCodec(boolean isEncoder,
-                                               MediaFormat format,
-                                               GeckoSurface surface,
-                                               CodecProxy.Callbacks callbacks,
-                                               String drmStubId) {
+    public synchronized CodecProxy createCodec(final boolean isEncoder,
+                                               final MediaFormat format,
+                                               final GeckoSurface surface,
+                                               final CodecProxy.Callbacks callbacks,
+                                               final String drmStubId) {
         if (mRemote == null) {
             if (DEBUG) Log.d(LOGTAG, "createCodec failed due to not initialize");
             return null;
         }
         try {
             ICodec remote = mRemote.createCodec();
             CodecProxy proxy = CodecProxy.createCodecProxy(isEncoder, format, surface, callbacks, drmStubId);
             if (proxy.init(remote)) {
@@ -141,18 +141,18 @@ public final class RemoteManager impleme
                 return null;
             }
         } catch (RemoteException e) {
             e.printStackTrace();
             return null;
         }
     }
 
-    public synchronized IMediaDrmBridge createRemoteMediaDrmBridge(String keySystem,
-                                                                   String stubId) {
+    public synchronized IMediaDrmBridge createRemoteMediaDrmBridge(final String keySystem,
+                                                                   final String stubId) {
         if (mRemote == null) {
             if (DEBUG) Log.d(LOGTAG, "createRemoteMediaDrmBridge failed due to not initialize");
             return null;
         }
         try {
             IMediaDrmBridge remoteBridge =
                 mRemote.createRemoteMediaDrmBridge(keySystem, stubId);
             mDrmBridges.add(remoteBridge);
@@ -174,17 +174,17 @@ public final class RemoteManager impleme
 
         if (init() && recoverRemoteCodec()) {
             notifyError(false);
         } else {
             notifyError(true);
         }
     }
 
-    private synchronized void notifyError(boolean fatal) {
+    private synchronized void notifyError(final boolean fatal) {
         for (CodecProxy proxy : mCodecs) {
             proxy.reportError(fatal);
         }
     }
 
     private synchronized boolean recoverRemoteCodec() {
         if (DEBUG) Log.d(LOGTAG, "recover codec");
         boolean ok = true;
@@ -193,17 +193,18 @@ public final class RemoteManager impleme
                 ok &= proxy.init(mRemote.createCodec());
             }
             return ok;
         } catch (RemoteException e) {
             return false;
         }
     }
 
-    public void releaseCodec(CodecProxy proxy) throws DeadObjectException, RemoteException {
+    public void releaseCodec(final CodecProxy proxy)
+            throws DeadObjectException, RemoteException {
         if (mRemote == null) {
             if (DEBUG) Log.d(LOGTAG, "releaseCodec called but not initialized yet");
             return;
         }
         proxy.deinit();
         synchronized (this) {
             if (mCodecs.remove(proxy)) {
                 releaseIfNeeded();
@@ -217,21 +218,21 @@ public final class RemoteManager impleme
         }
 
         if (DEBUG) Log.d(LOGTAG, "release remote manager " + this);
         mConnection.unlink();
         Context appCtxt = GeckoAppShell.getApplicationContext();
         appCtxt.unbindService(mConnection);
     }
 
-    public void onRemoteMediaDrmBridgeReleased(IMediaDrmBridge remote) {
+    public void onRemoteMediaDrmBridgeReleased(final IMediaDrmBridge remote) {
         if (!mDrmBridges.contains(remote)) {
             Log.e(LOGTAG, "Try to release unknown remote MediaDrm bridge: " + remote);
             return;
         }
 
         synchronized (this) {
             if (mDrmBridges.remove(remote)) {
                 releaseIfNeeded();
             }
         }
     }
-} // RemoteManager
\ No newline at end of file
+} // RemoteManager
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteMediaDrmBridge.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteMediaDrmBridge.java
@@ -11,120 +11,121 @@ final class RemoteMediaDrmBridge impleme
     private static final String LOGTAG = "GeckoRemoteMediaDrmBridge";
     private static final boolean DEBUG = false;
     private CallbacksForwarder mCallbacksFwd;
     private IMediaDrmBridge mRemote;
 
     // Forward callbacks from remote bridge stub to MediaDrmProxy.
     private static class CallbacksForwarder extends IMediaDrmBridgeCallbacks.Stub {
         private final GeckoMediaDrm.Callbacks mProxyCallbacks;
-        CallbacksForwarder(Callbacks callbacks) {
+        CallbacksForwarder(final Callbacks callbacks) {
             assertTrue(callbacks != null);
             mProxyCallbacks = callbacks;
         }
 
         @Override
-        public void onSessionCreated(int createSessionToken,
-                                     int promiseId,
-                                     byte[] sessionId,
-                                     byte[] request) {
+        public void onSessionCreated(final int createSessionToken,
+                                     final int promiseId,
+                                     final byte[] sessionId,
+                                     final byte[] request) {
             mProxyCallbacks.onSessionCreated(createSessionToken,
                                              promiseId,
                                              sessionId,
                                              request);
         }
 
         @Override
-        public void onSessionUpdated(int promiseId, byte[] sessionId) {
+        public void onSessionUpdated(final int promiseId, final byte[] sessionId) {
             mProxyCallbacks.onSessionUpdated(promiseId, sessionId);
         }
 
         @Override
-        public void onSessionClosed(int promiseId, byte[] sessionId) {
+        public void onSessionClosed(final int promiseId, final byte[] sessionId) {
             mProxyCallbacks.onSessionClosed(promiseId, sessionId);
         }
 
         @Override
-        public void onSessionMessage(byte[] sessionId,
-                                     int sessionMessageType,
-                                     byte[] request) {
+        public void onSessionMessage(final byte[] sessionId,
+                                     final int sessionMessageType,
+                                     final byte[] request) {
             mProxyCallbacks.onSessionMessage(sessionId, sessionMessageType, request);
         }
 
         @Override
-        public void onSessionError(byte[] sessionId, String message) {
+        public void onSessionError(final byte[] sessionId, final String message) {
             mProxyCallbacks.onSessionError(sessionId, message);
         }
 
         @Override
-        public void onSessionBatchedKeyChanged(byte[] sessionId,
-                                               SessionKeyInfo[] keyInfos) {
+        public void onSessionBatchedKeyChanged(final byte[] sessionId,
+                                               final SessionKeyInfo[] keyInfos) {
             mProxyCallbacks.onSessionBatchedKeyChanged(sessionId, keyInfos);
         }
 
         @Override
-        public void onRejectPromise(int promiseId, String message) {
+        public void onRejectPromise(final int promiseId, final String message) {
             mProxyCallbacks.onRejectPromise(promiseId, message);
         }
     } // CallbacksForwarder
 
-    /* package-private */ static void assertTrue(boolean condition) {
+    /* package-private */ static void assertTrue(final boolean condition) {
         if (DEBUG && !condition) {
             throw new AssertionError("Expected condition to be true");
         }
     }
 
-    public RemoteMediaDrmBridge(IMediaDrmBridge remoteBridge) {
+    public RemoteMediaDrmBridge(final IMediaDrmBridge remoteBridge) {
         assertTrue(remoteBridge != null);
         mRemote = remoteBridge;
     }
 
     @Override
-    public synchronized void setCallbacks(Callbacks callbacks) {
+    public synchronized void setCallbacks(final Callbacks callbacks) {
         if (DEBUG) Log.d(LOGTAG, "setCallbacks()");
         assertTrue(callbacks != null);
         assertTrue(mRemote != null);
 
         mCallbacksFwd = new CallbacksForwarder(callbacks);
         try {
             mRemote.setCallbacks(mCallbacksFwd);
         } catch (Exception e) {
             Log.e(LOGTAG, "Got exception during setCallbacks", e);
         }
     }
 
     @Override
-    public synchronized void createSession(int createSessionToken,
-                                           int promiseId,
-                                           String initDataType,
-                                           byte[] initData) {
+    public synchronized void createSession(final int createSessionToken,
+                                           final int promiseId,
+                                           final String initDataType,
+                                           final byte[] initData) {
         if (DEBUG) Log.d(LOGTAG, "createSession()");
 
         try {
             mRemote.createSession(createSessionToken, promiseId, initDataType, initData);
         } catch (Exception e) {
             Log.e(LOGTAG, "Got exception while creating remote session.", e);
             mCallbacksFwd.onRejectPromise(promiseId, "Failed to create session.");
         }
     }
 
     @Override
-    public synchronized void updateSession(int promiseId, String sessionId, byte[] response) {
+    public synchronized void updateSession(final int promiseId, final String sessionId,
+                                           final byte[] response) {
         if (DEBUG) Log.d(LOGTAG, "updateSession()");
 
         try {
             mRemote.updateSession(promiseId, sessionId, response);
         } catch (Exception e) {
             Log.e(LOGTAG, "Got exception while updating remote session.", e);
             mCallbacksFwd.onRejectPromise(promiseId, "Failed to update session.");
         }
     }
 
     @Override
-    public synchronized void closeSession(int promiseId, String sessionId) {
+    public synchronized void closeSession(final int promiseId, final String sessionId) {
         if (DEBUG) Log.d(LOGTAG, "closeSession()");
 
         try {
             mRemote.closeSession(promiseId, sessionId);
         } catch (Exception e) {
             Log.e(LOGTAG, "Got exception while closing remote session.", e);
             mCallbacksFwd.onRejectPromise(promiseId, "Failed to close session.");
         }
@@ -156,9 +157,8 @@ final class RemoteMediaDrmBridge impleme
         try {
             mRemote.setServerCertificate(cert);
         } catch (Exception e) {
             Log.e(LOGTAG, "Got exception while setting server certificate.", e);
             throw new RuntimeException(e);
         }
     }
 }
-
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteMediaDrmBridgeStub.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteMediaDrmBridgeStub.java
@@ -34,123 +34,123 @@ final class RemoteMediaDrmBridgeStub ext
     private String getId() {
         return mStubId;
     }
 
     private MediaCrypto getMediaCryptoFromBridge() {
         return mBridge != null ? mBridge.getMediaCrypto() : null;
     }
 
-    public static synchronized MediaCrypto getMediaCrypto(String stubId) {
+    public static synchronized MediaCrypto getMediaCrypto(final String stubId) {
         if (DEBUG) Log.d(LOGTAG, "getMediaCrypto()");
 
         for (int i = 0; i < mBridgeStubs.size(); i++) {
             if (mBridgeStubs.get(i) != null &&
                 mBridgeStubs.get(i).getId().equals(stubId)) {
                 return mBridgeStubs.get(i).getMediaCryptoFromBridge();
             }
         }
         return null;
     }
 
     // Callback to RemoteMediaDrmBridge.
     private final class Callbacks implements GeckoMediaDrm.Callbacks {
         private IMediaDrmBridgeCallbacks mRemoteCallbacks;
 
-        public Callbacks(IMediaDrmBridgeCallbacks remote) {
+        public Callbacks(final IMediaDrmBridgeCallbacks remote) {
             mRemoteCallbacks = remote;
         }
 
         @Override
-        public void onSessionCreated(int createSessionToken,
-                                     int promiseId,
-                                     byte[] sessionId,
-                                     byte[] request) {
+        public void onSessionCreated(final int createSessionToken,
+                                     final int promiseId,
+                                     final byte[] sessionId,
+                                     final byte[] request) {
             if (DEBUG) Log.d(LOGTAG, "onSessionCreated()");
             try {
                 mRemoteCallbacks.onSessionCreated(createSessionToken,
                                                   promiseId,
                                                   sessionId,
                                                   request);
             } catch (RemoteException e) {
                 Log.e(LOGTAG, "Exception ! Dead recipient !!", e);
             }
         }
 
         @Override
-        public void onSessionUpdated(int promiseId, byte[] sessionId) {
+        public void onSessionUpdated(final int promiseId, final byte[] sessionId) {
             if (DEBUG) Log.d(LOGTAG, "onSessionUpdated()");
             try {
                 mRemoteCallbacks.onSessionUpdated(promiseId, sessionId);
             } catch (RemoteException e) {
                 Log.e(LOGTAG, "Exception ! Dead recipient !!", e);
             }
         }
 
         @Override
-        public void onSessionClosed(int promiseId, byte[] sessionId) {
+        public void onSessionClosed(final int promiseId, final byte[] sessionId) {
             if (DEBUG) Log.d(LOGTAG, "onSessionClosed()");
             try {
                 mRemoteCallbacks.onSessionClosed(promiseId, sessionId);
             } catch (RemoteException e) {
                 Log.e(LOGTAG, "Exception ! Dead recipient !!", e);
             }
         }
 
         @Override
-        public void onSessionMessage(byte[] sessionId,
-                                     int sessionMessageType,
-                                     byte[] request) {
+        public void onSessionMessage(final byte[] sessionId,
+                                     final int sessionMessageType,
+                                     final byte[] request) {
             if (DEBUG) Log.d(LOGTAG, "onSessionMessage()");
             try {
                 mRemoteCallbacks.onSessionMessage(sessionId, sessionMessageType, request);
             } catch (RemoteException e) {
                 Log.e(LOGTAG, "Exception ! Dead recipient !!", e);
             }
         }
 
         @Override
-        public void onSessionError(byte[] sessionId, String message) {
+        public void onSessionError(final byte[] sessionId, final String message) {
             if (DEBUG) Log.d(LOGTAG, "onSessionError()");
             try {
                 mRemoteCallbacks.onSessionError(sessionId, message);
             } catch (RemoteException e) {
                 Log.e(LOGTAG, "Exception ! Dead recipient !!", e);
             }
         }
 
         @Override
-        public void onSessionBatchedKeyChanged(byte[] sessionId,
-                                               SessionKeyInfo[] keyInfos) {
+        public void onSessionBatchedKeyChanged(final byte[] sessionId,
+                                               final SessionKeyInfo[] keyInfos) {
             if (DEBUG) Log.d(LOGTAG, "onSessionBatchedKeyChanged()");
             try {
                 mRemoteCallbacks.onSessionBatchedKeyChanged(sessionId, keyInfos);
             } catch (RemoteException e) {
                 Log.e(LOGTAG, "Exception ! Dead recipient !!", e);
             }
         }
 
         @Override
-        public void onRejectPromise(int promiseId, String message) {
+        public void onRejectPromise(final int promiseId, final String message) {
             if (DEBUG) Log.d(LOGTAG, "onRejectPromise()");
             try {
                 mRemoteCallbacks.onRejectPromise(promiseId, message);
             } catch (RemoteException e) {
                 Log.e(LOGTAG, "Exception ! Dead recipient !!", e);
             }
         }
     }
 
-    /* package-private */ void assertTrue(boolean condition) {
+    /* package-private */ void assertTrue(final boolean condition) {
         if (DEBUG && !condition) {
             throw new AssertionError("Expected condition to be true");
         }
     }
 
-    RemoteMediaDrmBridgeStub(String keySystem, String stubId) throws RemoteException {
+    RemoteMediaDrmBridgeStub(final String keySystem, final String stubId) throws RemoteException {
         if (Build.VERSION.SDK_INT < 21) {
             Log.e(LOGTAG, "Pre-Lollipop should never enter here!!");
             throw new RemoteException("Error, unsupported version!");
         }
         try {
             if (Build.VERSION.SDK_INT < 23) {
                 mBridge = new GeckoMediaDrmBridgeV21(keySystem);
             } else {
@@ -159,61 +159,63 @@ final class RemoteMediaDrmBridgeStub ext
             mStubId = stubId;
             mBridgeStubs.add(this);
         } catch (Exception e) {
             throw new RemoteException("RemoteMediaDrmBridgeStub cannot create bridge implementation.");
         }
     }
 
     @Override
-    public synchronized void setCallbacks(IMediaDrmBridgeCallbacks callbacks) throws RemoteException {
+    public synchronized void setCallbacks(final IMediaDrmBridgeCallbacks callbacks)
+            throws RemoteException {
         if (DEBUG) Log.d(LOGTAG, "setCallbacks()");
         assertTrue(mBridge != null);
         assertTrue(callbacks != null);
         mCallbacks = callbacks;
         callbacks.asBinder().linkToDeath(this, 0);
         mBridge.setCallbacks(new Callbacks(mCallbacks));
     }
 
     @Override
-    public synchronized void createSession(int createSessionToken,
-                                           int promiseId,
-                                           String initDataType,
-                                           byte[] initData) throws RemoteException {
+    public synchronized void createSession(final int createSessionToken,
+                                           final int promiseId,
+                                           final String initDataType,
+                                           final byte[] initData) throws RemoteException {
         if (DEBUG) Log.d(LOGTAG, "createSession()");
         try {
             assertTrue(mCallbacks != null);
             assertTrue(mBridge != null);
             mBridge.createSession(createSessionToken,
                                   promiseId,
                                   initDataType,
                                   initData);
         } catch (Exception e) {
             Log.e(LOGTAG, "Failed to createSession.", e);
             mCallbacks.onRejectPromise(promiseId, "Failed to createSession.");
         }
     }
 
     @Override
-    public synchronized void updateSession(int promiseId,
-                                           String sessionId,
-                                           byte[] response) throws RemoteException {
+    public synchronized void updateSession(final int promiseId,
+                                           final String sessionId,
+                                           final byte[] response) throws RemoteException {
         if (DEBUG) Log.d(LOGTAG, "updateSession()");
         try {
             assertTrue(mCallbacks != null);
             assertTrue(mBridge != null);
             mBridge.updateSession(promiseId, sessionId, response);
         } catch (Exception e) {
             Log.e(LOGTAG, "Failed to updateSession.", e);
             mCallbacks.onRejectPromise(promiseId, "Failed to updateSession.");
         }
     }
 
     @Override
-    public synchronized void closeSession(int promiseId, String sessionId) throws RemoteException {
+    public synchronized void closeSession(final int promiseId, final String sessionId)
+            throws RemoteException {
         if (DEBUG) Log.d(LOGTAG, "closeSession()");
         try {
             assertTrue(mCallbacks != null);
             assertTrue(mBridge != null);
             mBridge.closeSession(promiseId, sessionId);
         } catch (Exception e) {
             Log.e(LOGTAG, "Failed to closeSession.", e);
             mCallbacks.onRejectPromise(promiseId, "Failed to closeSession.");
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/Sample.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/Sample.java
@@ -32,108 +32,111 @@ public final class Sample implements Par
         void dispose();
     }
 
     private static final class ArrayBuffer implements Buffer {
         private byte[] mArray;
 
         public static final Creator<ArrayBuffer> CREATOR = new Creator<ArrayBuffer>() {
             @Override
-            public ArrayBuffer createFromParcel(Parcel in) {
+            public ArrayBuffer createFromParcel(final Parcel in) {
                 return new ArrayBuffer(in);
             }
 
             @Override
-            public ArrayBuffer[] newArray(int size) {
+            public ArrayBuffer[] newArray(final int size) {
                 return new ArrayBuffer[size];
             }
         };
 
-        private ArrayBuffer(Parcel in) {
+        private ArrayBuffer(final Parcel in) {
             mArray = in.createByteArray();
         }
 
-        private ArrayBuffer(byte[] bytes) { mArray = bytes; }
+        private ArrayBuffer(final byte[] bytes) { mArray = bytes; }
 
         @Override
         public int describeContents() { return 0; }
 
         @Override
-        public void writeToParcel(Parcel dest, int flags) {
+        public void writeToParcel(final Parcel dest, final int flags) {
             dest.writeByteArray(mArray);
         }
 
         @Override
         public int capacity() {
             return mArray != null ? mArray.length : 0;
         }
 
         @Override
-        public void readFromByteBuffer(ByteBuffer src, int offset, int size) throws IOException {
+        public void readFromByteBuffer(final ByteBuffer src, final int offset, final int size)
+                throws IOException {
             src.position(offset);
             if (mArray == null || mArray.length != size) {
                 mArray = new byte[size];
             }
             src.get(mArray, 0, size);
         }
 
         @Override
-        public void writeToByteBuffer(ByteBuffer dest, int offset, int size) throws IOException {
+        public void writeToByteBuffer(final ByteBuffer dest, final int offset, final int size)
+                throws IOException {
             dest.put(mArray, offset, size);
         }
 
         @Override
         public void dispose() {
             mArray = null;
         }
     }
 
     public Buffer buffer;
     @WrapForJNI
     public BufferInfo info;
     public CryptoInfo cryptoInfo;
 
     public static Sample create() { return create(null, new BufferInfo(), null); }
 
-    public static Sample create(ByteBuffer src, BufferInfo info, CryptoInfo cryptoInfo) {
+    public static Sample create(final ByteBuffer src, final BufferInfo info,
+                                final CryptoInfo cryptoInfo) {
         ArrayBuffer buffer = new ArrayBuffer(byteArrayFromBuffer(src, info.offset, info.size));
 
         BufferInfo bufferInfo = new BufferInfo();
         bufferInfo.set(0, info.size, info.presentationTimeUs, info.flags);
 
         return new Sample(buffer, bufferInfo, cryptoInfo);
     }
 
-    public static Sample create(SharedMemory sharedMem) {
+    public static Sample create(final SharedMemory sharedMem) {
         return new Sample(new SharedMemBuffer(sharedMem), new BufferInfo(), null);
     }
 
-    private Sample(Buffer bytes, BufferInfo info, CryptoInfo cryptoInfo) {
+    private Sample(final Buffer bytes, final BufferInfo info, final CryptoInfo cryptoInfo) {
         buffer = bytes;
         this.info = info;
         this.cryptoInfo = cryptoInfo;
     }
 
-    private Sample(Parcel in) {
+    private Sample(final Parcel in) {
         readInfo(in);
         readCrypto(in);
         buffer = in.readParcelable(Sample.class.getClassLoader());
     }
 
-    private void readInfo(Parcel in) {
+    private void readInfo(final Parcel in) {
         int offset = in.readInt();
         int size = in.readInt();
         long pts = in.readLong();
         int flags = in.readInt();
 
         info = new BufferInfo();
         info.set(offset, size, pts, flags);
     }
 
-    private void readCrypto(Parcel in) {
+    private void readCrypto(final Parcel in) {
         int hasCryptoInfo = in.readInt();
         if (hasCryptoInfo == 0) {
             return;
         }
 
         byte[] iv = in.createByteArray();
         byte[] key = in.createByteArray();
         int mode = in.readInt();
@@ -145,17 +148,18 @@ public final class Sample implements Par
         cryptoInfo.set(numSubSamples,
                       numBytesOfClearData,
                       numBytesOfEncryptedData,
                       key,
                       iv,
                       mode);
     }
 
-    public Sample set(ByteBuffer bytes, BufferInfo info, CryptoInfo cryptoInfo) throws IOException {
+    public Sample set(final ByteBuffer bytes, final BufferInfo info, final CryptoInfo cryptoInfo)
+            throws IOException {
         if (bytes != null && info.size > 0) {
             buffer.readFromByteBuffer(bytes, info.offset, info.size);
         }
         this.info.set(0, info.size, info.presentationTimeUs, info.flags);
         this.cryptoInfo = cryptoInfo;
 
         return this;
     }
@@ -175,75 +179,76 @@ public final class Sample implements Par
 
     public boolean isEOS() {
         return (this == EOS) ||
                 ((info.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0);
     }
 
     public static final Creator<Sample> CREATOR = new Creator<Sample>() {
         @Override
-        public Sample createFromParcel(Parcel in) {
+        public Sample createFromParcel(final Parcel in) {
             return new Sample(in);
         }
 
         @Override
-        public Sample[] newArray(int size) {
+        public Sample[] newArray(final int size) {
             return new Sample[size];
         }
     };
 
     @Override
     public int describeContents() {
         return 0;
     }
 
     @Override
-    public void writeToParcel(Parcel dest, int parcelableFlags) {
+    public void writeToParcel(final Parcel dest, final int parcelableFlags) {
         writeInfo(dest);
         writeCrypto(dest);
         dest.writeParcelable(buffer, parcelableFlags);
     }
 
-    private void writeInfo(Parcel dest) {
+    private void writeInfo(final Parcel dest) {
         dest.writeInt(info.offset);
         dest.writeInt(info.size);
         dest.writeLong(info.presentationTimeUs);
         dest.writeInt(info.flags);
     }
 
-    private void writeCrypto(Parcel dest) {
+    private void writeCrypto(final Parcel dest) {
         if (cryptoInfo != null) {
             dest.writeInt(1);
             dest.writeByteArray(cryptoInfo.iv);
             dest.writeByteArray(cryptoInfo.key);
             dest.writeInt(cryptoInfo.mode);
             dest.writeIntArray(cryptoInfo.numBytesOfClearData);
             dest.writeIntArray(cryptoInfo.numBytesOfEncryptedData);
             dest.writeInt(cryptoInfo.numSubSamples);
         } else {
             dest.writeInt(0);
         }
     }
 
-    public static byte[] byteArrayFromBuffer(ByteBuffer buffer, int offset, int size) {
+    public static byte[] byteArrayFromBuffer(final ByteBuffer buffer, final int offset,
+                                             final int size) {
         if (buffer == null || buffer.capacity() == 0 || size == 0) {
             return null;
         }
         if (buffer.hasArray() && offset == 0 && buffer.array().length == size) {
             return buffer.array();
         }
         int length = Math.min(offset + size, buffer.capacity()) - offset;
         byte[] bytes = new byte[length];
         buffer.position(offset);
         buffer.get(bytes);
         return bytes;
     }
 
     @WrapForJNI
-    public void writeToByteBuffer(ByteBuffer dest) throws IOException {
+    public void writeToByteBuffer(final ByteBuffer dest) throws IOException {
         if (buffer != null && dest != null && info.size > 0) {
             buffer.writeToByteBuffer(dest, info.offset, info.size);
         }
     }
 
     @Override
     public String toString() {
         if (isEOS()) {
@@ -255,9 +260,9 @@ public final class Sample implements Par
                 append(", info=").
                 append("{ offset=").append(info.offset).
                 append(", size=").append(info.size).
                 append(", pts=").append(info.presentationTimeUs).
                 append(", flags=").append(Integer.toHexString(info.flags)).append(" }").
                 append(" }");
             return str.toString();
     }
-}
\ No newline at end of file
+}
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SamplePool.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SamplePool.java
@@ -15,52 +15,52 @@ import java.util.List;
 final class SamplePool {
     private static final class Impl {
         private final String mName;
         private int mNextId = 0;
         private int mDefaultBufferSize = 4096;
         private final List<Sample> mRecycledSamples = new ArrayList<>();
         private final boolean mBufferless;
 
-        private Impl(String name, boolean bufferless) {
+        private Impl(final String name, final boolean bufferless) {
             mName = name;
             mBufferless = bufferless;
         }
 
-        private void setDefaultBufferSize(int size) {
+        private void setDefaultBufferSize(final int size) {
             if (mBufferless) {
                 throw new IllegalStateException("Setting buffer size of a bufferless pool is not allowed");
             }
             mDefaultBufferSize = size;
         }
 
-        private synchronized Sample obtain(int size) {
+        private synchronized Sample obtain(final int size) {
             if (!mRecycledSamples.isEmpty()) {
                 return mRecycledSamples.remove(0);
             }
 
             if (mBufferless) {
                 return Sample.create();
             } else {
                 return allocateSharedMemorySample(size);
             }
         }
 
-        private Sample allocateSharedMemorySample(int size) {
+        private Sample allocateSharedMemorySample(final int size) {
             SharedMemory shm = null;
             try {
                 shm = new SharedMemory(mNextId++, Math.max(size, mDefaultBufferSize));
             } catch (NoSuchMethodException | IOException e) {
                 throw new UnsupportedOperationException(e);
             }
 
             return Sample.create(shm);
         }
 
-        private synchronized void recycle(Sample recycled) {
+        private synchronized void recycle(final Sample recycled) {
             if (mBufferless || recycled.buffer.capacity() >= mDefaultBufferSize) {
                 mRecycledSamples.add(recycled);
             } else {
                 recycled.dispose();
             }
         }
 
         private synchronized void clear() {
@@ -75,48 +75,48 @@ final class SamplePool {
         protected void finalize() {
             clear();
         }
     }
 
     private final Impl mInputs;
     private final Impl mOutputs;
 
-    /* package */ SamplePool(String name, boolean renderToSurface) {
+    /* package */ SamplePool(final String name, final boolean renderToSurface) {
         mInputs = new Impl(name + " input sample pool", false);
         // Buffers are useless when rendering to surface.
         mOutputs = new Impl(name + " output sample pool", renderToSurface);
     }
 
-    /* package */ void setInputBufferSize(int size) {
+    /* package */ void setInputBufferSize(final int size) {
         mInputs.setDefaultBufferSize(size);
     }
 
-    /* package */ void setOutputBufferSize(int size) {
+    /* package */ void setOutputBufferSize(final int size) {
         mOutputs.setDefaultBufferSize(size);
     }
 
-    /* package */ Sample obtainInput(int size) {
+    /* package */ Sample obtainInput(final int size) {
         Sample input = mInputs.obtain(size);
         input.info.set(0, 0, 0, 0);
         return input;
     }
 
-    /* package */ Sample obtainOutput(MediaCodec.BufferInfo info) {
+    /* package */ Sample obtainOutput(final MediaCodec.BufferInfo info) {
         Sample output = mOutputs.obtain(info.size);
         output.info.set(0, info.size, info.presentationTimeUs, info.flags);
         return output;
     }
 
-    /* package */ void recycleInput(Sample sample) {
+    /* package */ void recycleInput(final Sample sample) {
         sample.cryptoInfo = null;
         mInputs.recycle(sample);
     }
 
-    /* package */ void recycleOutput(Sample sample) {
+    /* package */ void recycleOutput(final Sample sample) {
         mOutputs.recycle(sample);
     }
 
     /* package */ void reset() {
         mInputs.clear();
         mOutputs.clear();
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SessionKeyInfo.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SessionKeyInfo.java
@@ -11,41 +11,41 @@ import org.mozilla.gecko.annotation.Wrap
 public final class SessionKeyInfo implements Parcelable {
     @WrapForJNI
     public byte[] keyId;
 
     @WrapForJNI
     public int status;
 
     @WrapForJNI
-    public SessionKeyInfo(byte[] keyId, int status) {
+    public SessionKeyInfo(final byte[] keyId, final int status) {
         this.keyId = keyId;
         this.status = status;
     }
 
     @Override
     public int describeContents() {
         return 0;
     }
 
     @Override
-    public void writeToParcel(Parcel dest, int parcelableFlags) {
+    public void writeToParcel(final Parcel dest, final int parcelableFlags) {
         dest.writeByteArray(keyId);
         dest.writeInt(status);
     }
 
     public static final Creator<SessionKeyInfo> CREATOR = new Creator<SessionKeyInfo>() {
         @Override
-        public SessionKeyInfo createFromParcel(Parcel in) {
+        public SessionKeyInfo createFromParcel(final Parcel in) {
             return new SessionKeyInfo(in);
         }
 
         @Override
-        public SessionKeyInfo[] newArray(int size) {
+        public SessionKeyInfo[] newArray(final int size) {
             return new SessionKeyInfo[size];
         }
     };
 
-    private SessionKeyInfo(Parcel src) {
+    private SessionKeyInfo(final Parcel src) {
         keyId = src.createByteArray();
         status = src.readInt();
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SharedMemBuffer.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SharedMemBuffer.java
@@ -10,67 +10,69 @@ import org.mozilla.gecko.media.Sample;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
 
 public final class SharedMemBuffer implements Sample.Buffer {
     private SharedMemory mSharedMem;
 
     /* package */
-    public SharedMemBuffer(SharedMemory sharedMem) {
+    public SharedMemBuffer(final SharedMemory sharedMem) {
         mSharedMem = sharedMem;
     }
 
-    protected SharedMemBuffer(Parcel in) {
+    protected SharedMemBuffer(final Parcel in) {
         mSharedMem = in.readParcelable(Sample.class.getClassLoader());
     }
 
     @Override
-    public void writeToParcel(Parcel dest, int flags) {
+    public void writeToParcel(final Parcel dest, final int flags) {
         dest.writeParcelable(mSharedMem, flags);
     }
 
     @Override
     public int describeContents() {
         return 0;
     }
 
     public static final Creator<SharedMemBuffer> CREATOR = new Creator<SharedMemBuffer>() {
         @Override
-        public SharedMemBuffer createFromParcel(Parcel in) {
+        public SharedMemBuffer createFromParcel(final Parcel in) {
             return new SharedMemBuffer(in);
         }
 
         @Override
-        public SharedMemBuffer[] newArray(int size) {
+        public SharedMemBuffer[] newArray(final int size) {
             return new SharedMemBuffer[size];
         }
     };
 
     @Override
     public int capacity() {
         return mSharedMem != null ? mSharedMem.getSize() : 0;
     }
 
     @Override
-    public void readFromByteBuffer(ByteBuffer src, int offset, int size) throws IOException {
+    public void readFromByteBuffer(final ByteBuffer src, final int offset, final int size)
+            throws IOException {
         if (!src.isDirect()) {
             throw new IOException("SharedMemBuffer only support reading from direct byte buffer.");
         }
         try {
             nativeReadFromDirectBuffer(src, mSharedMem.getPointer(), offset, size);
         } catch (NullPointerException e) {
             throw new IOException(e);
         }
     }
 
     private native static void nativeReadFromDirectBuffer(ByteBuffer src, long dest, int offset, int size);
 
     @Override
-    public void writeToByteBuffer(ByteBuffer dest, int offset, int size) throws IOException {
+    public void writeToByteBuffer(final ByteBuffer dest, final int offset, final int size)
+            throws IOException {
         if (!dest.isDirect()) {
             throw new IOException("SharedMemBuffer only support writing to direct byte buffer.");
         }
         try {
             nativeWriteToDirectBuffer(mSharedMem.getPointer(), dest, offset, size);
         } catch (NullPointerException e) {
             throw new IOException(e);
         }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/Utils.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/Utils.java
@@ -24,18 +24,18 @@ public class Utils {
                 + ":(group)" + gname);
     }
 
     public static void logThreadSignature() {
         Log.d("ThreadUtils", getThreadSignature());
     }
 
     private final static char[] hexArray = "0123456789ABCDEF".toCharArray();
-    public static String bytesToHex(byte[] bytes) {
+    public static String bytesToHex(final byte[] bytes) {
         char[] hexChars = new char[bytes.length * 2];
         for ( int j = 0; j < bytes.length; j++ ) {
             int v = bytes[j] & 0xFF;
             hexChars[j * 2] = hexArray[v >>> 4];
             hexChars[j * 2 + 1] = hexArray[v & 0x0F];
         }
         return new String(hexChars);
     }
-}
\ No newline at end of file
+}
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/ByteBufferInputStream.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/ByteBufferInputStream.java
@@ -9,17 +9,17 @@ import java.io.InputStream;
 import java.nio.ByteBuffer;
 
 class ByteBufferInputStream extends InputStream {
 
     protected ByteBuffer mBuf;
     // Reference to a native object holding the data backing the ByteBuffer.
     private final NativeReference mNativeRef;
 
-    protected ByteBufferInputStream(ByteBuffer buffer, NativeReference ref) {
+    protected ByteBufferInputStream(final ByteBuffer buffer, final NativeReference ref) {
         mBuf = buffer;
         mNativeRef = ref;
     }
 
     @Override
     public int available() {
         return mBuf.remaining();
     }
@@ -35,28 +35,28 @@ class ByteBufferInputStream extends Inpu
         if (!mBuf.hasRemaining() || mNativeRef.isReleased()) {
             return -1;
         }
 
         return mBuf.get() & 0xff; // Avoid sign extension
     }
 
     @Override
-    public int read(byte[] buffer, int offset, int length) {
+    public int read(final byte[] buffer, final int offset, final int length) {
         if (!mBuf.hasRemaining() || mNativeRef.isReleased()) {
             return -1;
         }
 
         int remainingLength = Math.min(length, mBuf.remaining());
         mBuf.get(buffer, offset, remainingLength);
         return length;
     }
 
     @Override
-    public long skip(long byteCount) {
+    public long skip(final long byteCount) {
         if (byteCount < 0 || mNativeRef.isReleased()) {
             return 0;
         }
 
         long remainingByteCount = Math.min(byteCount, mBuf.remaining());
         mBuf.position(mBuf.position() + (int) remainingByteCount);
         return remainingByteCount;
     }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/DirectBufferAllocator.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/DirectBufferAllocator.java
@@ -11,34 +11,34 @@ import java.nio.ByteBuffer;
 // We must manually allocate direct buffers in JNI to work around a bug where Honeycomb's
 // ByteBuffer.allocateDirect() grossly overallocates the direct buffer size.
 // https://code.google.com/p/android/issues/detail?id=16941
 //
 
 public final class DirectBufferAllocator {
     private DirectBufferAllocator() {}
 
-    public static ByteBuffer allocate(int size) {
+    public static ByteBuffer allocate(final int size) {
         if (size <= 0) {
             throw new IllegalArgumentException("Invalid size " + size);
         }
 
         ByteBuffer directBuffer = nativeAllocateDirectBuffer(size);
         if (directBuffer == null) {
             throw new OutOfMemoryError("allocateDirectBuffer() returned null");
         }
 
         if (!directBuffer.isDirect()) {
             throw new AssertionError("allocateDirectBuffer() did not return a direct buffer");
         }
 
         return directBuffer;
     }
 
-    public static ByteBuffer free(ByteBuffer buffer) {
+    public static ByteBuffer free(final ByteBuffer buffer) {
         if (buffer == null) {
             return null;
         }
 
         if (!buffer.isDirect()) {
             throw new IllegalArgumentException("buffer must be direct");
         }
 
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java
@@ -35,24 +35,24 @@ public final class GeckoLoader {
     private static boolean sSQLiteLibsLoaded;
     private static boolean sNSSLibsLoaded;
     private static boolean sMozGlueLoaded;
 
     private GeckoLoader() {
         // prevent instantiation
     }
 
-    public static File getCacheDir(Context context) {
+    public static File getCacheDir(final Context context) {
         if (sCacheFile == null) {
             sCacheFile = context.getCacheDir();
         }
         return sCacheFile;
     }
 
-    public static File getGREDir(Context context) {
+    public static File getGREDir(final Context context) {
         if (sGREDir == null) {
             sGREDir = new File(context.getApplicationInfo().dataDir);
         }
         return sGREDir;
     }
 
     private static void setupDownloadEnvironment(final Context context) {
         try {
@@ -66,27 +66,27 @@ public final class GeckoLoader {
             }
             putenv("DOWNLOADS_DIRECTORY=" + downloadDir.getPath());
             putenv("UPDATES_DIRECTORY="   + updatesDir.getPath());
         } catch (Exception e) {
             Log.w(LOGTAG, "No download directory found.", e);
         }
     }
 
-    private static void delTree(File file) {
+    private static void delTree(final File file) {
         if (file.isDirectory()) {
             File children[] = file.listFiles();
             for (File child : children) {
                 delTree(child);
             }
         }
         file.delete();
     }
 
-    private static File getTmpDir(Context context) {
+    private static File getTmpDir(final Context context) {
         File tmpDir = context.getDir("tmpdir", Context.MODE_PRIVATE);
         // check if the old tmp dir is there
         File oldDir = new File(tmpDir.getParentFile(), "app_tmp");
         if (oldDir.exists()) {
             delTree(oldDir);
         }
         return tmpDir;
     }
@@ -180,17 +180,17 @@ public final class GeckoLoader {
         putenv("MOZ_ANDROID_CPU_ABI=" + Build.CPU_ABI);
 
         setupInitialPrefs(prefs);
 
         // env from extras could have reset out linker flags; set them again.
         loadLibsSetupLocked(context);
     }
 
-    private static void loadLibsSetupLocked(Context context) {
+    private static void loadLibsSetupLocked(final Context context) {
         putenv("GRE_HOME=" + getGREDir(context).getPath());
         putenv("MOZ_ANDROID_LIBDIR=" + context.getApplicationInfo().nativeLibraryDir);
     }
 
     @RobocopTarget
     public synchronized static void loadSQLiteLibs(final Context context) {
         if (sSQLiteLibsLoaded) {
             return;
@@ -221,17 +221,18 @@ public final class GeckoLoader {
     /**
      * Copy a library out of our APK.
      *
      * @param context a Context.
      * @param lib the name of the library; e.g., "mozglue".
      * @param outDir the output directory for the .so. No trailing slash.
      * @return true on success, false on failure.
      */
-    private static boolean extractLibrary(final Context context, final String lib, final String outDir) {
+    private static boolean extractLibrary(final Context context, final String lib,
+                                          final String outDir) {
         final String apkPath = context.getApplicationInfo().sourceDir;
 
         // Sanity check.
         if (!apkPath.endsWith(".apk")) {
             Log.w(LOGTAG, "sourceDir is not an APK.");
             return false;
         }
 
@@ -253,17 +254,18 @@ public final class GeckoLoader {
             }
             return false;
         } else {
             final String abi = getCPUABI();
             return tryLoadWithABI(lib, outDir, apkPath, abi);
         }
     }
 
-    private static boolean tryLoadWithABI(String lib, String outDir, String apkPath, String abi) {
+    private static boolean tryLoadWithABI(final String lib, final String outDir,
+                                          final String apkPath, final String abi) {
         try {
             final ZipFile zipFile = new ZipFile(new File(apkPath));
             try {
                 final String libPath = "lib/" + abi + "/lib" + lib + ".so";
                 final ZipEntry entry = zipFile.getEntry(libPath);
                 if (entry == null) {
                     Log.w(LOGTAG, libPath + " not found in APK " + apkPath);
                     return false;
@@ -474,17 +476,17 @@ public final class GeckoLoader {
 
     public synchronized static void loadGeckoLibs(final Context context) {
         loadLibsSetupLocked(context);
         loadGeckoLibsNative();
     }
 
     @SuppressWarnings("serial")
     public static class AbortException extends Exception {
-        public AbortException(String msg) {
+        public AbortException(final String msg) {
             super(msg);
         }
     }
 
     @JNITarget
     public static void abort(final String msg) {
         final Thread thread = Thread.currentThread();
         final Thread.UncaughtExceptionHandler uncaughtHandler =
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/NativeZip.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/NativeZip.java
@@ -16,21 +16,21 @@ import java.util.zip.InflaterInputStream
 public class NativeZip implements NativeReference {
     private static final int DEFLATE = 8;
     private static final int STORE = 0;
 
     private volatile long mObj;
     @Keep
     private InputStream mInput;
 
-    public NativeZip(String path) {
+    public NativeZip(final String path) {
         mObj = getZip(path);
     }
 
-    public NativeZip(InputStream input) {
+    public NativeZip(final InputStream input) {
         if (!(input instanceof ByteBufferInputStream)) {
             throw new IllegalArgumentException("Got " + input.getClass()
                                                + ", but expected ByteBufferInputStream!");
         }
         ByteBufferInputStream bbinput = (ByteBufferInputStream)input;
         mObj = getZipFromByteBuffer(bbinput.mBuf);
         mInput = input;
     }
@@ -49,31 +49,31 @@ public class NativeZip implements Native
         mInput = null;
     }
 
     @Override
     public boolean isReleased() {
         return (mObj == 0);
     }
 
-    public InputStream getInputStream(String path) {
+    public InputStream getInputStream(final String path) {
         if (isReleased()) {
             throw new IllegalStateException("Can't get path \"" + path
                                             + "\" because NativeZip is closed!");
         }
         return _getInputStream(mObj, path);
     }
 
     private static native long getZip(String path);
     private static native long getZipFromByteBuffer(ByteBuffer buffer);
     private static native void _release(long obj);
     private native InputStream _getInputStream(long obj, String path);
 
     @JNITarget
-    private InputStream createInputStream(ByteBuffer buffer, int compression) {
+    private InputStream createInputStream(final ByteBuffer buffer, final int compression) {
         if (compression != STORE && compression != DEFLATE) {
             throw new IllegalArgumentException("Unexpected compression: " + compression);
         }
 
         InputStream input = new ByteBufferInputStream(buffer, this);
         if (compression == DEFLATE) {
             Inflater inflater = new Inflater(true);
             input = new InflaterInputStream(input, inflater);
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/SafeIntent.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/SafeIntent.java
@@ -25,17 +25,17 @@ public class SafeIntent {
 
     private final Intent intent;
 
     public SafeIntent(final Intent intent) {
         stripDataUri(intent);
         this.intent = intent;
     }
 
-    public boolean hasExtra(String name) {
+    public boolean hasExtra(final String name) {
         try {
             return intent.hasExtra(name);
         } catch (OutOfMemoryError e) {
             Log.w(LOGTAG, "Couldn't determine if intent had an extra: OOM. Malformed?");
             return false;
         } catch (RuntimeException e) {
             Log.w(LOGTAG, "Couldn't determine if intent had an extra.", e);
             return false;
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/SharedMemory.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/SharedMemory.java
@@ -30,48 +30,48 @@ public class SharedMemory implements Par
         try {
             method = MemoryFile.class.getDeclaredMethod("getFileDescriptor");
         } catch (NoSuchMethodException e) {
             e.printStackTrace();
         }
         sGetFDMethod = method;
     }
 
-    private SharedMemory(Parcel in) {
+    private SharedMemory(final Parcel in) {
         mDescriptor = in.readFileDescriptor();
         mSize = in.readInt();
         mId = in.readInt();
     }
 
     public static final Creator<SharedMemory> CREATOR = new Creator<SharedMemory>() {
         @Override
-        public SharedMemory createFromParcel(Parcel in) {
+        public SharedMemory createFromParcel(final Parcel in) {
             return new SharedMemory(in);
         }
 
         @Override
-        public SharedMemory[] newArray(int size) {
+        public SharedMemory[] newArray(final int size) {
             return new SharedMemory[size];
         }
     };
 
     @Override
     public int describeContents() {
         return CONTENTS_FILE_DESCRIPTOR;
     }
 
     @Override
-    public void writeToParcel(Parcel dest, int flags) {
+    public void writeToParcel(final Parcel dest, final int flags) {
         // We don't want ParcelFileDescriptor.writeToParcel() to close the fd.
         dest.writeFileDescriptor(mDescriptor.getFileDescriptor());
         dest.writeInt(mSize);
         dest.writeInt(mId);
     }
 
-    public SharedMemory(int id, int size) throws NoSuchMethodException, IOException {
+    public SharedMemory(final int id, final int size) throws NoSuchMethodException, IOException {
         if (sGetFDMethod == null) {
             throw new NoSuchMethodException("MemoryFile.getFileDescriptor() doesn't exist.");
         }
         mBackedFile = new MemoryFile(null, size);
         try {
             FileDescriptor fd = (FileDescriptor)sGetFDMethod.invoke(mBackedFile);
             mDescriptor = ParcelFileDescriptor.dup(fd);
             mSize = size;
@@ -162,17 +162,17 @@ public class SharedMemory implements Par
     }
 
     @Override
     public String toString() {
         return "SHM(" + getSize() + " bytes): id=" + mId + ", backing=" + mBackedFile + ",fd=" + mDescriptor;
     }
 
     @Override
-    public boolean equals(Object that) {
+    public boolean equals(final Object that) {
         return (this == that) ||
                 ((that instanceof SharedMemory) && (hashCode() == that.hashCode()));
     }
 
     @Override
     public int hashCode() {
         return mId;
     }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/permissions/PermissionBlock.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/permissions/PermissionBlock.java
@@ -20,25 +20,25 @@ public class PermissionBlock {
     private Context context;
     private String[] permissions;
     private boolean onUIThread;
     private boolean onBackgroundThread;
     private Runnable onPermissionsGranted;
     private Runnable onPermissionsDenied;
     private boolean doNotPrompt;
 
-    /* package-private */ PermissionBlock(Context context, PermissionsHelper helper) {
+    /* package-private */ PermissionBlock(final Context context, final PermissionsHelper helper) {
         this.context = context;
         this.helper = helper;
     }
 
     /**
      * Determine whether the app has been granted the specified permissions.
      */
-    public PermissionBlock withPermissions(@NonNull String... permissions) {
+    public PermissionBlock withPermissions(final @NonNull String... permissions) {
         this.permissions = permissions;
         return this;
     }
 
     /**
      * Execute all callbacks on the UI thread.
      */
     public PermissionBlock onUIThread() {
@@ -63,17 +63,17 @@ public class PermissionBlock {
         doNotPrompt = true;
         return this;
     }
 
     /**
      * If the condition is true then do not prompt the user to accept the permission if it has not
      * been granted yet.
      */
-    public PermissionBlock doNotPromptIf(boolean condition) {
+    public PermissionBlock doNotPromptIf(final boolean condition) {
         if (condition) {
             doNotPrompt();
         }
 
         return this;
     }
 
     /**
@@ -82,17 +82,17 @@ public class PermissionBlock {
     public void run() {
         run(null);
     }
 
     /**
      * Execute the specified runnable if the app has been granted all permissions. Calling this method will prompt the
      * user if needed.
      */
-    public void run(Runnable onPermissionsGranted) {
+    public void run(final Runnable onPermissionsGranted) {
         if (!doNotPrompt && !(context instanceof Activity)) {
             throw new IllegalStateException("You need to either specify doNotPrompt() or pass in an Activity context");
         }
 
         this.onPermissionsGranted = onPermissionsGranted;
 
         if (hasPermissions(context)) {
             onPermissionsGranted();
@@ -104,30 +104,30 @@ public class PermissionBlock {
 
         // This reference is no longer needed. Let's clear it now to avoid memory leaks.
         context = null;
     }
 
     /**
      * Execute this fallback if at least one permission has not been granted.
      */
-    public PermissionBlock andFallback(@NonNull Runnable onPermissionsDenied) {
+    public PermissionBlock andFallback(final @NonNull Runnable onPermissionsDenied) {
         this.onPermissionsDenied = onPermissionsDenied;
         return this;
     }
 
     /* package-private */ void onPermissionsGranted() {
         executeRunnable(onPermissionsGranted);
     }
 
     /* package-private */ void onPermissionsDenied() {
         executeRunnable(onPermissionsDenied);
     }
 
-    private void executeRunnable(Runnable runnable) {
+    private void executeRunnable(final Runnable runnable) {
         if (runnable == null) {
             return;
         }
 
         if (onUIThread && onBackgroundThread) {
             throw new IllegalStateException("Cannot run callback on more than one thread");
         }
 
@@ -139,12 +139,12 @@ public class PermissionBlock {
             runnable.run();
         }
     }
 
     /* package-private */ String[] getPermissions() {
         return permissions;
     }
 
-    /* package-private */ boolean hasPermissions(Context context) {
+    /* package-private */ boolean hasPermissions(final Context context) {
         return helper.hasPermissions(context, permissions);
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/permissions/Permissions.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/permissions/Permissions.java
@@ -47,27 +47,27 @@ public class Permissions {
     private static PermissionsHelper permissionHelper = new PermissionsHelper();
 
     /**
      * Entry point for checking (and optionally prompting for) runtime permissions.
      *
      * Note: The provided context needs to be an Activity context in order to prompt. Use doNotPrompt()
      * for all other contexts.
      */
-    public static PermissionBlock from(@NonNull Context context) {
+    public static PermissionBlock from(final @NonNull Context context) {
         return new PermissionBlock(context, permissionHelper);
     }
 
     /**
      * This method will block until the specified permissions have been granted or denied by the user.
      * If needed the user will be prompted.
      *
      * @return true if all of the permissions have been granted. False if any of the permissions have been denied.
      */
-    public static boolean waitFor(@NonNull Activity activity, String... permissions) {
+    public static boolean waitFor(final @NonNull Activity activity, final String... permissions) {
         ThreadUtils.assertNotOnUiThread(); // We do not want to block the UI thread.
 
         // This task will block until all of the permissions have been granted
         final FutureTask<Boolean> blockingTask = new FutureTask<>(new Callable<Boolean>() {
             @Override
             public Boolean call() throws Exception {
                 return true;
             }
@@ -91,58 +91,64 @@ public class Permissions {
         } catch (InterruptedException | ExecutionException | CancellationException e) {
             return false;
         }
     }
 
     /**
      * Determine whether you have been granted particular permissions.
      */
-    public static boolean has(Context context, String... permissions) {
+    public static boolean has(final Context context, final String... permissions) {
         return permissionHelper.hasPermissions(context, permissions);
     }
 
-    /* package-private */ static void setPermissionHelper(PermissionsHelper permissionHelper) {
+    /* package-private */ static void setPermissionHelper(final PermissionsHelper permissionHelper) {
         Permissions.permissionHelper = permissionHelper;
     }
 
     /**
      * Callback for Activity.onRequestPermissionsResult(). All activities that prompt for permissions using this class
      * should implement onRequestPermissionsResult() and call this method.
      */
-    public static synchronized void onRequestPermissionsResult(@NonNull Activity activity, @NonNull String[] permissions, @NonNull int[] grantResults) {
+    public static synchronized void onRequestPermissionsResult(final @NonNull Activity activity,
+                                                               final @NonNull String[] permissions,
+                                                               final @NonNull int[] grantResults) {
         processGrantResults(permissions, grantResults);
 
         processQueue(activity, permissions, grantResults);
     }
 
-    /* package-private */ static synchronized void prompt(Activity activity, PermissionBlock block) {
+    /* package-private */ static synchronized void prompt(final Activity activity,
+                                                          final PermissionBlock block) {
         if (prompt.isEmpty()) {
             prompt.add(block);
             showPrompt(activity);
         } else {
             waiting.add(block);
         }
     }
 
-    private static synchronized void processGrantResults(@NonNull String[] permissions, @NonNull int[] grantResults) {
+    private static synchronized void processGrantResults(final @NonNull String[] permissions,
+                                                         final @NonNull int[] grantResults) {
         final HashSet<String> grantedPermissions = collectGrantedPermissions(permissions, grantResults);
 
         while (!prompt.isEmpty()) {
             final PermissionBlock block = prompt.poll();
 
             if (allPermissionsGranted(block, grantedPermissions)) {
                 block.onPermissionsGranted();
             } else {
                 block.onPermissionsDenied();
             }
         }
     }
 
-    private static synchronized void processQueue(Activity activity, String[] permissions, int[] grantResults) {
+    private static synchronized void processQueue(final Activity activity,
+                                                  final String[] permissions,
+                                                  final int[] grantResults) {
         final HashSet<String> deniedPermissions = collectDeniedPermissions(permissions, grantResults);
 
         while (!waiting.isEmpty()) {
             final PermissionBlock block = waiting.poll();
 
             if (block.hasPermissions(activity)) {
                 block.onPermissionsGranted();
             } else {
@@ -156,55 +162,61 @@ public class Permissions {
             }
         }
 
         if (!prompt.isEmpty()) {
             showPrompt(activity);
         }
     }
 
-    private static synchronized void showPrompt(Activity activity) {
+    private static synchronized void showPrompt(final Activity activity) {
         HashSet<String> permissions = new HashSet<>();
 
         for (PermissionBlock block : prompt) {
             Collections.addAll(permissions, block.getPermissions());
         }
 
         permissionHelper.prompt(activity, permissions.toArray(new String[permissions.size()]));
     }
 
-    private static HashSet<String> collectGrantedPermissions(@NonNull String[] permissions, @NonNull int[] grantResults) {
+    private static HashSet<String> collectGrantedPermissions(final @NonNull String[] permissions,
+                                                             final @NonNull int[] grantResults) {
         return filterPermissionsByResult(permissions, grantResults, PackageManager.PERMISSION_GRANTED);
     }
 
-    private static HashSet<String> collectDeniedPermissions(@NonNull String[] permissions, @NonNull int[] grantResults) {
+    private static HashSet<String> collectDeniedPermissions(final @NonNull String[] permissions,
+                                                            final @NonNull int[] grantResults) {
         return filterPermissionsByResult(permissions, grantResults, PackageManager.PERMISSION_DENIED);
     }
 
-    private static HashSet<String> filterPermissionsByResult(@NonNull String[] permissions, @NonNull int[] grantResults, int result) {
+    private static HashSet<String> filterPermissionsByResult(final @NonNull String[] permissions,
+                                                             final @NonNull int[] grantResults,
+                                                             final int result) {
         HashSet<String> grantedPermissions = new HashSet<>(permissions.length);
         for (int i = 0; i < permissions.length; i++) {
             if (grantResults[i] == result) {
                 grantedPermissions.add(permissions[i]);
             }
         }
         return grantedPermissions;
     }
 
-    private static boolean allPermissionsGranted(PermissionBlock block, HashSet<String> grantedPermissions) {
+    private static boolean allPermissionsGranted(final PermissionBlock block,
+                                                 final HashSet<String> grantedPermissions) {
         for (String permission : block.getPermissions()) {
             if (!grantedPermissions.contains(permission)) {
                 return false;
             }
         }
 
         return true;
     }
 
-    private static boolean atLeastOnePermissionDenied(PermissionBlock block, HashSet<String> deniedPermissions) {
+    private static boolean atLeastOnePermissionDenied(final PermissionBlock block,
+                                                      final HashSet<String> deniedPermissions) {
         for (String permission : block.getPermissions()) {
             if (deniedPermissions.contains(permission)) {
                 return true;
             }
         }
 
         return false;
     }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/permissions/PermissionsHelper.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/permissions/PermissionsHelper.java
@@ -9,24 +9,24 @@ import android.app.Activity;
 import android.content.Context;
 import android.content.pm.PackageManager;
 import android.support.v4.app.ActivityCompat;
 import android.support.v4.content.ContextCompat;
 
 /* package-private */ class PermissionsHelper {
     private static final int PERMISSIONS_REQUEST_CODE = 212;
 
-    public boolean hasPermissions(Context context, String... permissions) {
+    public boolean hasPermissions(final Context context, final String... permissions) {
         for (String permission : permissions) {
             final int permissionCheck = ContextCompat.checkSelfPermission(context, permission);
 
             if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
                 return false;
             }
         }
 
         return true;
     }
 
-    public void prompt(Activity activity, String[] permissions) {
+    public void prompt(final Activity activity, final String[] permissions) {
         ActivityCompat.requestPermissions(activity, permissions, PERMISSIONS_REQUEST_CODE);
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoProcessManager.java
@@ -56,17 +56,17 @@ public final class GeckoProcessManager e
                                                           IBinder.DeathRecipient {
         private static final int WAIT_TIMEOUT = 5000; // 5 seconds
 
         private final String mType;
         private boolean mWaiting;
         private IChildProcess mChild;
         private int mPid;
 
-        public ChildConnection(String type) {
+        public ChildConnection(final String type) {
             mType = type;
         }
 
         public synchronized int getPid() {
             if ((mPid == 0) && (mChild != null)) {
                 try {
                     mPid = mChild.getPid();
                 } catch (final RemoteException e) {
@@ -129,30 +129,31 @@ public final class GeckoProcessManager e
                     wait(WAIT_TIMEOUT);
                 } catch (final InterruptedException e) {
                 }
             }
             mWaiting = false;
         }
 
         @Override
-        public synchronized void onServiceConnected(ComponentName name, IBinder service) {
+        public synchronized void onServiceConnected(final ComponentName name,
+                                                    final IBinder service) {
             try {
                 service.linkToDeath(this, 0);
             } catch (final RemoteException e) {
                 Log.e(LOGTAG, "Cannot link to death for " + mType, e);
             }
 
             mChild = IChildProcess.Stub.asInterface(service);
             mWaiting = false;
             notifyAll();
         }
 
         @Override
-        public synchronized void onServiceDisconnected(ComponentName name) {
+        public synchronized void onServiceDisconnected(final ComponentName name) {
             mChild = null;
             mPid = 0;
             mWaiting = false;
             notifyAll();
         }
 
         @Override
         public synchronized void binderDied() {
@@ -208,17 +209,17 @@ public final class GeckoProcessManager e
     @WrapForJNI
     private static int start(final String type, final String[] args,
                              final int prefsFd, final int prefMapFd,
                              final int ipcFd,
                              final int crashFd, final int crashAnnotationFd) {
         return INSTANCE.start(type, args, prefsFd, prefMapFd, ipcFd, crashFd, crashAnnotationFd, /* retry */ false);
     }
 
-    private int filterFlagsForChild(int flags) {
+    private int filterFlagsForChild(final int flags) {
         return flags & GeckoThread.FLAG_ENABLE_NATIVE_CRASHREPORTER;
     }
 
     private int start(final String type, final String[] args,
                       final int prefsFd, final int prefMapFd,
                       final int ipcFd, final int crashFd,
                       final int crashAnnotationFd, final boolean retry) {
         final ChildConnection connection = getConnection(type);
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoServiceChildProcess.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/process/GeckoServiceChildProcess.java
@@ -129,17 +129,17 @@ public class GeckoServiceChildProcess ex
 
     @Override
     public IBinder onBind(final Intent intent) {
         GeckoThread.launch(); // Preload Gecko.
         return mBinder;
     }
 
     @Override
-    public boolean onUnbind(Intent intent) {
+    public boolean onUnbind(final Intent intent) {
         Log.i(LOGTAG, "Service has been unbound. Stopping.");
         stopSelf();
         Process.killProcess(Process.myPid());
         return false;
     }
 
     public static final class gmplugin extends GeckoServiceChildProcess {}
 
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/sqlite/ByteBufferInputStream.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/sqlite/ByteBufferInputStream.java
@@ -11,28 +11,28 @@ import java.nio.ByteBuffer;
 
 /*
  * Helper class to make the ByteBuffers returned by SQLite BLOB
  * easier to use.
  */
 public class ByteBufferInputStream extends InputStream {
     private final ByteBuffer mByteBuffer;
 
-    public ByteBufferInputStream(ByteBuffer aByteBuffer) {
+    public ByteBufferInputStream(final ByteBuffer aByteBuffer) {
         mByteBuffer = aByteBuffer;
     }
 
     @Override
     public synchronized int read() throws IOException {
         if (!mByteBuffer.hasRemaining()) {
             return -1;
         }
         return mByteBuffer.get();
     }
 
     @Override
-    public synchronized int read(byte[] aBytes, int aOffset, int aLen)
-        throws IOException {
+    public synchronized int read(final byte[] aBytes, final int aOffset, final int aLen)
+            throws IOException {
         int toRead = Math.min(aLen, mByteBuffer.remaining());
         mByteBuffer.get(aBytes, aOffset, toRead);
         return toRead;
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/sqlite/MatrixBlobCursor.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/sqlite/MatrixBlobCursor.java
@@ -51,17 +51,17 @@ public class MatrixBlobCursor extends Ab
     /**
      * Constructs a new cursor with the given initial capacity.
      *
      * @param columnNames names of the columns, the ordering of which
      *  determines column ordering elsewhere in this cursor
      * @param initialCapacity in rows
      */
     @JNITarget
-    public MatrixBlobCursor(String[] columnNames, int initialCapacity) {
+    public MatrixBlobCursor(final String[] columnNames, final int initialCapacity) {
         this.columnNames = columnNames;
         this.columnCount = columnNames.length;
 
         int capacity = initialCapacity;
         if (capacity < 1) {
             capacity = 1;
         }
 
@@ -71,33 +71,33 @@ public class MatrixBlobCursor extends Ab
 
     /**
      * Constructs a new cursor.
      *
      * @param columnNames names of the columns, the ordering of which
      *  determines column ordering elsewhere in this cursor
      */
     @JNITarget
-    public MatrixBlobCursor(String[] columnNames) {
+    public MatrixBlobCursor(final String[] columnNames) {
         this(columnNames, 16);
     }
 
     /**
      * Closes the Cursor, releasing all of its resources.
      */
     public void close() {
         this.allocationStack = null;
         this.data = null;
         super.close();
     }
 
     /**
      * Gets value at the given column for the current row.
      */
-    protected Object get(int column) {
+    protected Object get(final int column) {
         if (column < 0 || column >= columnCount) {
             throw new CursorIndexOutOfBoundsException("Requested column: "
                     + column + ", # of columns: " +  columnCount);
         }
         if (mPos < 0) {
             throw new CursorIndexOutOfBoundsException("Before first row.");
         }
         if (mPos >= rowCount) {
@@ -126,17 +126,17 @@ public class MatrixBlobCursor extends Ab
      * for concurrent use.
      *
      * @throws IllegalArgumentException if {@code columnValues.length !=
      *  columnNames.length}
      * @param columnValues in the same order as the the column names specified
      *  at cursor construction time
      */
     @JNITarget
-    public void addRow(Object[] columnValues) {
+    public void addRow(final Object[] columnValues) {
         if (columnValues.length != columnCount) {
             throw new IllegalArgumentException("columnNames.length = "
                     + columnCount + ", columnValues.length = "
                     + columnValues.length);
         }
 
         int start = rowCount++ * columnCount;
         ensureCapacity(start + columnCount);
@@ -148,17 +148,17 @@ public class MatrixBlobCursor extends Ab
      * for concurrent use.
      *
      * @throws IllegalArgumentException if {@code columnValues.size() !=
      *  columnNames.length}
      * @param columnValues in the same order as the the column names specified
      *  at cursor construction time
      */
     @JNITarget
-    public void addRow(Iterable<?> columnValues) {
+    public void addRow(final Iterable<?> columnValues) {
         final int start = rowCount * columnCount;
 
         if (columnValues instanceof ArrayList<?>) {
             addRow((ArrayList<?>) columnValues, start);
             return;
         }
 
         final int end = start + columnCount;
@@ -182,17 +182,17 @@ public class MatrixBlobCursor extends Ab
         }
 
         // Increase row count here in case we encounter an exception.
         rowCount++;
     }
 
     /** Optimization for {@link ArrayList}. */
     @JNITarget
-    private void addRow(ArrayList<?> columnValues, int start) {
+    private void addRow(final ArrayList<?> columnValues, final int start) {
         final int size = columnValues.size();
         if (size != columnCount) {
             throw new IllegalArgumentException("columnNames.length = "
                     + columnCount + ", columnValues.size() = " + size);
         }
 
         final int end = start + columnCount;
         ensureCapacity(end);
@@ -227,17 +227,17 @@ public class MatrixBlobCursor extends Ab
      * at cursor construction time.
      *
      * Not thread-safe.
      */
     public class RowBuilder {
         private int index;
         private final int endIndex;
 
-        RowBuilder(int index, int endIndex) {
+        RowBuilder(final int index, final int endIndex) {
             this.index = index;
             this.endIndex = endIndex;
         }
 
         /**
          * Sets the next column value in this row.
          *
          * @throws CursorIndexOutOfBoundsException if you try to add too many
@@ -252,17 +252,17 @@ public class MatrixBlobCursor extends Ab
             data[index++] = columnValue;
             return this;
         }
     }
 
     /**
      * Not thread safe.
      */
-    public void set(int column, Object value) {
+    public void set(final int column, final Object value) {
         if (column < 0 || column >= columnCount) {
             throw new CursorIndexOutOfBoundsException("Requested column: "
                     + column + ", # of columns: " +  columnCount);
         }
         if (mPos < 0) {
             throw new CursorIndexOutOfBoundsException("Before first row.");
         }
         if (mPos >= rowCount) {
@@ -278,81 +278,81 @@ public class MatrixBlobCursor extends Ab
     }
 
     @Override
     public String[] getColumnNames() {
         return columnNames;
     }
 
     @Override
-    public String getString(int column) {
+    public String getString(final int column) {
         Object value = get(column);
         if (value == null) return null;
         return value.toString();
     }
 
     @Override
-    public short getShort(int column) {
+    public short getShort(final int column) {
         final Object value = get(column);
         if (value == null) return 0;
         if (value instanceof Number) return ((Number) value).shortValue();
         return Short.parseShort(value.toString());
     }
 
     @Override
-    public int getInt(int column) {
+    public int getInt(final int column) {
         Object value = get(column);
         if (value == null) return 0;
         if (value instanceof Number) return ((Number) value).intValue();
         return Integer.parseInt(value.toString());
     }
 
     @Override
-    public long getLong(int column) {
+    public long getLong(final int column) {
         Object value = get(column);
         if (value == null) return 0;
         if (value instanceof Number) return ((Number) value).longValue();
         return Long.parseLong(value.toString());
     }
 
     @Override
-    public float getFloat(int column) {
+    public float getFloat(final int column) {
         Object value = get(column);
         if (value == null) return 0.0f;
         if (value instanceof Number) return ((Number) value).floatValue();
         return Float.parseFloat(value.toString());
     }
 
     @Override
-    public double getDouble(int column) {
+    public double getDouble(final int column) {
         Object value = get(column);
         if (value == null) return 0.0d;
         if (value instanceof Number) return ((Number) value).doubleValue();
         return Double.parseDouble(value.toString());
     }
 
     @Override
-    public byte[] getBlob(int column) {
+    public byte[] getBlob(final int column) {
         Object value = get(column);
         if (value == null) return null;
         if (value instanceof byte[]) {
             return (byte[]) value;
         }
 
         if (value instanceof ByteBuffer) {
             final ByteBuffer bytes = (ByteBuffer) value;
             byte[] byteArray = new byte[bytes.remaining()];
             bytes.get(byteArray);
             return byteArray;
         }
         throw new UnsupportedOperationException("BLOB Object not of known type");
     }
 
     @Override
-    public boolean isNull(int column) {
+    public boolean isNull(final int column) {
         return get(column) == null;
     }
 
     @Override
     protected void finalize() {
         if (!isClosed()) {
             Log.e(LOGTAG, "Cursor finalized without being closed", this.allocationStack);
         }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/sqlite/SQLiteBridge.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/sqlite/SQLiteBridge.java
@@ -56,55 +56,54 @@ public class SQLiteBridge {
                                                             long[] aUpdateResult)
         throws SQLiteBridgeException;
     private static native long openDatabase(String aDb)
         throws SQLiteBridgeException;
     private static native void closeDatabase(long aDb);
 
     // Takes the path to the database we want to access.
     @RobocopTarget
-    public SQLiteBridge(String aDb) throws SQLiteBridgeException {
+    public SQLiteBridge(final String aDb) throws SQLiteBridgeException {
         mDb = aDb;
     }
 
     // Executes a simple line of sql.
-    public void execSQL(String sql)
-                throws SQLiteBridgeException {
+    public void execSQL(final String sql) throws SQLiteBridgeException {
         Cursor cursor = internalQuery(sql, null);
         cursor.close();
     }
 
     // Executes a simple line of sql. Allow you to bind arguments
-    public void execSQL(String sql, String[] bindArgs)
+    public void execSQL(final String sql, final String[] bindArgs)
                 throws SQLiteBridgeException {
         Cursor cursor = internalQuery(sql, bindArgs);
         cursor.close();
     }
 
     // Executes a DELETE statement on the database
-    public int delete(String table, String whereClause, String[] whereArgs)
+    public int delete(final String table, final String whereClause, final String[] whereArgs)
                throws SQLiteBridgeException {
         StringBuilder sb = new StringBuilder("DELETE from ");
         sb.append(table);
         if (whereClause != null) {
             sb.append(" WHERE " + whereClause);
         }
 
         execSQL(sb.toString(), whereArgs);
         return (int)mQueryResults[RESULT_ROWS_CHANGED];
     }
 
-    public Cursor query(String table,
-                        String[] columns,
-                        String selection,
-                        String[] selectionArgs,
-                        String groupBy,
-                        String having,
-                        String orderBy,
-                        String limit)
+    public Cursor query(final String table,
+                        final String[] columns,
+                        final String selection,
+                        final String[] selectionArgs,
+                        final String groupBy,
+                        final String having,
+                        final String orderBy,
+                        final String limit)
                throws SQLiteBridgeException {
         StringBuilder sb = new StringBuilder("SELECT ");
         if (columns != null)
             sb.append(TextUtils.join(", ", columns));
         else
             sb.append(" * ");
 
         sb.append(" FROM ");
@@ -129,22 +128,22 @@ public class SQLiteBridge {
         if (limit != null) {
             sb.append(" " + limit);
         }
 
         return rawQuery(sb.toString(), selectionArgs);
     }
 
     @RobocopTarget
-    public Cursor rawQuery(String sql, String[] selectionArgs)
+    public Cursor rawQuery(final String sql, final String[] selectionArgs)
         throws SQLiteBridgeException {
         return internalQuery(sql, selectionArgs);
     }
 
-    public long insert(String table, String nullColumnHack, ContentValues values)
+    public long insert(final String table, final String nullColumnHack, final ContentValues values)
                throws SQLiteBridgeException {
         if (values == null)
             return 0;
 
         ArrayList<String> valueNames = new ArrayList<String>();
         ArrayList<String> valueBinds = new ArrayList<String>();
         ArrayList<String> keyNames = new ArrayList<String>();
 
@@ -173,18 +172,18 @@ public class SQLiteBridge {
         sb.append(") ");
 
         String[] binds = new String[valueBinds.size()];
         valueBinds.toArray(binds);
         execSQL(sb.toString(), binds);
         return mQueryResults[RESULT_INSERT_ROW_ID];
     }
 
-    public int update(String table, ContentValues values, String whereClause, String[] whereArgs)
-               throws SQLiteBridgeException {
+    public int update(final String table, final ContentValues values, final String whereClause,
+                      final String[] whereArgs) throws SQLiteBridgeException {
         if (values == null)
             return 0;
 
         ArrayList<String> valueNames = new ArrayList<String>();
 
         StringBuilder sb = new StringBuilder("UPDATE ");
         sb.append(table);
         sb.append(" SET ");
@@ -232,32 +231,33 @@ public class SQLiteBridge {
             cursor.close();
         }
         return ret;
     }
 
     // Do an SQL query, substituting the parameters in the query with the passed
     // parameters. The parameters are substituted in order: named parameters
     // are not supported.
-    private Cursor internalQuery(String aQuery, String[] aParams)
+    private Cursor internalQuery(final String aQuery, final String[] aParams)
         throws SQLiteBridgeException {
 
         mQueryResults = new long[2];
         if (isOpen()) {
             return sqliteCallWithDb(mDbPointer, aQuery, aParams, mQueryResults);
         }
         return sqliteCall(mDb, aQuery, aParams, mQueryResults);
     }
 
     /*
      * The second two parameters here are just provided for compatibility with SQLiteDatabase
      * Support for them is not currently implemented.
     */
-    public static SQLiteBridge openDatabase(String path, SQLiteDatabase.CursorFactory factory, int flags)
-        throws SQLiteException {
+    public static SQLiteBridge openDatabase(final String path,
+                                            final SQLiteDatabase.CursorFactory factory,
+                                            final int flags) throws SQLiteException {
         if (factory != null) {
             throw new RuntimeException("factory not supported.");
         }
         if (flags != 0) {
             throw new RuntimeException("flags not supported.");
         }
 
         SQLiteBridge bridge = null;
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/sqlite/SQLiteBridgeException.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/sqlite/SQLiteBridgeException.java
@@ -7,12 +7,12 @@ package org.mozilla.gecko.sqlite;
 
 import org.mozilla.gecko.annotation.JNITarget;
 
 @JNITarget
 public class SQLiteBridgeException extends RuntimeException {
     static final long serialVersionUID = 1L;
 
     public SQLiteBridgeException() {}
-    public SQLiteBridgeException(String msg) {
+    public SQLiteBridgeException(final String msg) {
         super(msg);
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityResultHandlerMap.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityResultHandlerMap.java
@@ -5,20 +5,20 @@
 package org.mozilla.gecko.util;
 
 import android.util.SparseArray;
 
 public final class ActivityResultHandlerMap {
     private final SparseArray<ActivityResultHandler> mMap = new SparseArray<ActivityResultHandler>();
     private int mCounter;
 
-    public synchronized int put(ActivityResultHandler handler) {
+    public synchronized int put(final ActivityResultHandler handler) {
         mMap.put(mCounter, handler);
         return mCounter++;
     }
 
-    public synchronized ActivityResultHandler getAndRemove(int i) {
+    public synchronized ActivityResultHandler getAndRemove(final int i) {
         ActivityResultHandler handler = mMap.get(i);
         mMap.delete(i);
 
         return handler;
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityUtils.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ActivityUtils.java
@@ -13,17 +13,17 @@ import android.os.Build;
 import android.view.View;
 import android.view.Window;
 import android.view.WindowManager;
 
 public class ActivityUtils {
     private ActivityUtils() {
     }
 
-    public static void setFullScreen(Activity activity, boolean fullscreen) {
+    public static void setFullScreen(final Activity activity, final boolean fullscreen) {
         // Hide/show the system notification bar
         Window window = activity.getWindow();
 
         int newVis;
         if (fullscreen) {
             newVis = View.SYSTEM_UI_FLAG_FULLSCREEN;
             if (Build.VERSION.SDK_INT >= 19) {
                 newVis |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
@@ -55,39 +55,40 @@ public class ActivityUtils {
 
         final int vis = window.getDecorView().getSystemUiVisibility();
         return (vis & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0;
     }
 
     /**
      * Finish this activity and launch the default home screen activity.
      */
-    public static void goToHomeScreen(Context context) {
+    public static void goToHomeScreen(final Context context) {
         Intent intent = new Intent(Intent.ACTION_MAIN);
 
         intent.addCategory(Intent.CATEGORY_HOME);
         intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         context.startActivity(intent);
     }
 
-    public static Activity getActivityFromContext(Context context) {
+    public static Activity getActivityFromContext(final Context context) {
         while (context instanceof ContextWrapper) {
             if (context instanceof Activity) {
                 return (Activity) context;
             }
         }
         return null;
     }
 
-    public static void preventDisplayStatusbar(final Activity activity, boolean registering) {
+    public static void preventDisplayStatusbar(final Activity activity,
+                                               final boolean registering) {
         final View decorView = activity.getWindow().getDecorView();
         if (registering) {
             decorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
                 @Override
-                public void onSystemUiVisibilityChange(int visibility) {
+                public void onSystemUiVisibilityChange(final int visibility) {
                     if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
                         setFullScreen(activity, true);
                     }
                 }
             });
         } else {
             decorView.setOnSystemUiVisibilityChangeListener(null);
         }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/BitmapUtils.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/BitmapUtils.java
@@ -24,29 +24,30 @@ import android.support.v7.graphics.Palet
 import android.util.Base64;
 import android.util.Log;
 
 public final class BitmapUtils {
     private static final String LOGTAG = "GeckoBitmapUtils";
 
     private BitmapUtils() {}
 
-    public static Bitmap decodeByteArray(byte[] bytes) {
+    public static Bitmap decodeByteArray(final byte[] bytes) {
         return decodeByteArray(bytes, null);
     }
 
-    public static Bitmap decodeByteArray(byte[] bytes, BitmapFactory.Options options) {
+    public static Bitmap decodeByteArray(final byte[] bytes, final BitmapFactory.Options options) {
         return decodeByteArray(bytes, 0, bytes.length, options);
     }
 
-    public static Bitmap decodeByteArray(byte[] bytes, int offset, int length) {
+    public static Bitmap decodeByteArray(final byte[] bytes, final int offset, final int length) {
         return decodeByteArray(bytes, offset, length, null);
     }
 
-    public static Bitmap decodeByteArray(byte[] bytes, int offset, int length, BitmapFactory.Options options) {
+    public static Bitmap decodeByteArray(final byte[] bytes, final int offset, final int length,
+                                         final BitmapFactory.Options options) {
         if (bytes.length <= 0) {
             throw new IllegalArgumentException("bytes.length " + bytes.length
                                                + " must be a positive number");
         }
 
         Bitmap bitmap = null;
         try {
             bitmap = BitmapFactory.decodeByteArray(bytes, offset, length, options);
@@ -66,43 +67,43 @@ public final class BitmapUtils {
                           + "a bitmap with dimensions " + bitmap.getWidth()
                           + "x" + bitmap.getHeight());
             return null;
         }
 
         return bitmap;
     }
 
-    public static Bitmap decodeStream(InputStream inputStream) {
+    public static Bitmap decodeStream(final InputStream inputStream) {
         try {
             return BitmapFactory.decodeStream(inputStream);
         } catch (OutOfMemoryError e) {
             Log.e(LOGTAG, "decodeStream() OOM!", e);
             return null;
         }
     }
 
-    public static Bitmap decodeUrl(Uri uri) {
+    public static Bitmap decodeUrl(final Uri uri) {
         return decodeUrl(uri.toString());
     }
 
-    public static Bitmap decodeUrl(String urlString) {
+    public static Bitmap decodeUrl(final String urlString) {
         URL url;
 
         try {
             url = new URL(urlString);
         } catch (MalformedURLException e) {
             Log.w(LOGTAG, "decodeUrl: malformed URL " + urlString);
             return null;
         }
 
         return decodeUrl(url);
     }
 
-    public static Bitmap decodeUrl(URL url) {
+    public static Bitmap decodeUrl(final URL url) {
         InputStream stream = null;
 
         try {
             stream = url.openStream();
         } catch (IOException e) {
             Log.w(LOGTAG, "decodeUrl: IOException downloading " + url);
             return null;
         }
@@ -118,31 +119,33 @@ public final class BitmapUtils {
             stream.close();
         } catch (IOException e) {
             Log.w(LOGTAG, "decodeUrl: IOException closing stream " + url, e);
         }
 
         return bitmap;
     }
 
-    public static Bitmap decodeResource(Context context, int id) {
+    public static Bitmap decodeResource(final Context context, final int id) {
         return decodeResource(context, id, null);
     }
 
-    public static Bitmap decodeResource(Context context, int id, BitmapFactory.Options options) {
+    public static Bitmap decodeResource(final Context context, final int id,
+                                        final BitmapFactory.Options options) {
         Resources resources = context.getResources();
         try {
             return BitmapFactory.decodeResource(resources, id, options);
         } catch (OutOfMemoryError e) {
             Log.e(LOGTAG, "decodeResource() OOM! Resource id=" + id, e);
             return null;
         }
     }
 
-    public static @ColorInt int getDominantColor(Bitmap source, @ColorInt int defaultColor) {
+    public static @ColorInt int getDominantColor(final Bitmap source,
+                                                 final @ColorInt int defaultColor) {
         if (HardwareUtils.isX86System()) {
             // (Bug 1318667) We are running into crashes when using the palette library with
             // specific icons on x86 devices. They take down the whole VM and are not recoverable.
             // Unfortunately our release icon is triggering this crash. Until we can switch to a
             // newer version of the support library where this does not happen, we are using our
             // own slower implementation.
             return getDominantColorCustomImplementation(source, true, defaultColor);
         } else {
@@ -155,23 +158,22 @@ public final class BitmapUtils {
                 // color. This is a valid condition and callers should handle this gracefully (Bug 1318560).
                 Log.e(LOGTAG, "Palette generation failed with ArrayIndexOutOfBoundsException", e);
 
                 return defaultColor;
             }
         }
     }
 
-    public static @ColorInt int getDominantColorCustomImplementation(Bitmap source) {
+    public static @ColorInt int getDominantColorCustomImplementation(final Bitmap source) {
         return getDominantColorCustomImplementation(source, true, Color.WHITE);
     }
 
-    public static @ColorInt int getDominantColorCustomImplementation(Bitmap source,
-                                                                     boolean applyThreshold,
-                                                                     @ColorInt int defaultColor) {
+    public static @ColorInt int getDominantColorCustomImplementation(
+        final Bitmap source, final boolean applyThreshold, final @ColorInt int defaultColor) {
       if (source == null) {
           return defaultColor;
       }
 
       // Keep track of how many times a hue in a given bin appears in the image.
       // Hue values range [0 .. 360), so dividing by 10, we get 36 bins.
       int[] colorBins = new int[36];
 
@@ -233,49 +235,49 @@ public final class BitmapUtils {
     }
 
     /**
      * Decodes a bitmap from a Base64 data URI.
      *
      * @param dataURI a Base64-encoded data URI string
      * @return        the decoded bitmap, or null if the data URI is invalid
      */
-    public static Bitmap getBitmapFromDataURI(String dataURI) {
+    public static Bitmap getBitmapFromDataURI(final String dataURI) {
         if (dataURI == null) {
             return null;
         }
 
         byte[] raw = getBytesFromDataURI(dataURI);
         if (raw == null || raw.length == 0) {
             return null;
         }
 
         return decodeByteArray(raw);
     }
 
     /**
      * Return a byte[] containing the bytes in a given base64 string, or null if this is not a valid
      * base64 string.
      */
-    public static byte[] getBytesFromBase64(String base64) {
+    public static byte[] getBytesFromBase64(final String base64) {
         try {
             return Base64.decode(base64, Base64.DEFAULT);
         } catch (Exception e) {
             Log.e(LOGTAG, "exception decoding bitmap from data URI: " + base64, e);
         }
 
         return null;
     }
 
-    public static byte[] getBytesFromDataURI(String dataURI) {
+    public static byte[] getBytesFromDataURI(final String dataURI) {
         final String base64 = dataURI.substring(dataURI.indexOf(',') + 1);
         return getBytesFromBase64(base64);
     }
 
-    public static Bitmap getBitmapFromDrawable(Drawable drawable) {
+    public static Bitmap getBitmapFromDrawable(final Drawable drawable) {
         if (drawable instanceof BitmapDrawable) {
             return ((BitmapDrawable) drawable).getBitmap();
         }
 
         int width = drawable.getIntrinsicWidth();
         width = width > 0 ? width : 1;
         int height = drawable.getIntrinsicHeight();
         height = height > 0 ? height : 1;
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ContentUriUtils.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ContentUriUtils.java
@@ -126,17 +126,18 @@ public class ContentUriUtils {
 
     /**
      * Retrieves file contents via getContentResolver().openInputStream() and stores them in a
      * temporary file.
      *
      * @return The path of the temporary file, or <code>null</code> if there was an error
      *         retrieving the file.
      */
-    public static @Nullable String getTempFilePathFromContentUri(Context context, Uri contentUri) {
+    public static @Nullable String getTempFilePathFromContentUri(final Context context,
+                                                                 final Uri contentUri) {
         //copy file and send new file path
         final String fileName = FileUtils.getFileNameFromContentUri(context, contentUri);
         final File folder = new File(context.getCacheDir(), FileUtils.CONTENT_TEMP_DIRECTORY);
         boolean success = true;
         if (!folder.exists()) {
             success = folder.mkdirs();
         }
 
@@ -154,18 +155,18 @@ public class ContentUriUtils {
      *
      * @param context The context.
      * @param uri The Uri to query.
      * @param selection (Optional) Filter used in the query.
      * @param selectionArgs (Optional) Selection arguments used in the query.
      * @return The value of the _data column, which is typically a file path.
      * @author paulburke
      */
-    private static String getDataColumn(Context context, Uri uri, String selection,
-                                        String[] selectionArgs) {
+    private static String getDataColumn(final Context context, final Uri uri,
+                                        final String selection, final String[] selectionArgs) {
         final String column = "_data";
         final String[] projection = {
                 column
         };
 
         try (Cursor cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
                 null)) {
             if (cursor != null && cursor.moveToFirst()) {
@@ -176,38 +177,38 @@ public class ContentUriUtils {
         return null;
     }
 
     /**
      * @param uri The Uri to check.
      * @return Whether the Uri authority is ExternalStorageProvider.
      * @author paulburke
      */
-    public static boolean isExternalStorageDocument(Uri uri) {
+    public static boolean isExternalStorageDocument(final Uri uri) {
         return "com.android.externalstorage.documents".equals(uri.getAuthority());
     }
 
     /**
      * @param uri The Uri to check.
      * @return Whether the Uri authority is DownloadsProvider.
      * @author paulburke
      */
-    public static boolean isDownloadsDocument(Uri uri) {
+    public static boolean isDownloadsDocument(final Uri uri) {
         return "com.android.providers.downloads.documents".equals(uri.getAuthority());
     }
 
     /**
      * @param uri The Uri to check.
      * @return Whether the Uri authority is MediaProvider.
      * @author paulburke
      */
-    public static boolean isMediaDocument(Uri uri) {
+    public static boolean isMediaDocument(final Uri uri) {
         return "com.android.providers.media.documents".equals(uri.getAuthority());
     }
 
     /**
      * @param uri The Uri to check.
      * @return Whether the Uri authority is Google Photos.
      */
-    public static boolean isGooglePhotosUri(Uri uri) {
+    public static boolean isGooglePhotosUri(final Uri uri) {
         return "com.google.android.apps.photos.content".equals(uri.getAuthority());
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ContextUtils.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ContextUtils.java
@@ -22,17 +22,17 @@ public class ContextUtils {
     public static PackageInfo getCurrentPackageInfo(final Context context) {
         try {
             return context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
         } catch (PackageManager.NameNotFoundException e) {
             throw new AssertionError("Should not happen: Can't get package info of own package");
         }
     }
 
-    public static boolean isPackageInstalled(final Context context, String packageName) {
+    public static boolean isPackageInstalled(final Context context, final String packageName) {
         try {
             PackageManager pm = context.getPackageManager();
             pm.getPackageInfo(packageName, 0);
             return true;
         } catch (PackageManager.NameNotFoundException e) {
             return false;
         }
     }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/FileUtils.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/FileUtils.java
@@ -50,37 +50,37 @@ public class FileUtils {
 
     /*
     * A basic Filter for checking a filename and age.
     **/
     static public class NameAndAgeFilter implements FilenameFilter {
         final private String mName;
         final private double mMaxAge;
 
-        public NameAndAgeFilter(String name, double age) {
+        public NameAndAgeFilter(final String name, final double age) {
             mName = name;
             mMaxAge = age;
         }
 
         @Override
-        public boolean accept(File dir, String filename) {
+        public boolean accept(final File dir, final String filename) {
             if (mName == null || mName.matches(filename)) {
                 File f = new File(dir, filename);
 
                 if (mMaxAge < 0 || System.currentTimeMillis() - f.lastModified() > mMaxAge) {
                     return true;
                 }
             }
 
             return false;
         }
     }
 
     @RobocopTarget
-    public static void delTree(File dir, FilenameFilter filter, boolean recurse) {
+    public static void delTree(final File dir, final FilenameFilter filter, final boolean recurse) {
         String[] files = null;
 
         if (filter != null) {
           files = dir.list(filter);
         } else {
           files = dir.list();
         }
 
@@ -89,21 +89,21 @@ public class FileUtils {
         }
 
         for (String file : files) {
             File f = new File(dir, file);
             delete(f, recurse);
         }
     }
 
-    public static boolean delete(File file) throws IOException {
+    public static boolean delete(final File file) throws IOException {
         return delete(file, true);
     }
 
-    public static boolean delete(File file, boolean recurse) {
+    public static boolean delete(final File file, final boolean recurse) {
         if (file.isDirectory() && recurse) {
             // If the quick delete failed and this is a dir, recursively delete the contents of the dir
             String files[] = file.list();
             for (String temp : files) {
                 File fileDelete = new File(file, temp);
                 try {
                     delete(fileDelete);
                 } catch (IOException ex) {
@@ -276,17 +276,17 @@ public class FileUtils {
             } else if (lhsModified == rhsModified) {
                 return 0;
             } else {
                 return 1;
             }
         }
     }
 
-    public static File createTempDir(File directory, String prefix) {
+    public static File createTempDir(final File directory, final String prefix) {
         // Force a prefix null check first
         if (prefix.length() < 3) {
             throw new IllegalArgumentException("prefix must be at least 3 characters");
         }
         File tempDirectory = directory;
         if (tempDirectory == null) {
             String tmpDir = System.getProperty("java.io.tmpdir", ".");
             tempDirectory = new File(tmpDir);
@@ -306,61 +306,62 @@ public class FileUtils {
             // content:// URI, so we need a fallback. This will break local subresources and
             // relative links, but unfortunately there's nothing else we can do
             // (see https://issuetracker.google.com/issues/77406791).
             path = getTempFilePathFromContentUri(context, uri);
         }
         return !TextUtils.isEmpty(path) ? String.format(FILE_ABSOLUTE_URI, path) : path;
     }
 
-    public static String getFileNameFromContentUri(Context context, Uri uri) {
+    public static String getFileNameFromContentUri(final Context context, final Uri uri) {
         final ContentResolver cr = context.getContentResolver();
         final String[] projection = {MediaStore.MediaColumns.DISPLAY_NAME};
         String fileName = null;
 
         try (Cursor metaCursor = cr.query(uri, projection, null, null, null);) {
             if (metaCursor.moveToFirst()) {
                 fileName = metaCursor.getString(0);
             }
         } catch (Exception e) {
             e.printStackTrace();
         }
 
         return fileName;
     }
 
-    public static void copy(Context context, Uri srcUri, File dstFile) {
+    public static void copy(final Context context, final Uri srcUri, final File dstFile) {
         try (InputStream inputStream = context.getContentResolver().openInputStream(srcUri);
              OutputStream outputStream = new FileOutputStream(dstFile)) {
             IOUtils.copy(inputStream, outputStream);
         } catch (Exception e) {
             e.printStackTrace();
         }
     }
 
-    public static boolean isContentUri(Uri uri) {
+    public static boolean isContentUri(final Uri uri) {
         return uri != null && uri.getScheme() != null && CONTENT_SCHEME.equals(uri.getScheme());
     }
 
-    public static boolean isContentUri(String sUri) {
+    public static boolean isContentUri(final String sUri) {
         return sUri != null && sUri.startsWith(CONTENT_SCHEME);
     }
 
     /**
      * Attempts to find the root path of an external (removable) SD card.
      *
      * @param uuid If you know the file system UUID (as returned e.g. by
      *             {@link StorageVolume#getUuid()}) of the storage device you're looking for, this
      *             may be used to filter down the selection of available non-emulated storage
      *             devices. If no storage device matching the given UUID was found, the first
      *             non-emulated storage device will be returned.
      * @return The root path of the storage device.
      */
     @TargetApi(19)
-    public static @Nullable String getExternalStoragePath(Context context, @Nullable String uuid) {
+    public static @Nullable String getExternalStoragePath(final Context context,
+                                                          final @Nullable String uuid) {
         // Since around the time of Lollipop or Marshmallow, the common convention is for external
         // SD cards to be mounted at /storage/<file system UUID>/, however this pattern is still not
         // guaranteed to be 100 % reliable. Therefore we need another way of getting all potential
         // mount points for external storage devices.
         // StorageManager.getStorageVolumes() might possibly do the trick and be just what we need
         // to enumerate all mount points, but it only works on API24+.
         // So instead, we use the output of getExternalFilesDirs for this purpose, which works on
         // API19 and up.
@@ -400,17 +401,17 @@ public class FileUtils {
         return targetStorage;
     }
 
     /**
      * Helper method because the framework version of this function is only available from API21+.
      *
      * @see Environment#isExternalStorageEmulated(File)
      */
-    public static boolean isExternalStorageEmulated(File path) {
+    public static boolean isExternalStorageEmulated(final File path) {
         if (Build.VERSION.SDK_INT >= 21) {
             return Environment.isExternalStorageEmulated(path);
         } else {
             String absPath = path.getAbsolutePath();
             // This is rather hacky, but then SD card support on older Android versions
             // was equally messy.
             return absPath.contains("/sdcard0") || absPath.contains("/storage/emulated");
         }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/FloatUtils.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/FloatUtils.java
@@ -5,12 +5,12 @@
 
 package org.mozilla.gecko.util;
 
 import java.lang.IllegalArgumentException;
 
 public final class FloatUtils {
     private FloatUtils() {}
 
-    public static boolean fuzzyEquals(float a, float b) {
+    public static boolean fuzzyEquals(final float a, final float b) {
         return (Math.abs(a - b) < 1e-6);
     }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GamepadUtils.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GamepadUtils.java
@@ -18,77 +18,77 @@ public final class GamepadUtils {
 
     private static View.OnKeyListener sClickDispatcher;
     private static float sDeadZoneThresholdOverride = 1e-2f;
 
     private GamepadUtils() {
     }
 
     @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
-    private static boolean isGamepadKey(KeyEvent event) {
+    private static boolean isGamepadKey(final KeyEvent event) {
         return (event.getSource() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD;
     }
 
-    public static boolean isActionKey(KeyEvent event) {
+    public static boolean isActionKey(final KeyEvent event) {
         return (isGamepadKey(event) && (event.getKeyCode() == KeyEvent.KEYCODE_BUTTON_A));
     }
 
-    public static boolean isActionKeyDown(KeyEvent event) {
+    public static boolean isActionKeyDown(final KeyEvent event) {
         return isActionKey(event) && event.getAction() == KeyEvent.ACTION_DOWN;
     }
 
-    public static boolean isBackKey(KeyEvent event) {
+    public static boolean isBackKey(final KeyEvent event) {
         return (isGamepadKey(event) && (event.getKeyCode() == KeyEvent.KEYCODE_BUTTON_B));
     }
 
-    public static void overrideDeadZoneThreshold(float threshold) {
+    public static void overrideDeadZoneThreshold(final float threshold) {
         sDeadZoneThresholdOverride = threshold;
     }
 
-    public static boolean isValueInDeadZone(MotionEvent event, int axis) {
+    public static boolean isValueInDeadZone(final MotionEvent event, final int axis) {
         float threshold;
         if (sDeadZoneThresholdOverride >= 0) {
             threshold = sDeadZoneThresholdOverride;
         } else {
             InputDevice.MotionRange range = event.getDevice().getMotionRange(axis);
             threshold = range.getFlat() + range.getFuzz();
         }
         float value = event.getAxisValue(axis);
         return (Math.abs(value) < threshold);
     }
 
-    public static boolean isPanningControl(MotionEvent event) {
+    public static boolean isPanningControl(final MotionEvent event) {
         if ((event.getSource() & InputDevice.SOURCE_CLASS_MASK) != InputDevice.SOURCE_CLASS_JOYSTICK) {
             return false;
         }
         if (isValueInDeadZone(event, MotionEvent.AXIS_X)
                 && isValueInDeadZone(event, MotionEvent.AXIS_Y)
                 && isValueInDeadZone(event, MotionEvent.AXIS_Z)
                 && isValueInDeadZone(event, MotionEvent.AXIS_RZ)) {
             return false;
         }
         return true;
     }
 
     public static View.OnKeyListener getClickDispatcher() {
         if (sClickDispatcher == null) {
             sClickDispatcher = new View.OnKeyListener() {
                 @Override
-                public boolean onKey(View v, int keyCode, KeyEvent event) {
+                public boolean onKey(final View v, final int keyCode, final KeyEvent event) {
                     if (isActionKeyDown(event)) {
                         return v.performClick();
                     }
                     return false;
                 }
             };
         }
         return sClickDispatcher;
     }
 
-    public static KeyEvent translateSonyXperiaGamepadKeys(int keyCode, KeyEvent event) {
+    public static KeyEvent translateSonyXperiaGamepadKeys(final int keyCode, final KeyEvent event) {
         // The cross and circle button mappings may be swapped in the different regions so
         // determine if they are swapped so the proper key codes can be mapped to the keys
         boolean areKeysSwapped = areSonyXperiaGamepadKeysSwapped();
 
         int translatedKeyCode = keyCode;
         // If a Sony Xperia, remap the cross and circle buttons to buttons
         // A and B for the gamepad API
         switch (keyCode) {
@@ -104,17 +104,17 @@ public final class GamepadUtils {
 
             default:
                 return event;
         }
 
         return new KeyEvent(event.getAction(), translatedKeyCode);
     }
 
-    public static boolean isSonyXperiaGamepadKeyEvent(KeyEvent event) {
+    public static boolean isSonyXperiaGamepadKeyEvent(final KeyEvent event) {
         return (event.getDeviceId() == SONY_XPERIA_GAMEPAD_DEVICE_ID &&
                 "Sony Ericsson".equals(Build.MANUFACTURER) &&
                 ("R800".equals(Build.MODEL) || "R800i".equals(Build.MODEL)));
     }
 
     private static boolean areSonyXperiaGamepadKeysSwapped() {
         // The cross and circle buttons on Sony Xperia phones are swapped
         // in different regions
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GeckoBundle.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GeckoBundle.java
@@ -735,17 +735,17 @@ public final class GeckoBundle implement
                 }
             }
             return len == 0 ? EMPTY_STRING_ARRAY : new String[len];
         }
         return value;
     }
 
     @Override // Object
-    public boolean equals(Object other) {
+    public boolean equals(final Object other) {
         if (!(other instanceof GeckoBundle)) {
             return false;
         }
 
         // Support library's SimpleArrayMap.equals is buggy, so roll our own version.
         final SimpleArrayMap<String, Object> otherMap = ((GeckoBundle) other).mMap;
         if (mMap == otherMap) {
             return true;
@@ -920,17 +920,17 @@ public final class GeckoBundle implement
                 throw new UnsupportedOperationException();
             }
 
             i++;
         }
         return new GeckoBundle(keys, values);
     }
 
-    private static Object fromJSONValue(Object value) throws JSONException {
+    private static Object fromJSONValue(final Object value) throws JSONException {
         if (value == null || value == JSONObject.NULL) {
             return null;
         } else if (value instanceof JSONObject) {
             return fromJSONObject((JSONObject) value);
         }
         if (value instanceof JSONArray) {
             final JSONArray array = (JSONArray) value;
             final int len = array.length();
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GeckoJarReader.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GeckoJarReader.java
@@ -30,23 +30,24 @@ import java.util.Stack;
 /* Reads out of a multiple level deep jar file such as
  *  jar:jar:file:///data/app/org.mozilla.fennec.apk!/omni.ja!/chrome/chrome/content/branding/favicon32.png
  */
 public final class GeckoJarReader {
     private static final String LOGTAG = "GeckoJarReader";
 
     private GeckoJarReader() {}
 
-    public static Bitmap getBitmap(Context context, Resources resources, String url) {
+    public static Bitmap getBitmap(final Context context, final Resources resources,
+                                   final String url) {
         BitmapDrawable drawable = getBitmapDrawable(context, resources, url);
         return (drawable != null) ? drawable.getBitmap() : null;
     }
 
-    public static BitmapDrawable getBitmapDrawable(Context context, Resources resources,
-                                                   String url) {
+    public static BitmapDrawable getBitmapDrawable(final Context context, final Resources resources,
+                                                   final String url) {
         Stack<String> jarUrls = parseUrl(url);
         InputStream inputStream = null;
         BitmapDrawable bitmap = null;
 
         NativeZip zip = null;
         try {
             // Load the initial jar file as a zip
             zip = getZipFile(context, jarUrls.pop());
@@ -67,17 +68,17 @@ public final class GeckoJarReader {
                     Log.e(LOGTAG, "Error closing stream", ex);
                 }
             }
         }
 
         return bitmap;
     }
 
-    public static String getText(Context context, String url) {
+    public static String getText(final Context context, final String url) {
         Stack<String> jarUrls = parseUrl(url);
 
         NativeZip zip = null;
         BufferedReader reader = null;
         String text = null;
         try {
             zip = getZipFile(context, jarUrls.pop());
             InputStream input = getStream(zip, jarUrls, url);
@@ -95,34 +96,35 @@ public final class GeckoJarReader {
                     Log.e(LOGTAG, "Error closing reader", ex);
                 }
             }
         }
 
         return text;
     }
 
-    private static NativeZip getZipFile(Context context, String url)
+    private static NativeZip getZipFile(final Context context, final String url)
             throws IOException, URISyntaxException {
         URI fileUrl = new URI(url);
         GeckoLoader.loadMozGlue(context);
         return new NativeZip(fileUrl.getPath());
     }
 
     @RobocopTarget
     /**
      * Extract a (possibly nested) file from an archive and write it to a temporary file.
      *
      * @param context Android context.
      * @param url to open.  Can include jar: to "reach into" nested archives.
      * @param dir to write temporary file to.
      * @return a <code>File</code>, if one could be written; otherwise null.
      * @throws IOException if an error occured.
      */
-    public static File extractStream(Context context, String url, File dir, String suffix) throws IOException {
+    public static File extractStream(final Context context, final String url, final File dir,
+                                     final String suffix) throws IOException {
         InputStream input = null;
         try {
             try {
                 final URI fileURI = new URI(url);
                 // We don't check the scheme because we want to catch bare files, not just file:// URIs.
                 // If we let bare files through, we'd try to open them as ZIP files later -- and crash in native code.
                 if (fileURI != null && fileURI.getPath() != null) {
                     final File inputFile = new File(fileURI.getPath());
@@ -165,31 +167,32 @@ public final class GeckoJarReader {
                 } catch (IOException e) {
                     Log.w(LOGTAG, "Got exception closing stream; ignoring.", e);
                 }
             }
         }
     }
 
     @RobocopTarget
-    public static InputStream getStream(Context context, String url) {
+    public static InputStream getStream(final Context context, final String url) {
         Stack<String> jarUrls = parseUrl(url);
         try {
             NativeZip zip = getZipFile(context, jarUrls.pop());
             return getStream(zip, jarUrls, url);
         } catch (Exception ex) {
             // Some JNI code throws IllegalArgumentException on a bad file name;
             // swallow the error and return null.  We could also see legitimate
             // IOExceptions here.
             Log.e(LOGTAG, "Exception getting input stream from jar URL: " + url, ex);
             return null;
         }
     }
 
-    private static InputStream getStream(NativeZip zip, Stack<String> jarUrls, String origUrl) {