Bug 1512274 - [geckoview] LeftCurly checkstyle fixes r=geckoview-reviewers,snorp
authorAgi Sferro <agi@mozilla.com>
Fri, 15 Mar 2019 21:21:24 +0000
changeset 464454 6f9896e3f39a
parent 464453 4253ecfe57e9
child 464455 e96e3b52009e
push id35716
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:42:17 +0000
treeherdermozilla-central@8ee97c045359 [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] LeftCurly checkstyle fixes r=geckoview-reviewers,snorp Differential Revision: https://phabricator.services.mozilla.com/D23688
mobile/android/geckoview/src/main/java/org/mozilla/gecko/CrashHandler.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoHalDefines.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/NotificationListener.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceTextureListener.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/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/JellyBeanAsyncCodec.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/RemoteManager.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/Sample.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/SharedMemBuffer.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/JNIObject.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/NativeReference.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/SharedMemory.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/ContentUriUtils.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/INISection.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoEditable.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/GeckoWebExecutor.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/PanZoomController.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/CrashHandler.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/CrashHandler.java
@@ -53,17 +53,18 @@ public class CrashHandler implements Thr
     /**
      * Get the root exception from the 'cause' chain of an exception.
      *
      * @param exc An exception
      * @return The root exception
      */
     public static Throwable getRootException(final Throwable exc) {
         Throwable cause;
-        for (cause = exc; cause != null; cause = cause.getCause()) {}
+        for (cause = exc; cause != null; cause = cause.getCause()) {
+        }
 
         return cause;
     }
 
     /**
      * Get the standard stack trace string of an exception.
      *
      * @param exc An exception
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
@@ -82,18 +82,17 @@ import android.text.TextUtils;
 import android.util.Log;
 import android.view.ContextThemeWrapper;
 import android.view.Display;
 import android.view.HapticFeedbackConstants;
 import android.view.InputDevice;
 import android.view.WindowManager;
 import android.webkit.MimeTypeMap;
 
-public class GeckoAppShell
-{
+public class GeckoAppShell {
     private static final String LOGTAG = "GeckoAppShell";
 
     // We have static members only.
     private GeckoAppShell() { }
 
     private static class GeckoCrashHandler extends CrashHandler {
 
         public GeckoCrashHandler(final Class<? extends Service> handlerService) {
@@ -508,29 +507,23 @@ 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(final String provider)
-        {
-        }
+        public void onProviderDisabled(final String provider) {}
 
         @Override
-        public void onProviderEnabled(final String provider)
-        {
-        }
+        public void onProviderEnabled(final String provider) {}
 
         @Override
-        public void onStatusChanged(final String provider, final int status, final Bundle extras)
-        {
-        }
+        public void onStatusChanged(final String provider, final int status, final Bundle extras) {}
 
         @Override // NotificationListener
         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);
         }
 
@@ -1444,18 +1437,17 @@ public class GeckoAppShell
             Bitmap bitmap = ((BitmapDrawable)icon).getBitmap();
             if (bitmap.getWidth() != resolvedIconSize || bitmap.getHeight() != resolvedIconSize)
                 bitmap = Bitmap.createScaledBitmap(bitmap, resolvedIconSize, resolvedIconSize, true);
 
             ByteBuffer buf = ByteBuffer.allocate(resolvedIconSize * resolvedIconSize * 4);
             bitmap.copyPixelsToBuffer(buf);
 
             return buf.array();
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             Log.w(LOGTAG, "getIconForExtension failed.",  e);
             return null;
         }
     }
 
     public static String getMimeTypeFromExtension(final String ext) {
         final MimeTypeMap mtm = MimeTypeMap.getSingleton();
         return mtm.getMimeTypeFromExtension(ext);
@@ -1485,18 +1477,17 @@ public class GeckoAppShell
 
     @WrapForJNI(calledFrom = "gecko")
     private static boolean getShowPasswordSetting() {
         try {
             int showPassword =
                 Settings.System.getInt(getApplicationContext().getContentResolver(),
                                        Settings.System.TEXT_SHOW_PASSWORD, 1);
             return (showPassword > 0);
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             return true;
         }
     }
 
     private static Context sApplicationContext;
 
     @WrapForJNI
     public static Context getApplicationContext() {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoHalDefines.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoHalDefines.java
@@ -1,17 +1,16 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko;
 
-public class GeckoHalDefines
-{
+public class GeckoHalDefines {
     /*
      * Keep these values consistent with |SensorType| in HalSensor.h
      */
     public static final int SENSOR_ORIENTATION = 0;
     public static final int SENSOR_ACCELERATION = 1;
     public static final int SENSOR_PROXIMITY = 2;
     public static final int SENSOR_LINEAR_ACCELERATION = 3;
     public static final int SENSOR_GYROSCOPE = 4;
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/NotificationListener.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/NotificationListener.java
@@ -1,17 +1,16 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko;
 
-public interface NotificationListener
-{
+public interface NotificationListener {
     void showNotification(String name, String cookie, String title, String text,
                           String host, String imageUrl);
 
     void showPersistentNotification(String name, String cookie, String title, String text,
                                     String host, String imageUrl, String data);
 
     void closeNotification(String name);
 }
--- 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
@@ -6,18 +6,17 @@
 package org.mozilla.gecko;
 
 import org.mozilla.gecko.annotation.WrapForJNI;
 import org.mozilla.gecko.mozglue.JNIObject;
 
 import android.graphics.SurfaceTexture;
 
 /* package */ final class SurfaceTextureListener
-    extends JNIObject implements SurfaceTexture.OnFrameAvailableListener
-{
+    extends JNIObject implements SurfaceTexture.OnFrameAvailableListener {
     @WrapForJNI(calledFrom = "gecko")
     private SurfaceTextureListener() {
     }
 
     @WrapForJNI(dispatchTo = "gecko") @Override // JNIObject
     protected native void disposeNative();
 
     @Override
--- 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
@@ -131,17 +131,19 @@ import org.mozilla.gecko.gfx.GeckoSurfac
             }
 
         }
 
         private boolean isValidBuffer(final int index) {
             try {
                 return mCodec.getInputBuffer(index) != null;
             } catch (IllegalStateException e) {
-                if (DEBUG) { Log.d(LOGTAG, "invalid input buffer#" + index, e); }
+                if (DEBUG) {
+                    Log.d(LOGTAG, "invalid input buffer#" + index, e);
+                }
                 return false;
             }
         }
 
         private void feedSampleToBuffer() {
             while (!mAvailableInputBuffers.isEmpty() && !mInputSamples.isEmpty()) {
                 int index = mAvailableInputBuffers.poll();
                 int len = 0;
@@ -262,17 +264,19 @@ import org.mozilla.gecko.gfx.GeckoSurfac
                 Log.d(LOGTAG, "output EOS");
             }
         }
 
         private boolean isValidBuffer(final int index) {
             try {
                 return (mCodec.getOutputBuffer(index) != null) || mRenderToSurface;
             } catch (IllegalStateException e) {
-                if (DEBUG) { Log.e(LOGTAG, "invalid buffer#" + index, e); }
+                if (DEBUG) {
+                    Log.e(LOGTAG, "invalid buffer#" + index, e);
+                }
                 return false;
             }
         }
 
         private Sample obtainOutputSample(final int index, final MediaCodec.BufferInfo info) {
             Sample sample = mSamplePool.obtainOutput(info);
 
             if (mRenderToSurface) {
@@ -297,17 +301,19 @@ import org.mozilla.gecko.gfx.GeckoSurfac
             }
 
             return sample;
         }
 
         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"); }
+                if (DEBUG) {
+                    Log.d(LOGTAG, sample + " already released");
+                }
                 return;
             }
             mCodec.releaseOutputBuffer(output.index, render);
             mSamplePool.recycleOutput(output.sample);
 
             sample.dispose();
         }
 
@@ -376,21 +382,25 @@ import org.mozilla.gecko.gfx.GeckoSurfac
                                           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); }
+            if (DEBUG) {
+                Log.d(LOGTAG, "release existing codec: " + mCodec);
+            }
             mCodec.release();
         }
 
-        if (DEBUG) { Log.d(LOGTAG, "configure " + this); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "configure " + this);
+        }
 
         final MediaFormat fmt = format.asFormat();
         final String mime = fmt.getString(MediaFormat.KEY_MIME);
         if (mime == null || mime.isEmpty()) {
             Log.e(LOGTAG, "invalid MIME type: " + mime);
             return false;
         }
 
@@ -405,17 +415,19 @@ import org.mozilla.gecko.gfx.GeckoSurfac
             mCodec = codec;
             mInputProcessor = new InputProcessor();
             final boolean renderToSurface = surface != null;
             mOutputProcessor = new OutputProcessor(renderToSurface);
             mSamplePool = new SamplePool(name, renderToSurface);
             if (renderToSurface) {
                 mIsTunneledPlaybackSupported = mCodec.isTunneledPlaybackSupported(mime);
             }
-            if (DEBUG) { Log.d(LOGTAG, codec.toString() + " created. Render to surface?" + renderToSurface); }
+            if (DEBUG) {
+                Log.d(LOGTAG, codec.toString() + " created. Render to surface?" + renderToSurface);
+            }
             return true;
         }
 
         return false;
     }
 
     private List<String> findMatchingCodecNames(final String mimeType, final boolean isEncoder) {
         final int numCodecs = MediaCodecList.getCodecCount();
@@ -463,17 +475,19 @@ import org.mozilla.gecko.gfx.GeckoSurfac
         }
     }
 
     private void setupAdaptivePlayback(final AsyncCodec codec, final MediaFormat format) {
         // Video decoder should config with adaptive playback capability.
         mIsAdaptivePlaybackSupported = codec.isAdaptivePlaybackSupported(
                 format.getString(MediaFormat.KEY_MIME));
         if (mIsAdaptivePlaybackSupported) {
-            if (DEBUG) { Log.d(LOGTAG, "codec supports adaptive playback  = " + mIsAdaptivePlaybackSupported); }
+            if (DEBUG) {
+                Log.d(LOGTAG, "codec supports adaptive playback  = " + mIsAdaptivePlaybackSupported);
+            }
             // TODO: may need to find a way to not use hard code to decide the max w/h.
             format.setInteger(MediaFormat.KEY_MAX_WIDTH, 1920);
             format.setInteger(MediaFormat.KEY_MAX_HEIGHT, 1080);
         }
     }
 
     @Override
     public synchronized boolean isAdaptivePlaybackSupported() {
@@ -487,17 +501,19 @@ import org.mozilla.gecko.gfx.GeckoSurfac
 
     @Override
     public synchronized boolean isTunneledPlaybackSupported() {
         return mIsTunneledPlaybackSupported;
     }
 
     @Override
     public synchronized void start() throws RemoteException {
-        if (DEBUG) { Log.d(LOGTAG, "start " + this); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "start " + this);
+        }
         mInputProcessor.start();
         mOutputProcessor.start();
         try {
             mCodec.start();
         } catch (Exception e) {
             reportError(Error.FATAL, e);
         }
     }
@@ -512,36 +528,42 @@ import org.mozilla.gecko.gfx.GeckoSurfac
             // mCallbacks has been disposed by release().
         } catch (RemoteException re) {
             re.printStackTrace();
         }
     }
 
     @Override
     public synchronized void stop() throws RemoteException {
-        if (DEBUG) { Log.d(LOGTAG, "stop " + this); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "stop " + this);
+        }
         try {
             mInputProcessor.stop();
             mOutputProcessor.stop();
 
             mCodec.stop();
         } catch (Exception e) {
             reportError(Error.FATAL, e);
         }
     }
 
     @Override
     public synchronized void flush() throws RemoteException {
-        if (DEBUG) { Log.d(LOGTAG, "flush " + this); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "flush " + this);
+        }
         try {
             mInputProcessor.stop();
             mOutputProcessor.stop();
 
             mCodec.flush();
-            if (DEBUG) { Log.d(LOGTAG, "flushed " + this); }
+            if (DEBUG) {
+                Log.d(LOGTAG, "flushed " + this);
+            }
             mInputProcessor.start();
             mOutputProcessor.start();
             mCodec.resumeReceivingInputs();
         } catch (Exception e) {
             reportError(Error.FATAL, e);
         }
     }
 
@@ -579,17 +601,19 @@ import org.mozilla.gecko.gfx.GeckoSurfac
             mOutputProcessor.onRelease(sample, render);
         } catch (Exception e) {
             reportError(Error.FATAL, e);
         }
     }
 
     @Override
     public synchronized void release() throws RemoteException {
-        if (DEBUG) { Log.d(LOGTAG, "release " + this); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "release " + this);
+        }
         try {
             // In case Codec.stop() is not called yet.
             mInputProcessor.stop();
             mOutputProcessor.stop();
 
             mCodec.release();
         } catch (Exception e) {
             reportError(Error.FATAL, e);
--- 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
@@ -166,48 +166,45 @@ public final class CodecProxy {
             return true;
         } catch (RemoteException e) {
             e.printStackTrace();
             return false;
         }
     }
 
     @WrapForJNI
-    public synchronized boolean isAdaptivePlaybackSupported()
-    {
+    public synchronized boolean isAdaptivePlaybackSupported() {
       if (mRemote == null) {
           Log.e(LOGTAG, "cannot check isAdaptivePlaybackSupported with an ended codec");
           return false;
       }
       try {
             return mRemote.isAdaptivePlaybackSupported();
         } catch (RemoteException e) {
             e.printStackTrace();
             return false;
         }
     }
 
     @WrapForJNI
-    public synchronized boolean isHardwareAccelerated()
-    {
+    public synchronized boolean isHardwareAccelerated() {
       if (mRemote == null) {
           Log.e(LOGTAG, "cannot check isHardwareAccelerated with an ended codec");
           return false;
       }
       try {
             return mRemote.isHardwareAccelerated();
         } catch (RemoteException e) {
             e.printStackTrace();
             return false;
         }
     }
 
     @WrapForJNI
-    public synchronized boolean isTunneledPlaybackSupported()
-    {
+    public synchronized boolean isTunneledPlaybackSupported() {
       if (mRemote == null) {
           Log.e(LOGTAG, "cannot check isTunneledPlaybackSupported with an ended codec");
           return false;
       }
       try {
             return mRemote.isTunneledPlaybackSupported();
         } catch (RemoteException e) {
             e.printStackTrace();
@@ -261,17 +258,19 @@ public final class CodecProxy {
         if (mFlushed) {
             return true;
         }
         if (mRemote == null) {
             Log.e(LOGTAG, "cannot flush an ended codec");
             return false;
         }
         try {
-            if (DEBUG) { Log.d(LOGTAG, "flush " + this); }
+            if (DEBUG) {
+                Log.d(LOGTAG, "flush " + this);
+            }
             mRemote.flush();
             mFlushed = true;
         } catch (DeadObjectException e) {
             return false;
         } catch (RemoteException e) {
             e.printStackTrace();
             return false;
         }
@@ -281,17 +280,19 @@ public final class CodecProxy {
     @WrapForJNI
     public boolean release() {
         mCallbacks.setCodecProxyReleased();
         synchronized (this) {
             if (mRemote == null) {
                 Log.w(LOGTAG, "codec already ended");
                 return true;
             }
-            if (DEBUG) { Log.d(LOGTAG, "release " + this); }
+            if (DEBUG) {
+                Log.d(LOGTAG, "release " + this);
+            }
 
             if (!mSurfaceOutputs.isEmpty()) {
                 // Flushing output buffers to surface may cause some frames to be skipped and
                 // should not happen unless caller release codec before processing all buffers.
                 Log.w(LOGTAG, "release codec when " + mSurfaceOutputs.size() + " output buffers unhandled");
                 try {
                     for (Sample s : mSurfaceOutputs) {
                         mRemote.releaseOutput(s, true);
--- 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
@@ -147,17 +147,19 @@ public class GeckoHlsAudioRenderer exten
                           sample.duration + ", formatIndex(" +
                           sample.formatIndex + "), queue size : " +
                           mDemuxedInputSamples.size());
         }
     }
 
     @Override
     protected boolean clearInputSamplesQueue() {
-        if (DEBUG) { Log.d(LOGTAG, "clearInputSamplesQueue"); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "clearInputSamplesQueue");
+        }
         mDemuxedInputSamples.clear();
         return true;
     }
 
     @Override
     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
@@ -95,18 +95,22 @@ public class GeckoHlsPlayer implements B
     // 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(final boolean enableVideoRenderer, final boolean enableAudioRenderer) {
             this.mEnableV = enableVideoRenderer;
             this.mEnableA = enableAudioRenderer;
         }
-        boolean isVideoRendererEnabled() { return mEnableV; }
-        boolean isAudioRendererEnabled() { return mEnableA; }
+        boolean isVideoRendererEnabled() {
+            return mEnableV;
+        }
+        boolean isAudioRendererEnabled() {
+            return mEnableA;
+        }
     }
     private RendererController mRendererController = new RendererController(true, true);
 
     // Provide statistical information of tracks.
     private class HlsMediaTracksInfo {
         private int mNumVideoTracks = 0;
         private int mNumAudioTracks = 0;
         private boolean mVideoInfoUpdated = false;
@@ -117,24 +121,40 @@ public class GeckoHlsPlayer implements B
         public void reset() {
             mNumVideoTracks = 0;
             mNumAudioTracks = 0;
             mVideoInfoUpdated = false;
             mAudioInfoUpdated = false;
             mVideoDataArrived = false;
             mAudioDataArrived = false;
         }
-        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 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(final int trackType) {
             if (trackType == C.TRACK_TYPE_VIDEO) {
                 mVideoDataArrived = true;
             } else if (trackType == C.TRACK_TYPE_AUDIO) {
                 mAudioDataArrived = true;
             }
         }
         public boolean videoReady() {
@@ -226,17 +246,19 @@ public class GeckoHlsPlayer implements B
     }
 
     public final class ComponentListener {
 
         // General purpose implementation
         // Called on GeckoHlsPlayerThread
         public void onDataArrived(final int trackType) {
             synchronized (GeckoHlsPlayer.this) {
-                if (DEBUG) { Log.d(LOGTAG, "[CB][onDataArrived] id " + mPlayerId); }
+                if (DEBUG) {
+                    Log.d(LOGTAG, "[CB][onDataArrived] id " + mPlayerId);
+                }
                 if (!mIsPlayerInitDone) {
                     return;
                 }
                 mTracksInfo.onDataArrived(trackType);
                 mResourceCallbacks.onDataArrived();
                 checkInitDone();
             }
         }
@@ -291,87 +313,101 @@ public class GeckoHlsPlayer implements B
     }
 
     private synchronized long getDuration() {
         long duration = 0L;
         // Value returned by getDuration() is in milliseconds.
         if (mPlayer != null && !isLiveStream()) {
             duration = Math.max(0L, mPlayer.getDuration() * 1000L);
         }
-        if (DEBUG) { Log.d(LOGTAG, "getDuration : " + duration  + "(Us)"); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "getDuration : " + duration  + "(Us)");
+        }
         return duration;
     }
 
     // To make sure that each player has a unique id, GeckoHlsPlayer should be
     // created only from synchronized APIs in GeckoPlayerFactory.
     public GeckoHlsPlayer() {
         mPlayerId = sPlayerId.incrementAndGet();
-        if (DEBUG) { Log.d(LOGTAG, " construct player with id(" + mPlayerId + ")"); }
+        if (DEBUG) {
+            Log.d(LOGTAG, " construct player with id(" + mPlayerId + ")");
+        }
     }
 
     // Should be only called by GeckoPlayerFactory and GeckoHLSResourceWrapper.
     // The mPlayerId is used to make sure that the same GeckoHlsPlayer is used by
     // corresponding HLSResource and HLSDemuxer for each media playback.
     // Called on Gecko's main thread
     @Override
     public int getId() {
         return mPlayerId;
     }
 
     // Called on Gecko's main thread
     @Override
     public synchronized void addDemuxerWrapperCallbackListener(
             final BaseHlsPlayer.DemuxerCallbacks callback) {
-        if (DEBUG) { Log.d(LOGTAG, " addDemuxerWrapperCallbackListener ..."); }
+        if (DEBUG) {
+            Log.d(LOGTAG, " addDemuxerWrapperCallbackListener ...");
+        }
         mDemuxerCallbacks = callback;
     }
 
     // Called on GeckoHlsPlayerThread from ExoPlayer
     @Override
     public synchronized void onLoadingChanged(final boolean isLoading) {
-        if (DEBUG) { Log.d(LOGTAG, "loading [" + 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(final boolean playWhenReady, final int state) {
-        if (DEBUG) { Log.d(LOGTAG, "state [" + playWhenReady + ", " + getStateString(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"); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "positionDiscontinuity");
+        }
     }
 
     // Called on GeckoHlsPlayerThread from ExoPlayer
     @Override
     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(final ExoPlaybackException e) {
-        if (DEBUG) { Log.e(LOGTAG, "playerFailed" , 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());
         }
     }
@@ -466,17 +502,19 @@ public class GeckoHlsPlayer implements B
         // 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;
 
         int periodCount = timeline.getPeriodCount();
         int windowCount = timeline.getWindowCount();
-        if (DEBUG) { Log.d(LOGTAG, "sourceInfo [periodCount=" + periodCount + ", windowCount=" + windowCount); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "sourceInfo [periodCount=" + periodCount + ", windowCount=" + windowCount);
+        }
         Timeline.Period period = new Timeline.Period();
         for (int i = 0; i < Math.min(periodCount, MAX_TIMELINE_ITEM_LINES); i++) {
           timeline.getPeriod(i, period);
           if (mDurationUs < period.getDurationUs()) {
               mDurationUs = period.getDurationUs();
           }
         }
         for (int i = 0; i < Math.min(windowCount, MAX_TIMELINE_ITEM_LINES); i++) {
@@ -594,17 +632,19 @@ public class GeckoHlsPlayer implements B
     }
     // =======================================================================
     // API for GeckoHLSResourceWrapper
     // =======================================================================
     // Called on Gecko Main Thread
     @Override
     public synchronized void init(final String url,
                                   final BaseHlsPlayer.ResourceCallbacks callback) {
-        if (DEBUG) { Log.d(LOGTAG, " init"); }
+        if (DEBUG) {
+            Log.d(LOGTAG, " init");
+        }
         assertTrue(callback != null);
         assertTrue(!mIsPlayerInitDone);
 
         mResourceCallbacks = callback;
         mThread = new HandlerThread("GeckoHlsPlayerThread");
         mThread.start();
         mMainHandler = new Handler(mThread.getLooper());
 
@@ -639,36 +679,42 @@ public class GeckoHlsPlayer implements B
         }
     }
 
     // Called on MFR's TaskQueue
     @Override
     public synchronized long getBufferedPosition() {
         // 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)"); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "getBufferedPosition : " + bufferedPos + "(Us)");
+        }
         return bufferedPos;
     }
 
     // Called on MFR's TaskQueue
     @Override
     public synchronized int getNumberOfTracks(final TrackType trackType) {
-        if (DEBUG) { Log.d(LOGTAG, "getNumberOfTracks : type " + 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(final int index) {
-        if (DEBUG) { Log.d(LOGTAG, "getVideoInfo"); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "getVideoInfo");
+        }
         assertTrue(mVRenderer != null);
         if (!mTracksInfo.hasVideo()) {
             return null;
         }
         Format fmt = mVRenderer.getFormat(index);
         if (fmt == null) {
             return null;
         }
@@ -678,17 +724,19 @@ public class GeckoHlsPlayer implements B
                                                   getDuration(), fmt.sampleMimeType,
                                                   null, null);
         return vInfo;
     }
 
     // Called on MFR's TaskQueue
     @Override
     public synchronized GeckoAudioInfo getAudioInfo(final int index) {
-        if (DEBUG) { Log.d(LOGTAG, "getAudioInfo"); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "getAudioInfo");
+        }
         assertTrue(mARenderer != null);
         if (!mTracksInfo.hasAudio()) {
             return null;
         }
         Format fmt = mARenderer.getFormat(index);
         if (fmt == null) {
             return null;
         }
@@ -791,51 +839,61 @@ public class GeckoHlsPlayer implements B
     }
 
     // Called on Gecko's main thread.
     @Override
     public synchronized void play() {
         if (mMediaDecoderPlayState == MediaDecoderPlayState.PLAY_STATE_PLAYING) {
             return;
         }
-        if (DEBUG) { Log.d(LOGTAG, "MediaDecoder played."); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "MediaDecoder played.");
+        }
         mMediaDecoderPlayState = MediaDecoderPlayState.PLAY_STATE_PLAYING;
         resumeExoplayer();
     }
 
     // Called on Gecko's main thread.
     @Override
     public synchronized void pause() {
         if (mMediaDecoderPlayState != MediaDecoderPlayState.PLAY_STATE_PLAYING) {
             return;
         }
-        if (DEBUG) { Log.d(LOGTAG, "MediaDecoder paused."); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "MediaDecoder paused.");
+        }
         mMediaDecoderPlayState = MediaDecoderPlayState.PLAY_STATE_PAUSED;
         suspendExoplayer();
     }
 
     private synchronized void suspendExoplayer() {
         if (mPlayer != null) {
             mExoplayerSuspended = true;
-            if (DEBUG) { Log.d(LOGTAG, "suspend Exoplayer"); }
+            if (DEBUG) {
+                Log.d(LOGTAG, "suspend Exoplayer");
+            }
             mPlayer.setPlayWhenReady(false);
         }
     }
 
     private synchronized void resumeExoplayer() {
         if (mPlayer != null) {
             mExoplayerSuspended = false;
-            if (DEBUG) { Log.d(LOGTAG, "resume Exoplayer"); }
+            if (DEBUG) {
+                Log.d(LOGTAG, "resume Exoplayer");
+            }
             mPlayer.setPlayWhenReady(true);
         }
     }
     // Called on Gecko's main thread, when HLSDemuxer or HLSResource destructs.
     @Override
     public synchronized void release() {
-        if (DEBUG) { Log.d(LOGTAG, "releasing  ... id : " + mPlayerId); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "releasing  ... id : " + mPlayerId);
+        }
         if (mPlayer != null) {
             mPlayer.removeListener(this);
             mPlayer.stop();
             mPlayer.release();
             mVRenderer = null;
             mARenderer = null;
             mPlayer = null;
         }
--- 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
@@ -84,21 +84,25 @@ public abstract class GeckoHlsRendererBa
             lastPTS = sample.info.presentationTimeUs;
         }
         return Math.abs(lastPTS - firstPTS) > QUEUED_INPUT_SAMPLE_DURATION_THRESHOLD;
     }
 
     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); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "getFormat : index = " + index + ", format : " + fmt);
+        }
         return fmt;
     }
 
-    public synchronized long getFirstSamplePTS() { return mFirstSampleStartTime; }
+    public synchronized long getFirstSamplePTS() {
+        return mFirstSampleStartTime;
+    }
 
     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++) {
@@ -106,21 +110,25 @@ public abstract class GeckoHlsRendererBa
                 break;
             }
             sample = mDemuxedInputSamples.poll();
             samples.offer(sample);
         }
 
         sample = samples.isEmpty() ? null : samples.peek();
         if (sample == null) {
-            if (DEBUG) { Log.d(LOGTAG, "getQueuedSamples isEmpty, mWaitingForData = true !"); }
+            if (DEBUG) {
+                Log.d(LOGTAG, "getQueuedSamples isEmpty, mWaitingForData = true !");
+            }
             mWaitingForData = true;
         } else if (mFirstSampleStartTime == Long.MIN_VALUE) {
             mFirstSampleStartTime = sample.info.presentationTimeUs;
-            if (DEBUG) { Log.d(LOGTAG, "mFirstSampleStartTime = " + mFirstSampleStartTime); }
+            if (DEBUG) {
+                Log.d(LOGTAG, "mFirstSampleStartTime = " + mFirstSampleStartTime);
+            }
         }
         return samples;
     }
 
     protected void handleDrmInitChanged(final Format oldFormat, final Format newFormat) {
         Object oldDrmInit = oldFormat == null ? null : oldFormat.drmInitData;
         Object newDrnInit = newFormat.drmInitData;
 
@@ -171,17 +179,19 @@ public abstract class GeckoHlsRendererBa
         updateCSDInfo(newFormat);
         notifyPlayerInputFormatChanged(newFormat);
     }
 
     protected void maybeInitRenderer() throws ExoPlaybackException {
         if (mInitialized || mFormats.size() == 0) {
             return;
         }
-        if (DEBUG) { Log.d(LOGTAG, "Initializing ... "); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "Initializing ... ");
+        }
         try {
             createInputBuffer();
             mInitialized = true;
         } catch (OutOfMemoryError e) {
             throw ExoPlaybackException.createForRenderer(new RuntimeException(e), getIndex());
         }
     }
 
@@ -224,32 +234,36 @@ public abstract class GeckoHlsRendererBa
 
         if (result == C.RESULT_FORMAT_READ) {
             handleFormatRead(mBufferForRead);
             return true;
         }
 
         // We've read a buffer.
         if (mBufferForRead.isEndOfStream()) {
-            if (DEBUG) { Log.d(LOGTAG, "Now we're at the End Of Stream."); }
+            if (DEBUG) {
+                Log.d(LOGTAG, "Now we're at the End Of Stream.");
+            }
             handleEndOfStream(mBufferForRead);
             return false;
         }
 
         mBufferForRead.flip();
 
         handleSamplePreparation(mBufferForRead);
 
         maybeNotifyDataArrived();
         return true;
     }
 
     private void maybeNotifyDataArrived() {
         if (mWaitingForData && isQueuedEnoughData()) {
-            if (DEBUG) { Log.d(LOGTAG, "onDataArrived"); }
+            if (DEBUG) {
+                Log.d(LOGTAG, "onDataArrived");
+            }
             mPlayerEventDispatcher.onDataArrived(getTrackType());
             mWaitingForData = false;
         }
     }
 
     private void readFormat() throws ExoPlaybackException {
         mFlagsOnlyBuffer.clear();
         int result = readSource(mFormatHolder, mFlagsOnlyBuffer, true);
@@ -276,17 +290,19 @@ public abstract class GeckoHlsRendererBa
 
     @Override
     public boolean isEnded() {
         return mInputStreamEnded;
     }
 
     @Override
     protected synchronized void onPositionReset(final long positionUs, final boolean joining) {
-        if (DEBUG) { Log.d(LOGTAG, "onPositionReset : positionUs = " + positionUs); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "onPositionReset : positionUs = " + positionUs);
+        }
         mInputStreamEnded = false;
         if (mInitialized) {
             clearInputSamplesQueue();
         }
     }
 
     /*
      * This is called by ExoPlayerImplInternal.java.
--- 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
@@ -150,17 +150,19 @@ public class GeckoHlsVideoRenderer exten
         } catch (OutOfMemoryError e) {
             Log.e(LOGTAG, "cannot allocate input buffer of size " + mCodecMaxValues.inputSize, e);
             throw ExoPlaybackException.createForRenderer(new Exception(e), getIndex());
         }
     }
 
     @Override
     protected void resetRenderer() {
-        if (DEBUG) { Log.d(LOGTAG, "[resetRenderer] mInitialized = " + mInitialized); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "[resetRenderer] mInitialized = " + mInitialized);
+        }
         if (mInitialized) {
             mRendererReconfigured = false;
             mRendererReconfigurationState = RECONFIGURATION_STATE.NONE;
             mInputBuffer = null;
             mCSDInfo = null;
             mInitialized = false;
         }
     }
@@ -168,46 +170,54 @@ public class GeckoHlsVideoRenderer exten
     @Override
     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."); }
+                if (DEBUG) {
+                    Log.d(LOGTAG, "[feedInput][WRITE_PENDING] bufferForRead.data is not initialized.");
+                }
                 return;
             }
-            if (DEBUG) { Log.d(LOGTAG, "[feedInput][WRITE_PENDING] put initialization data"); }
+            if (DEBUG) {
+                Log.d(LOGTAG, "[feedInput][WRITE_PENDING] put initialization data");
+            }
             Format currentFormat = mFormats.get(mFormats.size() - 1);
             for (int i = 0; i < currentFormat.initializationData.size(); i++) {
                 byte[] data = currentFormat.initializationData.get(i);
                 bufferForRead.data.put(data);
             }
             mRendererReconfigurationState = RECONFIGURATION_STATE.QUEUE_PENDING;
         }
     }
 
     @Override
     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."); }
+            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(final DecoderInputBuffer bufferForRead) {
         if (mRendererReconfigurationState == RECONFIGURATION_STATE.QUEUE_PENDING) {
-            if (DEBUG) { Log.d(LOGTAG, "[feedInput][QUEUE_PENDING] isEndOfStream."); }
+            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;
@@ -252,44 +262,52 @@ public class GeckoHlsVideoRenderer exten
         calculatDuration(sample);
         mRendererReconfigurationState = RECONFIGURATION_STATE.NONE;
     }
 
     @Override
     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"); }
+            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;
         }
     }
 
     @Override
     protected boolean clearInputSamplesQueue() {
-        if (DEBUG) { Log.d(LOGTAG, "clearInputSamplesQueue"); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "clearInputSamplesQueue");
+        }
         mDemuxedInputSamples.clear();
         mDemuxedNoDurationSamples.clear();
         return true;
     }
 
     @Override
     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); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "[canReconfigure] : " + canReconfig);
+        }
         return canReconfig;
     }
 
     @Override
     protected void prepareReconfiguration() {
-        if (DEBUG) { Log.d(LOGTAG, "[onInputFormatChanged] starting reconfiguration !"); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "[onInputFormatChanged] starting reconfiguration !");
+        }
         mRendererReconfigured = true;
         mRendererReconfigurationState = RECONFIGURATION_STATE.WRITE_PENDING;
     }
 
     @Override
     protected void updateCSDInfo(final Format format) {
         int size = 0;
         for (int i = 0; i < format.initializationData.size(); i++) {
@@ -297,17 +315,19 @@ public class GeckoHlsVideoRenderer exten
         }
         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) + "]"); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "mCSDInfo [" + Utils.bytesToHex(mCSDInfo) + "]");
+        }
     }
 
     @Override
     protected void notifyPlayerInputFormatChanged(final Format newFormat) {
         mPlayerEventDispatcher.onVideoInputFormatChanged(newFormat);
     }
 
     private void calculateSamplesWithin(final GeckoHLSSample[] samples, final int range) {
@@ -372,17 +392,19 @@ public class GeckoHlsVideoRenderer exten
 
             // NOTE : We're not able to calculate the duration for the last sample.
             //        A workaround here is to assign a close duration to it.
             long prevDuration = 33333;
             GeckoHLSSample sample = null;
             for (sample = mDemuxedNoDurationSamples.poll(); sample != null; sample = mDemuxedNoDurationSamples.poll()) {
                 if (sample.duration == Long.MAX_VALUE) {
                     sample.duration = prevDuration;
-                    if (DEBUG) { Log.d(LOGTAG, "Adjust the PTS of the last sample to " + sample.duration + " (us)"); }
+                    if (DEBUG) {
+                        Log.d(LOGTAG, "Adjust the PTS of the last sample to " + sample.duration + " (us)");
+                    }
                 }
                 prevDuration = sample.duration;
                 if (DEBUG) {
                     Log.d(LOGTAG, "last loop to offer samples - PTS : " +
                                   sample.info.presentationTimeUs + ", Duration : " +
                                   sample.duration + ", isEOS : " + sample.isEOS());
                 }
                 mDemuxedInputSamples.offer(sample);
--- 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
@@ -310,18 +310,17 @@ 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(final 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(final int createSessionToken,
--- 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
@@ -43,14 +43,13 @@ public class GeckoMediaDrmBridgeV23 exte
                                                  keyStatus.getStatusCode());
             }
             onSessionBatchedKeyChanged(sessionId, keyInfos);
             if (DEBUG) Log.d(LOGTAG, "Key successfully added for session " + new String(sessionId));
         }
     }
 
     @Override
-    protected void HandleKeyStatusChangeByDummyKey(final 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/JellyBeanAsyncCodec.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/JellyBeanAsyncCodec.java
@@ -59,17 +59,19 @@ final class JellyBeanAsyncCodec implemen
                 if (isCanceled() || handleMessageLocked(msg)) {
                     return;
                 }
             }
 
             switch (msg.what) {
                 case MSG_CANCELLATION:
                     // Just a marker. Nothing to do here.
-                    if (DEBUG) { Log.d(LOGTAG, "handler " + this + " done cancellation, codec=" + JellyBeanAsyncCodec.this); }
+                    if (DEBUG) {
+                        Log.d(LOGTAG, "handler " + this + " done cancellation, codec=" + JellyBeanAsyncCodec.this);
+                    }
                     break;
                 default:
                     super.handleMessage(msg);
                     break;
             }
         }
      }
 
@@ -271,17 +273,19 @@ final class JellyBeanAsyncCodec implemen
     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()); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "start poller for codec:" + this + ", thread=" + thread.getThreadId());
+        }
     }
 
     @Override
     public void setCallbacks(final AsyncCodec.Callbacks callbacks, final Handler handler) {
         if (callbacks == null) {
             return;
         }
 
@@ -290,17 +294,19 @@ final class JellyBeanAsyncCodec implemen
             // Use this thread if no handler supplied.
             looper = Looper.myLooper();
         }
         if (looper == null) {
             // This thread has no looper. Use poller thread.
             looper = mBufferPoller.getLooper();
         }
         mCallbackSender = new CallbackSender(looper, callbacks);
-        if (DEBUG) { Log.d(LOGTAG, "setCallbacks(): sender=" + mCallbackSender); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "setCallbacks(): sender=" + mCallbackSender);
+        }
     }
 
     @Override
     public void configure(final MediaFormat format, final Surface surface,
                           final MediaCrypto crypto, final int flags) {
         assertCallbacks();
 
         mCodec.configure(format, surface, crypto, flags);
@@ -463,11 +469,13 @@ final class JellyBeanAsyncCodec implemen
         if (mBufferPoller == null) {
             Log.e(LOGTAG, "no initialized poller.");
             return;
         }
 
         mBufferPoller.getLooper().quit();
         mBufferPoller = null;
 
-        if (DEBUG) { Log.d(LOGTAG, "stop poller " + this); }
+        if (DEBUG) {
+            Log.d(LOGTAG, "stop poller " + this);
+        }
     }
 }
--- 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
@@ -74,30 +74,34 @@ public final class RemoteManager impleme
         // Wait up to 5s.
         private synchronized void waitConnect() {
             int waitCount = 0;
             while (mRemote == null && waitCount < 5) {
                 try {
                     wait(1000);
                     waitCount++;
                 } catch (InterruptedException e) {
-                    if (DEBUG) { e.printStackTrace(); }
+                    if (DEBUG) {
+                        e.printStackTrace();
+                    }
                 }
             }
             if (DEBUG) {
                 Log.d(LOGTAG, "wait ~" + waitCount + "s for connection: " + (mRemote == null ? "fail" : "ok"));
             }
         }
 
         private synchronized void waitDisconnect() {
             while (mRemote != null) {
                 try {
                     wait(1000);
                 } catch (InterruptedException e) {
-                    if (DEBUG) { e.printStackTrace(); }
+                    if (DEBUG) {
+                        e.printStackTrace();
+                    }
                 }
             }
         }
 
         private synchronized void unlink() {
             if (mRemote == null) {
                 return;
             }
--- 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
@@ -46,20 +46,24 @@ public final class Sample implements Par
                 return new ArrayBuffer[size];
             }
         };
 
         private ArrayBuffer(final Parcel in) {
             mArray = in.createByteArray();
         }
 
-        private ArrayBuffer(final byte[] bytes) { mArray = bytes; }
+        private ArrayBuffer(final byte[] bytes) {
+            mArray = bytes;
+        }
 
         @Override
-        public int describeContents() { return 0; }
+        public int describeContents() {
+            return 0;
+        }
 
         @Override
         public void writeToParcel(final Parcel dest, final int flags) {
             dest.writeByteArray(mArray);
         }
 
         @Override
         public int capacity() {
@@ -88,17 +92,19 @@ public final class Sample implements Par
         }
     }
 
     public Buffer buffer;
     @WrapForJNI
     public BufferInfo info;
     public CryptoInfo cryptoInfo;
 
-    public static Sample create() { return create(null, new BufferInfo(), null); }
+    public static Sample create() {
+        return create(null, new BufferInfo(), null);
+    }
 
     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);
 
--- 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
@@ -83,10 +83,12 @@ public final class SharedMemBuffer imple
     @Override
     public void dispose() {
         if (mSharedMem != null) {
             mSharedMem.dispose();
             mSharedMem = null;
         }
     }
 
-    @Override public String toString() { return "Buffer: " + mSharedMem; }
+    @Override public String toString() {
+        return "Buffer: " + mSharedMem;
+    }
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/JNIObject.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/JNIObject.java
@@ -1,13 +1,12 @@
 package org.mozilla.gecko.mozglue;
 
 // Class that all classes with native methods extend from.
-public abstract class JNIObject
-{
+public abstract class JNIObject {
     // Pointer to a WeakPtr object that refers to the native object.
     private long mHandle;
 
     // Dispose of any reference to a native object.
     //
     // If the native instance is destroyed from the native side, this should never be
     // called, so you should throw an UnsupportedOperationException. If instead you
     // want to destroy the native side from the Java end, make override this with
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/NativeReference.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/NativeReference.java
@@ -1,13 +1,12 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.mozglue;
 
-public interface NativeReference
-{
+public interface NativeReference {
     public void release();
 
     public boolean isReleased();
 }
--- 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
@@ -117,19 +117,23 @@ public class SharedMemory implements Par
         if (mBackedFile != null) {
             mBackedFile.close();
             mBackedFile = null;
         }
     }
 
     private native void unmap(long address, int size);
 
-    public boolean isValid() { return mDescriptor != null; }
+    public boolean isValid() {
+        return mDescriptor != null;
+    }
 
-    public int getSize() { return mSize; }
+    public int getSize() {
+        return mSize;
+    }
 
     private int getFD() {
         return isValid() ? mDescriptor.getFd() : -1;
     }
 
     public long getPointer() {
         if (!isValid()) {
             return 0;
--- 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
@@ -60,37 +60,33 @@ public class ContentUriUtils {
                 final String rootPath;
                 if ("primary".equalsIgnoreCase(type)) {
                     rootPath = Environment.getExternalStorageDirectory().getAbsolutePath();
                 } else {
                     rootPath = FileUtils.getExternalStoragePath(context, type);
                 }
                 return !TextUtils.isEmpty(rootPath) ?
                         rootPath + "/" + docPath : null;
-            }
-            // DownloadsProvider
-            else if (isDownloadsDocument(uri)) {
+            } else if (isDownloadsDocument(uri)) { // DownloadsProvider
                 final String id = DocumentsContract.getDocumentId(uri);
                 // workaround for issue (https://bugzilla.mozilla.org/show_bug.cgi?id=1502721) and
                 // as per https://github.com/Yalantis/uCrop/issues/318#issuecomment-333066640
                 if (!TextUtils.isEmpty(id)) {
                     if (id.startsWith("raw:")) {
                         return id.replaceFirst("raw:", "");
                     }
                     try {
                         final Uri contentUri = ContentUris.withAppendedId(
                                 Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
                         return getDataColumn(context, contentUri, null, null);
                     } catch (NumberFormatException e) {
                         return null;
                     }
                 }
-            }
-            // MediaProvider
-            else if (isMediaDocument(uri)) {
+            } else if (isMediaDocument(uri)) { // MediaProvider
                 final String docId = DocumentsContract.getDocumentId(uri);
                 final String[] split = docId.split(":");
                 final String type = split[0];
 
                 Uri contentUri = null;
                 if ("image".equals(type)) {
                     contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
                 } else if ("video".equals(type)) {
@@ -101,28 +97,23 @@ public class ContentUriUtils {
 
                 final String selection = "_id=?";
                 final String[] selectionArgs = new String[] {
                         split[1]
                 };
 
                 return getDataColumn(context, contentUri, selection, selectionArgs);
             }
-        }
-        // MediaStore (and general)
-        else if ("content".equalsIgnoreCase(uri.getScheme())) {
-
+        } else if ("content".equalsIgnoreCase(uri.getScheme())) { // MediaStore (and general)
             // Return the remote address
             if (isGooglePhotosUri(uri))
                 return uri.getLastPathSegment();
 
             return getDataColumn(context, uri, null, null);
-        }
-        // File
-        else if ("file".equalsIgnoreCase(uri.getScheme())) {
+        } else if ("file".equalsIgnoreCase(uri.getScheme())) { // File
             return uri.getPath();
         }
 
         return null;
     }
 
     /**
      * Retrieves file contents via getContentResolver().openInputStream() and stores them in a
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/INISection.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/INISection.java
@@ -12,18 +12,22 @@ import java.io.IOException;
 import java.util.Enumeration;
 import java.util.Hashtable;
 
 public class INISection {
     private static final String LOGTAG = "INIParser";
 
     // default file to read and write to
     private String mName;
-    public String getName() { return mName; }
-    public void setName(final String name) { mName = name; }
+    public String getName() {
+        return mName;
+    }
+    public void setName(final String name) {
+        mName = name;
+    }
 
     // show or hide debug logging
     private  boolean mDebug;
 
     // Global properties that aren't inside a section in the file
     protected Hashtable<String, Object> mProperties;
 
     // create a parser. The file will not be read until you attempt to
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoEditable.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoEditable.java
@@ -262,18 +262,17 @@ import android.view.inputmethod.EditorIn
         private void addShadowChange(final int start, final int oldEnd, final int newEnd) {
             // Merge the new change into any existing change.
             mShadowStart = Math.min(mShadowStart, start);
             mShadowOldEnd += Math.max(0, oldEnd - mShadowNewEnd);
             mShadowNewEnd = newEnd + Math.max(0, mShadowNewEnd - oldEnd);
         }
 
         public void shadowReplace(final int start, final int end,
-                                  final CharSequence newText)
-        {
+                                  final CharSequence newText) {
             if (DEBUG) {
                 assertOnIcThread();
             }
             mShadowText.replace(start, end, newText);
             addShadowChange(start, end, start + newText.length());
         }
 
         public void shadowSetSpan(final Object obj, final int start,
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
@@ -492,24 +492,28 @@ public final class GeckoRuntimeSettings 
         return this;
     }
 
     /**
      * Gets whether the pause-for-debugger is enabled or not.
      *
      * @return True if the pause is enabled.
      */
-    public boolean getPauseForDebuggerEnabled() { return mDebugPause; }
+    public boolean getPauseForDebuggerEnabled() {
+        return mDebugPause;
+    }
 
     /**
      * Gets whether the compositor should use the maximum screen depth when rendering.
      *
      * @return True if the maximum screen depth should be used.
      */
-    public boolean getUseMaxScreenDepth() { return mUseMaxScreenDepth; }
+    public boolean getUseMaxScreenDepth() {
+        return mUseMaxScreenDepth;
+    }
 
     /**
      * Gets the display density override value.
      *
      * @return Returns a positive number. Will return null if not set.
      */
     public @Nullable Float getDisplayDensityOverride() {
         if (mDisplayDensityOverride > 0.0f) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
@@ -95,17 +95,19 @@ public class GeckoSession implements Par
     private final EventDispatcher mEventDispatcher =
         new EventDispatcher(mNativeQueue);
 
     private final SessionTextInput mTextInput = new SessionTextInput(this, mNativeQueue);
     private SessionAccessibility mAccessibility;
     private SessionFinder mFinder;
 
     private String mId = UUID.randomUUID().toString().replace("-", "");
-    /* package */ String getId() { return mId; }
+    /* package */ String getId() {
+        return mId;
+    }
 
     private boolean mShouldPinOnScreen;
 
     // All fields are accessed on UI thread only.
     private PanZoomController mPanZoomController = new PanZoomController(this);
     private OverscrollEdgeEffect mOverscroll;
     private DynamicToolbarAnimator mToolbar;
     private CompositorController mController;
@@ -1349,17 +1351,19 @@ public class GeckoSession implements Par
     /**
       * Get the SessionAccessibility instance for this session.
       *
       * @return SessionAccessibility instance.
       */
     @UiThread
     public @NonNull SessionAccessibility getAccessibility() {
         ThreadUtils.assertOnUiThread();
-        if (mAccessibility != null) { return mAccessibility; }
+        if (mAccessibility != null) {
+            return mAccessibility;
+        }
 
         mAccessibility = new SessionAccessibility(this);
         if (mWindow != null) {
             if (GeckoThread.isStateAtLeast(GeckoThread.State.PROFILE_READY)) {
                 mWindow.attachAccessibility(mAccessibility.nativeProvider);
             } else {
                 GeckoThread.queueNativeCallUntil(GeckoThread.State.PROFILE_READY,
                         mWindow, "attachAccessibility",
@@ -3070,18 +3074,17 @@ public class GeckoSession implements Par
          *
          * @return A {@link GeckoResult} with a AllowOrDeny value which indicates whether
          *         or not the load was handled. If unhandled, Gecko will continue the
          *         load as normal. If handled (true value), Gecko will abandon the load.
          *         A null return value is interpreted as false (unhandled).
          */
         @UiThread
         default @Nullable GeckoResult<AllowOrDeny> onLoadRequest(@NonNull GeckoSession session,
-                                                                 @NonNull LoadRequest request)
-        {
+                                                                 @NonNull LoadRequest request) {
             return null;
         }
 
         /**
         * A request has been made to open a new session. The URI is provided only for
         * informational purposes. Do not call GeckoSession.loadUri() here. Additionally, the
         * returned GeckoSession must be a newly-created one.
         *
@@ -3089,32 +3092,30 @@ public class GeckoSession implements Par
         * @param uri The URI to be loaded.
         *
         * @return A {@link GeckoResult} which holds the returned GeckoSession. May be null, in
          *        which case the request for a new window by web content will fail. e.g.,
          *        <code>window.open()</code> will return null.
         */
         @UiThread
         default @Nullable GeckoResult<GeckoSession> onNewSession(@NonNull GeckoSession session,
-                                                                 @NonNull String uri)
-        {
+                                                                 @NonNull String uri) {
             return null;
         }
 
         /**
          * @param session The GeckoSession that initiated the callback.
          * @param uri The URI that failed to load.
          * @param error A WebRequestError containing details about the error
          * @return A URI to display as an error. Returning null will halt the load entirely.
          */
         @UiThread
         default @Nullable GeckoResult<String> onLoadError(@NonNull GeckoSession session,
                                                           @Nullable String uri,
-                                                          @NonNull WebRequestError error)
-        {
+                                                          @NonNull WebRequestError error) {
             return null;
         }
     }
 
     /**
      * GeckoSession applications implement this interface to handle prompts triggered by
      * content in the GeckoSession, such as alerts, authentication dialogs, and select list
      * pickers.
@@ -3181,18 +3182,17 @@ public class GeckoSession implements Par
          *
          * @param session GeckoSession that triggered the prompt
          * @param title Title for the prompt dialog.
          * @param msg Message for the prompt dialog.
          * @param callback Callback interface.
          */
         @UiThread
         default void onAlert(@NonNull GeckoSession session, @Nullable String title, @Nullable String msg,
-                             @NonNull AlertCallback callback)
-        {
+                             @NonNull AlertCallback callback) {
             callback.dismiss();
         }
 
         /**
          * Callback interface for notifying the result of a button prompt.
          */
         interface ButtonCallback extends AlertCallback {
             /**
@@ -3220,18 +3220,17 @@ public class GeckoSession implements Par
          *               btnMsg[BUTTON_TYPE_NEUTRAL] is the label for the "neutral" button.
          *               btnMsg[BUTTON_TYPE_NEGATIVE] is the label for the "negative" button.
          *               The button is hidden if the corresponding label is null.
          * @param callback Callback interface.
          */
         @UiThread
         default void onButtonPrompt(@NonNull GeckoSession session, @Nullable String title,
                                     @Nullable String msg, @Nullable String[] btnMsg,
-                                    @NonNull ButtonCallback callback)
-        {
+                                    @NonNull ButtonCallback callback) {
             callback.dismiss();
         }
 
         /**
          * Callback interface for notifying the result of prompts that have text results,
          * including color and date/time pickers.
          */
         interface TextCallback extends AlertCallback {
@@ -3252,18 +3251,17 @@ public class GeckoSession implements Par
          * @param title Title for the prompt dialog.
          * @param msg Message for the prompt dialog.
          * @param value Default input text for the prompt.
          * @param callback Callback interface.
          */
         @UiThread
         default void onTextPrompt(@NonNull GeckoSession session, @Nullable String title,
                                   @Nullable String msg, @Nullable String value,
-                                  @NonNull TextCallback callback)
-        {
+                                  @NonNull TextCallback callback) {
             callback.dismiss();
         }
 
         /**
          * Callback interface for notifying the result of authentication prompts.
          */
         interface AuthCallback extends AlertCallback {
             /**
@@ -3384,18 +3382,17 @@ public class GeckoSession implements Par
          * @param title Title for the prompt dialog.
          * @param msg Message for the prompt dialog.
          * @param options AuthOptions containing options for the prompt
          * @param callback Callback interface.
          */
         @UiThread
         default void onAuthPrompt(final @NonNull GeckoSession session, final @Nullable String title,
                                   final @Nullable String msg, final @NonNull AuthOptions options,
-                                  final @NonNull AuthCallback callback)
-        {
+                                  final @NonNull AuthCallback callback) {
             callback.dismiss();
         }
 
         class Choice {
             @Retention(RetentionPolicy.SOURCE)
             @IntDef({CHOICE_TYPE_MENU, CHOICE_TYPE_SINGLE, CHOICE_TYPE_MULTIPLE})
             /* package */ @interface ChoiceType {}
 
@@ -3538,34 +3535,32 @@ public class GeckoSession implements Par
          * @param msg Message for the prompt dialog, or null for no message.
          * @param type One of CHOICE_TYPE_* indicating the type of prompt.
          * @param choices Array of Choices each representing an item or group.
          * @param callback Callback interface.
          */
         @UiThread
         default void onChoicePrompt(@NonNull GeckoSession session, @Nullable String title,
                                     @Nullable String msg, @Choice.ChoiceType int type,
-                                    @NonNull Choice[] choices, @NonNull ChoiceCallback callback)
-        {
+                                    @NonNull Choice[] choices, @NonNull ChoiceCallback callback) {
             callback.dismiss();
         }
 
         /**
          * Display a color prompt.
          *
          * @param session GeckoSession that triggered the prompt
          * @param title Title for the prompt dialog.
          * @param value Initial color value in HTML color format.
          * @param callback Callback interface; the result passed to confirm() must be in
          *                 HTML color format.
          */
         @UiThread
         default void onColorPrompt(@NonNull GeckoSession session, @Nullable String title,
-                                   @Nullable String value, @NonNull TextCallback callback)
-        {
+                                   @Nullable String value, @NonNull TextCallback callback) {
             callback.dismiss();
         }
 
         @Retention(RetentionPolicy.SOURCE)
         @IntDef({DATETIME_TYPE_DATE, DATETIME_TYPE_MONTH, DATETIME_TYPE_WEEK,
                  DATETIME_TYPE_TIME, DATETIME_TYPE_DATETIME_LOCAL})
         /* package */ @interface DatetimeType {}
 
@@ -3604,18 +3599,17 @@ public class GeckoSession implements Par
          * @param min Minimum date/time value in HTML date/time format.
          * @param max Maximum date/time value in HTML date/time format.
          * @param callback Callback interface; the result passed to confirm() must be in
          *                 HTML date/time format.
          */
         @UiThread
         default void onDateTimePrompt(@NonNull GeckoSession session, @Nullable String title,
                                       @DatetimeType int type, @Nullable String value, @Nullable String min,
-                                      @Nullable String max, @NonNull TextCallback callback)
-        {
+                                      @Nullable String max, @NonNull TextCallback callback) {
             callback.dismiss();
         }
 
         /**
          * Callback interface for notifying the result of file prompts.
          */
         interface FileCallback extends AlertCallback {
             /**
@@ -3653,36 +3647,35 @@ public class GeckoSession implements Par
          * @param type One of FILE_TYPE_* indicating the prompt type.
          * @param mimeTypes Array of permissible MIME types or extensions for the selected
          *                  files. MIME types are of the form "type/subtype", where "type"
          *                  and/or "subtype" can be "*" to indicate any value. Extensions
          *                  are of the form ".ext".
          * @param callback Callback interface.
          */
         @UiThread
-        default void onFilePrompt(@NonNull GeckoSession session, @Nullable String title, @FileType int type,
-                                  @Nullable String[] mimeTypes, @NonNull FileCallback callback)
-        {
+        default void onFilePrompt(@NonNull GeckoSession session, @Nullable String title,
+                                  @FileType int type, @Nullable String[] mimeTypes,
+                                  @NonNull FileCallback callback) {
             callback.dismiss();
         }
 
         /**
          * Display a popup request prompt; this occurs when content attempts to open
          * a new window in a way that doesn't appear to be the result of user input.
          *
          * @param session GeckoSession that triggered the prompt
          * @param targetUri The target URI for the popup
          *
          * @return A {@link GeckoResult} resolving to a AllowOrDeny which indicates
          *         whether or not the popup should be allowed to open.
          */
         @UiThread
         default @Nullable GeckoResult<AllowOrDeny> onPopupRequest(@NonNull GeckoSession session,
-                                                                  @Nullable String targetUri)
-        {
+                                                                  @Nullable String targetUri) {
             return null;
         }
     }
 
     /**
      * GeckoSession applications implement this interface to handle content scroll
      * events.
      **/
@@ -3915,35 +3908,33 @@ public class GeckoSession implements Par
          *                    android.Manifest.permission.ACCESS_FINE_LOCATION
          *                    android.Manifest.permission.CAMERA
          *                    android.Manifest.permission.RECORD_AUDIO
          * @param callback Callback interface.
          */
         @UiThread
         default void onAndroidPermissionsRequest(@NonNull GeckoSession session,
                                                  @Nullable String[] permissions,
-                                                 @NonNull Callback callback)
-        {
+                                                 @NonNull Callback callback) {
             callback.reject();
         }
 
         /**
          * Request content permission.
          *
          * @param session GeckoSession instance requesting the permission.
          * @param uri The URI of the content requesting the permission.
          * @param type The type of the requested permission; possible values are,
          *             PERMISSION_GEOLOCATION
          *             PERMISSION_DESKTOP_NOTIFICATION
          * @param callback Callback interface.
          */
         @UiThread
         default void onContentPermissionRequest(@NonNull GeckoSession session, @Nullable String uri,
-                                                @Permission int type, @NonNull Callback callback)
-        {
+                                                @Permission int type, @NonNull Callback callback) {
             callback.reject();
         }
 
         class MediaSource {
             @Retention(RetentionPolicy.SOURCE)
             @IntDef({SOURCE_CAMERA, SOURCE_SCREEN, SOURCE_APPLICATION,
                      SOURCE_WINDOW, SOURCE_BROWSER, SOURCE_MICROPHONE,
                      SOURCE_AUDIOCAPTURE, SOURCE_OTHER})
@@ -4140,18 +4131,17 @@ public class GeckoSession implements Par
          * @param uri The URI of the content requesting the permission.
          * @param video List of video sources, or null if not requesting video.
          * @param audio List of audio sources, or null if not requesting audio.
          * @param callback Callback interface.
          */
         @UiThread
         default void onMediaPermissionRequest(@NonNull GeckoSession session, @NonNull String uri,
                                               @Nullable MediaSource[] video, @Nullable MediaSource[] audio,
-                                              @NonNull MediaCallback callback)
-        {
+                                              @NonNull MediaCallback callback) {
             callback.reject();
         }
     }
 
     /**
      * Interface that SessionTextInput uses for performing operations such as opening and closing
      * the software keyboard. If the delegate is not set, these operations are forwarded to the
      * system {@link android.view.inputmethod.InputMethodManager} automatically.
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoWebExecutor.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoWebExecutor.java
@@ -109,18 +109,17 @@ public class GeckoWebExecutor {
      */
     public @NonNull GeckoResult<WebResponse> fetch(final @NonNull WebRequest request,
                                                    final @FetchFlags int flags) {
         if (request.body != null && !request.body.isDirect()) {
             throw new IllegalArgumentException("Request body must be a direct ByteBuffer");
         }
 
         if (request.cacheMode < WebRequest.CACHE_MODE_FIRST ||
-            request.cacheMode > WebRequest.CACHE_MODE_LAST)
-        {
+            request.cacheMode > WebRequest.CACHE_MODE_LAST) {
             throw new IllegalArgumentException("Unknown cache mode");
         }
 
         // We don't need to fully validate the URI here, just a sanity check
         if (!request.uri.toLowerCase().startsWith("http")) {
             throw new IllegalArgumentException("URI scheme must be http or https");
         }
 
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/PanZoomController.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/PanZoomController.java
@@ -530,18 +530,17 @@ public class PanZoomController extends J
         mSynthesizedEvent = true;
         onTouchEvent(event);
         mSynthesizedEvent = false;
 
         // Forget about removed pointers
         if (eventType == MotionEvent.ACTION_POINTER_UP ||
             eventType == MotionEvent.ACTION_UP ||
             eventType == MotionEvent.ACTION_CANCEL ||
-            eventType == MotionEvent.ACTION_HOVER_MOVE)
-        {
+            eventType == MotionEvent.ACTION_HOVER_MOVE) {
             mPointerState.pointers.remove(pointerIndex);
         }
     }
 
     @WrapForJNI(calledFrom = "ui")
     private void synthesizeNativeTouchPoint(final int pointerId, final int eventType,
                                             final int clientX, final int clientY,
                                             final double pressure, final int orientation) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
@@ -582,17 +582,19 @@ public class SessionAccessibility {
                         sForceEnabled = value < 0;
                         dispatch();
                     }
                 }
             };
             PrefsHelper.addObserver(new String[]{ FORCE_ACCESSIBILITY_PREF }, prefHandler);
         }
 
-        public static boolean isPlatformEnabled() { return sEnabled; }
+        public static boolean isPlatformEnabled() {
+            return sEnabled;
+        }
 
         public static boolean isEnabled() {
             return sEnabled || sForceEnabled;
         }
 
         public static boolean isTouchExplorationEnabled() {
             return sTouchExplorationEnabled || sForceEnabled;
         }