Bug 1506658 - Add @Nullable or @NonNull to all APIs. r=snorp,rbarker,geckoview-reviewers
authorAgi Sferro <agi@mozilla.com>
Thu, 20 Dec 2018 15:22:45 +0000
changeset 451533 12616753519d591246fa9578cc74a74b50414834
parent 451532 f194d93db08f126c4f9338abfdffa11c7af88c46
child 451534 4d036e71e9ef1ae532b053b2999f9e039411e783
push id35245
push usernbeleuzu@mozilla.com
push dateThu, 20 Dec 2018 21:53:55 +0000
treeherdermozilla-central@b62196039b0c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, rbarker, geckoview-reviewers
bugs1506658
milestone66.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 1506658 - Add @Nullable or @NonNull to all APIs. r=snorp,rbarker,geckoview-reviewers Upgrading apilint to the 0.1.6 release will also ensure that new APIs have nullability annotations via the GV4 and GV5 lints, see [0]. [0]: https://github.com/mozilla-mobile/gradle-apilint/commit/b994c7ca9db056652ba4b5dd639437ddf2c5cc6f#diff-2c7de691a2642510f69b9ddf59276d85R569 Differential Revision: https://phabricator.services.mozilla.com/D14896
build.gradle
mobile/android/geckoview/api.txt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentDelegateTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/GeckoSessionTestRuleTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/LocaleTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/NavigationDelegateTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/PermissionDelegateTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/PromptDelegateTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/SessionLifecycleTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/WebExecutorTest.kt
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/Callbacks.kt
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/BasicSelectionActionDelegate.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/CompositorController.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/GeckoResponse.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/MediaElement.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/OverscrollEdgeEffect.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/PanZoomController.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionTextInput.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md
--- a/build.gradle
+++ b/build.gradle
@@ -82,17 +82,17 @@ buildscript {
     ext.support_library_version = '26.1.0'
     ext.jacoco_version = '0.8.1'
 
     if (gradle.mozconfig.substs.MOZ_ANDROID_GOOGLE_PLAY_SERVICES) {
         ext.google_play_services_version = '15.0.1'
     }
 
     dependencies {
-        classpath 'org.mozilla.apilint:apilint:0.1.5'
+        classpath 'org.mozilla.apilint:apilint:0.1.6'
         classpath 'com.android.tools.build:gradle:3.1.4'
         classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
         classpath 'org.apache.commons:commons-exec:1.3'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
     }
 }
 
 // A stream that processes bytes line by line, prepending a tag before sending
--- a/mobile/android/geckoview/api.txt
+++ b/mobile/android/geckoview/api.txt
@@ -3,75 +3,69 @@ package org.mozilla.geckoview {
   @android.support.annotation.AnyThread public final enum AllowOrDeny {
     method public static org.mozilla.geckoview.AllowOrDeny valueOf(java.lang.String);
     method public static org.mozilla.geckoview.AllowOrDeny[] values();
     enum_constant public static final org.mozilla.geckoview.AllowOrDeny ALLOW;
     enum_constant public static final org.mozilla.geckoview.AllowOrDeny DENY;
   }
 
   @android.support.annotation.UiThread public class BasicSelectionActionDelegate implements android.view.ActionMode.Callback org.mozilla.geckoview.GeckoSession.SelectionActionDelegate {
-    ctor public BasicSelectionActionDelegate(android.app.Activity);
-    ctor public BasicSelectionActionDelegate(android.app.Activity, boolean);
+    ctor public BasicSelectionActionDelegate(@android.support.annotation.NonNull android.app.Activity);
+    ctor public BasicSelectionActionDelegate(@android.support.annotation.NonNull android.app.Activity, boolean);
     method public boolean areExternalActionsEnabled();
     method public void enableExternalActions(boolean);
-    method public boolean onActionItemClicked(android.view.ActionMode, android.view.MenuItem);
-    method public boolean onCreateActionMode(android.view.ActionMode, android.view.Menu);
-    method public void onDestroyActionMode(android.view.ActionMode);
-    method public void onGetContentRect(android.view.ActionMode, android.view.View, android.graphics.Rect);
-    method public void onHideAction(org.mozilla.geckoview.GeckoSession, int);
-    method public boolean onPrepareActionMode(android.view.ActionMode, android.view.Menu);
-    method public void onShowActionRequest(org.mozilla.geckoview.GeckoSession, org.mozilla.geckoview.GeckoSession.SelectionActionDelegate.Selection, java.lang.String[], org.mozilla.geckoview.GeckoResponse<java.lang.String>);
+    method public void onGetContentRect(@android.support.annotation.Nullable android.view.ActionMode, @android.support.annotation.Nullable android.view.View, @android.support.annotation.NonNull android.graphics.Rect);
     method protected void clearSelection();
-    method protected java.lang.String[] getAllActions();
-    method protected boolean isActionAvailable(java.lang.String);
-    method protected boolean performAction(java.lang.String, android.view.MenuItem);
-    method protected void prepareAction(java.lang.String, android.view.MenuItem);
+    method @android.support.annotation.NonNull protected java.lang.String[] getAllActions();
+    method protected boolean isActionAvailable(@android.support.annotation.NonNull java.lang.String);
+    method protected boolean performAction(@android.support.annotation.NonNull java.lang.String, @android.support.annotation.NonNull android.view.MenuItem);
+    method protected void prepareAction(@android.support.annotation.NonNull java.lang.String, @android.support.annotation.NonNull android.view.MenuItem);
     field protected static final java.lang.String ACTION_PROCESS_TEXT = "android.intent.action.PROCESS_TEXT";
     field protected android.view.ActionMode mActionMode;
     field protected java.util.List<java.lang.String> mActions;
     field protected final android.app.Activity mActivity;
     field protected boolean mRepopulatedMenu;
     field protected org.mozilla.geckoview.GeckoResponse<java.lang.String> mResponse;
     field protected org.mozilla.geckoview.GeckoSession.SelectionActionDelegate.Selection mSelection;
     field protected org.mozilla.geckoview.GeckoSession mSession;
     field protected final android.graphics.Matrix mTempMatrix;
     field protected final android.graphics.RectF mTempRect;
     field protected final boolean mUseFloatingToolbar;
   }
 
   @android.support.annotation.UiThread public final class CompositorController {
-    method public void addDrawCallback(java.lang.Runnable);
+    method public void addDrawCallback(@android.support.annotation.NonNull java.lang.Runnable);
     method public int getClearColor();
-    method public java.lang.Runnable getFirstPaintCallback();
-    method public void getPixels(org.mozilla.geckoview.CompositorController.GetPixelsCallback);
-    method public void removeDrawCallback(java.lang.Runnable);
+    method @android.support.annotation.Nullable public java.lang.Runnable getFirstPaintCallback();
+    method public void getPixels(@android.support.annotation.NonNull org.mozilla.geckoview.CompositorController.GetPixelsCallback);
+    method public void removeDrawCallback(@android.support.annotation.NonNull java.lang.Runnable);
     method public void setClearColor(int);
-    method public void setFirstPaintCallback(java.lang.Runnable);
+    method public void setFirstPaintCallback(@android.support.annotation.Nullable java.lang.Runnable);
   }
 
   public static interface CompositorController.GetPixelsCallback {
-    method @android.support.annotation.UiThread public void onPixelsResult(int, int, java.nio.IntBuffer);
+    method @android.support.annotation.UiThread public void onPixelsResult(int, int, @android.support.annotation.Nullable java.nio.IntBuffer);
   }
 
   public class CrashReporter {
     ctor public CrashReporter();
-    method @android.support.annotation.AnyThread public static org.mozilla.geckoview.GeckoResult<java.lang.String> sendCrashReport(android.content.Context, android.content.Intent, java.lang.String);
-    method @android.support.annotation.AnyThread public static org.mozilla.geckoview.GeckoResult<java.lang.String> sendCrashReport(android.content.Context, android.os.Bundle, java.lang.String);
-    method @android.support.annotation.AnyThread public static org.mozilla.geckoview.GeckoResult<java.lang.String> sendCrashReport(android.content.Context, java.io.File, java.io.File, boolean, java.lang.String);
-    method @android.support.annotation.AnyThread public static org.mozilla.geckoview.GeckoResult<java.lang.String> sendCrashReport(android.content.Context, java.io.File, java.util.Map<java.lang.String,java.lang.String>, boolean, java.lang.String);
+    method @android.support.annotation.AnyThread public static org.mozilla.geckoview.GeckoResult<java.lang.String> sendCrashReport(@android.support.annotation.NonNull android.content.Context, @android.support.annotation.NonNull android.content.Intent, @android.support.annotation.NonNull java.lang.String);
+    method @android.support.annotation.AnyThread @android.support.annotation.NonNull public static org.mozilla.geckoview.GeckoResult<java.lang.String> sendCrashReport(@android.support.annotation.NonNull android.content.Context, @android.support.annotation.NonNull android.os.Bundle, @android.support.annotation.NonNull java.lang.String);
+    method @android.support.annotation.AnyThread @android.support.annotation.NonNull public static org.mozilla.geckoview.GeckoResult<java.lang.String> sendCrashReport(@android.support.annotation.NonNull android.content.Context, @android.support.annotation.NonNull java.io.File, @android.support.annotation.NonNull java.io.File, boolean, @android.support.annotation.NonNull java.lang.String);
+    method @android.support.annotation.AnyThread @android.support.annotation.NonNull public static org.mozilla.geckoview.GeckoResult<java.lang.String> sendCrashReport(@android.support.annotation.NonNull android.content.Context, @android.support.annotation.NonNull java.io.File, @android.support.annotation.NonNull java.util.Map<java.lang.String,java.lang.String>, boolean, @android.support.annotation.NonNull java.lang.String);
   }
 
   @android.support.annotation.UiThread public final class DynamicToolbarAnimator {
-    method public org.mozilla.geckoview.DynamicToolbarAnimator.ToolbarChromeProxy getToolbarChromeProxy();
+    method @android.support.annotation.Nullable public org.mozilla.geckoview.DynamicToolbarAnimator.ToolbarChromeProxy getToolbarChromeProxy();
     method public void hideToolbar(boolean);
     method public boolean isPinned();
-    method public boolean isPinnedBy(org.mozilla.geckoview.DynamicToolbarAnimator.PinReason);
+    method public boolean isPinnedBy(@android.support.annotation.NonNull org.mozilla.geckoview.DynamicToolbarAnimator.PinReason);
     method public void setMaxToolbarHeight(int);
-    method public void setPinned(boolean, org.mozilla.geckoview.DynamicToolbarAnimator.PinReason);
-    method public void setToolbarChromeProxy(org.mozilla.geckoview.DynamicToolbarAnimator.ToolbarChromeProxy);
+    method public void setPinned(boolean, @android.support.annotation.NonNull org.mozilla.geckoview.DynamicToolbarAnimator.PinReason);
+    method public void setToolbarChromeProxy(@android.support.annotation.Nullable org.mozilla.geckoview.DynamicToolbarAnimator.ToolbarChromeProxy);
     method public void showToolbar(boolean);
   }
 
   @android.support.annotation.AnyThread public static final enum DynamicToolbarAnimator.PinReason {
     method public static org.mozilla.geckoview.DynamicToolbarAnimator.PinReason valueOf(java.lang.String);
     method public static org.mozilla.geckoview.DynamicToolbarAnimator.PinReason[] values();
     enum_constant public static final org.mozilla.geckoview.DynamicToolbarAnimator.PinReason ACTION_MODE;
     enum_constant public static final org.mozilla.geckoview.DynamicToolbarAnimator.PinReason CARET_DRAG;
@@ -79,233 +73,223 @@ package org.mozilla.geckoview {
     enum_constant public static final org.mozilla.geckoview.DynamicToolbarAnimator.PinReason DISABLED;
     enum_constant public static final org.mozilla.geckoview.DynamicToolbarAnimator.PinReason FULL_SCREEN;
     enum_constant public static final org.mozilla.geckoview.DynamicToolbarAnimator.PinReason PAGE_LOADING;
     enum_constant public static final org.mozilla.geckoview.DynamicToolbarAnimator.PinReason RELAYOUT;
     field public final int value;
   }
 
   public static interface DynamicToolbarAnimator.ToolbarChromeProxy {
-    method @android.support.annotation.UiThread public android.graphics.Bitmap getBitmapOfToolbarChrome();
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public android.graphics.Bitmap getBitmapOfToolbarChrome();
     method @android.support.annotation.UiThread public boolean isToolbarChromeVisible();
     method @android.support.annotation.UiThread public void toggleToolbarChrome(boolean);
   }
 
   public class GeckoDisplay {
     ctor protected GeckoDisplay(org.mozilla.geckoview.GeckoSession);
     method @android.support.annotation.UiThread public void screenOriginChanged(int, int);
     method @android.support.annotation.UiThread public boolean shouldPinOnScreen();
-    method @android.support.annotation.UiThread public void surfaceChanged(android.view.Surface, int, int);
-    method @android.support.annotation.UiThread public void surfaceChanged(android.view.Surface, int, int, int, int);
+    method @android.support.annotation.UiThread public void surfaceChanged(@android.support.annotation.NonNull android.view.Surface, int, int);
+    method @android.support.annotation.UiThread public void surfaceChanged(@android.support.annotation.NonNull android.view.Surface, int, int, int, int);
     method @android.support.annotation.UiThread public void surfaceDestroyed();
   }
 
   public interface GeckoResponse<T> {
-    method @android.support.annotation.AnyThread public void respond(T);
+    method @android.support.annotation.AnyThread public void respond(@android.support.annotation.Nullable T);
   }
 
   @android.support.annotation.AnyThread public class GeckoResult<T> {
     ctor public GeckoResult();
     ctor public GeckoResult(android.os.Handler);
     ctor public GeckoResult(org.mozilla.geckoview.GeckoResult<T>);
-    method public synchronized void complete(T);
-    method public synchronized void completeExceptionally(java.lang.Throwable);
-    method public synchronized boolean equals(java.lang.Object);
-    method public <U> org.mozilla.geckoview.GeckoResult<U> exceptionally(org.mozilla.geckoview.GeckoResult.OnExceptionListener<U>);
-    method public static <T> org.mozilla.geckoview.GeckoResult<T> fromException(java.lang.Throwable);
-    method public static <U> org.mozilla.geckoview.GeckoResult<U> fromValue(U);
-    method public android.os.Looper getLooper();
-    method public synchronized int hashCode();
-    method public synchronized T poll();
-    method public synchronized T poll(long);
-    method public <U> org.mozilla.geckoview.GeckoResult<U> then(org.mozilla.geckoview.GeckoResult.OnValueListener<T,U>);
-    method public <U> org.mozilla.geckoview.GeckoResult<U> then(org.mozilla.geckoview.GeckoResult.OnValueListener<T,U>, org.mozilla.geckoview.GeckoResult.OnExceptionListener<U>);
-    method public org.mozilla.geckoview.GeckoResult<T> withHandler(android.os.Handler);
+    method public synchronized void complete(@android.support.annotation.Nullable T);
+    method public synchronized void completeExceptionally(@android.support.annotation.NonNull java.lang.Throwable);
+    method @android.support.annotation.NonNull public <U> org.mozilla.geckoview.GeckoResult<U> exceptionally(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoResult.OnExceptionListener<U>);
+    method @android.support.annotation.NonNull public static <T> org.mozilla.geckoview.GeckoResult<T> fromException(@android.support.annotation.NonNull java.lang.Throwable);
+    method @android.support.annotation.NonNull public static <U> org.mozilla.geckoview.GeckoResult<U> fromValue(@android.support.annotation.Nullable U);
+    method @android.support.annotation.Nullable public android.os.Looper getLooper();
+    method @android.support.annotation.Nullable public synchronized T poll();
+    method @android.support.annotation.Nullable public synchronized T poll(long);
+    method @android.support.annotation.NonNull public <U> org.mozilla.geckoview.GeckoResult<U> then(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoResult.OnValueListener<T,U>);
+    method @android.support.annotation.NonNull public <U> org.mozilla.geckoview.GeckoResult<U> then(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoResult.OnValueListener<T,U>, @android.support.annotation.Nullable org.mozilla.geckoview.GeckoResult.OnExceptionListener<U>);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoResult<T> withHandler(@android.support.annotation.Nullable android.os.Handler);
     field public static final org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.AllowOrDeny> ALLOW;
     field public static final org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.AllowOrDeny> DENY;
   }
 
   public static interface GeckoResult.OnExceptionListener<V> {
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.GeckoResult<V> onException(java.lang.Throwable);
+    method @android.support.annotation.AnyThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoResult<V> onException(@android.support.annotation.NonNull java.lang.Throwable);
   }
 
   public static interface GeckoResult.OnValueListener<T,U> {
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.GeckoResult<U> onValue(T);
+    method @android.support.annotation.AnyThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoResult<U> onValue(@android.support.annotation.Nullable T);
   }
 
   public static final class GeckoResult.UncaughtException extends java.lang.RuntimeException {
     ctor public UncaughtException(java.lang.Throwable);
   }
 
   public final class GeckoRuntime implements android.os.Parcelable {
     ctor public GeckoRuntime();
-    method @android.support.annotation.UiThread public void attachTo(android.content.Context);
-    method @android.support.annotation.UiThread public static org.mozilla.geckoview.GeckoRuntime create(android.content.Context);
-    method @android.support.annotation.UiThread public static org.mozilla.geckoview.GeckoRuntime create(android.content.Context, org.mozilla.geckoview.GeckoRuntimeSettings);
-    method @android.support.annotation.AnyThread public int describeContents();
-    method @android.support.annotation.UiThread public static synchronized org.mozilla.geckoview.GeckoRuntime getDefault(android.content.Context);
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoRuntime.Delegate getDelegate();
-    method @android.support.annotation.UiThread public java.io.File getProfileDir();
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.GeckoRuntimeSettings getSettings();
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.RuntimeTelemetry getTelemetry();
+    method @android.support.annotation.UiThread public void attachTo(@android.support.annotation.NonNull android.content.Context);
+    method @android.support.annotation.UiThread @android.support.annotation.NonNull public static org.mozilla.geckoview.GeckoRuntime create(@android.support.annotation.NonNull android.content.Context);
+    method @android.support.annotation.UiThread @android.support.annotation.NonNull public static org.mozilla.geckoview.GeckoRuntime create(@android.support.annotation.NonNull android.content.Context, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoRuntimeSettings);
+    method @android.support.annotation.UiThread @android.support.annotation.NonNull public static synchronized org.mozilla.geckoview.GeckoRuntime getDefault(@android.support.annotation.NonNull android.content.Context);
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoRuntime.Delegate getDelegate();
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public java.io.File getProfileDir();
+    method @android.support.annotation.AnyThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoRuntimeSettings getSettings();
+    method @android.support.annotation.UiThread @android.support.annotation.NonNull public org.mozilla.geckoview.RuntimeTelemetry getTelemetry();
     method @android.support.annotation.UiThread public void orientationChanged();
     method @android.support.annotation.UiThread public void orientationChanged(int);
-    method @android.support.annotation.AnyThread public void readFromParcel(android.os.Parcel);
-    method @android.support.annotation.UiThread public void setDelegate(org.mozilla.geckoview.GeckoRuntime.Delegate);
+    method @android.support.annotation.AnyThread public void readFromParcel(@android.support.annotation.NonNull android.os.Parcel);
+    method @android.support.annotation.UiThread public void setDelegate(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoRuntime.Delegate);
     method @android.support.annotation.AnyThread public void shutdown();
-    method @android.support.annotation.AnyThread public void writeToParcel(android.os.Parcel, int);
     field public static final java.lang.String ACTION_CRASHED = "org.mozilla.gecko.ACTION_CRASHED";
     field public static final android.os.Parcelable.Creator<org.mozilla.geckoview.GeckoRuntime> CREATOR;
     field public static final java.lang.String EXTRA_CRASH_FATAL = "fatal";
     field public static final java.lang.String EXTRA_EXTRAS_PATH = "extrasPath";
     field public static final java.lang.String EXTRA_MINIDUMP_PATH = "minidumpPath";
     field public static final java.lang.String EXTRA_MINIDUMP_SUCCESS = "minidumpSuccess";
   }
 
   public static interface GeckoRuntime.Delegate {
     method @android.support.annotation.UiThread public void onShutdown();
   }
 
   @android.support.annotation.AnyThread public final class GeckoRuntimeSettings implements android.os.Parcelable {
-    method public int describeContents();
-    method public java.lang.String[] getArguments();
+    method @android.support.annotation.NonNull public java.lang.String[] getArguments();
     method public boolean getBlockMalware();
     method public boolean getBlockPhishing();
     method public boolean getConsoleOutputEnabled();
     method public int getCookieBehavior();
     method public int getCookieLifetime();
-    method public java.lang.Class<?> getCrashHandler();
-    method public java.lang.Float getDisplayDensityOverride();
-    method public java.lang.Integer getDisplayDpiOverride();
-    method public android.os.Bundle getExtras();
+    method @android.support.annotation.Nullable public java.lang.Class<?> getCrashHandler();
+    method @android.support.annotation.Nullable public java.lang.Float getDisplayDensityOverride();
+    method @android.support.annotation.Nullable public java.lang.Integer getDisplayDpiOverride();
+    method @android.support.annotation.NonNull public android.os.Bundle getExtras();
     method public boolean getJavaScriptEnabled();
-    method public java.lang.String[] getLocales();
+    method @android.support.annotation.Nullable public java.lang.String[] getLocales();
     method public boolean getPauseForDebuggerEnabled();
     method public boolean getRemoteDebuggingEnabled();
-    method public android.graphics.Rect getScreenSizeOverride();
+    method @android.support.annotation.Nullable public android.graphics.Rect getScreenSizeOverride();
     method public int getTrackingProtectionCategories();
     method public boolean getUseContentProcessHint();
     method public boolean getUseMaxScreenDepth();
     method public boolean getWebFontsEnabled();
-    method public void readFromParcel(android.os.Parcel);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings setBlockMalware(boolean);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings setBlockPhishing(boolean);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings setConsoleOutputEnabled(boolean);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings setCookieBehavior(int);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings setCookieLifetime(int);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings setJavaScriptEnabled(boolean);
-    method public void setLocales(java.lang.String[]);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings setRemoteDebuggingEnabled(boolean);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings setTrackingProtectionCategories(int);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings setWebFontsEnabled(boolean);
-    method public void writeToParcel(android.os.Parcel, int);
+    method public void readFromParcel(@android.support.annotation.NonNull android.os.Parcel);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings setBlockMalware(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings setBlockPhishing(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings setConsoleOutputEnabled(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings setCookieBehavior(int);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings setCookieLifetime(int);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings setJavaScriptEnabled(boolean);
+    method public void setLocales(@android.support.annotation.Nullable java.lang.String[]);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings setRemoteDebuggingEnabled(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings setTrackingProtectionCategories(int);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings setWebFontsEnabled(boolean);
     field public static final int COOKIE_ACCEPT_ALL = 0;
     field public static final int COOKIE_ACCEPT_FIRST_PARTY = 1;
     field public static final int COOKIE_ACCEPT_NONE = 2;
     field public static final int COOKIE_ACCEPT_NON_TRACKERS = 4;
     field public static final int COOKIE_ACCEPT_VISITED = 3;
     field public static final int COOKIE_LIFETIME_DAYS = 3;
     field public static final int COOKIE_LIFETIME_NORMAL = 0;
     field public static final int COOKIE_LIFETIME_RUNTIME = 2;
     field public static final android.os.Parcelable.Creator<org.mozilla.geckoview.GeckoRuntimeSettings> CREATOR;
   }
 
   @android.support.annotation.AnyThread public static final class GeckoRuntimeSettings.Builder {
     ctor public Builder();
     ctor public Builder(org.mozilla.geckoview.GeckoRuntimeSettings);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder arguments(java.lang.String[]);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder blockMalware(boolean);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder blockPhishing(boolean);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings build();
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder consoleOutput(boolean);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder cookieBehavior(int);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder cookieLifetime(int);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder crashHandler(java.lang.Class<?>);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder displayDensityOverride(float);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder displayDpiOverride(int);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder extras(android.os.Bundle);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder javaScriptEnabled(boolean);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder locales(java.lang.String[]);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder pauseForDebugger(boolean);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder remoteDebuggingEnabled(boolean);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder screenSizeOverride(int, int);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder trackingProtectionCategories(int);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder useContentProcessHint(boolean);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder useMaxScreenDepth(boolean);
-    method public org.mozilla.geckoview.GeckoRuntimeSettings.Builder webFontsEnabled(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder arguments(@android.support.annotation.NonNull java.lang.String[]);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder blockMalware(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder blockPhishing(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings build();
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder consoleOutput(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder cookieBehavior(int);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder cookieLifetime(int);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder crashHandler(java.lang.Class<?>);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder displayDensityOverride(float);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder displayDpiOverride(int);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder extras(@android.support.annotation.NonNull android.os.Bundle);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder javaScriptEnabled(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder locales(java.lang.String[]);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder pauseForDebugger(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder remoteDebuggingEnabled(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder screenSizeOverride(int, int);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder trackingProtectionCategories(int);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder useContentProcessHint(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder useMaxScreenDepth(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoRuntimeSettings.Builder webFontsEnabled(boolean);
   }
 
   public class GeckoSession implements android.os.Parcelable {
     ctor public GeckoSession();
-    ctor public GeckoSession(org.mozilla.geckoview.GeckoSessionSettings);
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoDisplay acquireDisplay();
+    ctor public GeckoSession(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSessionSettings);
+    method @android.support.annotation.UiThread @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoDisplay acquireDisplay();
     method @android.support.annotation.UiThread public void close();
-    method @android.support.annotation.AnyThread public static java.lang.String createDataUri(byte[], java.lang.String);
-    method @android.support.annotation.AnyThread public static java.lang.String createDataUri(java.lang.String, java.lang.String);
-    method @android.support.annotation.AnyThread public int describeContents();
-    method @android.support.annotation.AnyThread public boolean equals(java.lang.Object);
+    method @android.support.annotation.AnyThread public static java.lang.String createDataUri(@android.support.annotation.NonNull byte[], @android.support.annotation.Nullable java.lang.String);
+    method @android.support.annotation.AnyThread public static java.lang.String createDataUri(@android.support.annotation.NonNull java.lang.String, @android.support.annotation.Nullable java.lang.String);
     method @android.support.annotation.AnyThread public void exitFullScreen();
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.SessionAccessibility getAccessibility();
-    method @android.support.annotation.UiThread public void getClientBounds(android.graphics.RectF);
-    method @android.support.annotation.UiThread public void getClientToScreenMatrix(android.graphics.Matrix);
-    method @android.support.annotation.UiThread public void getClientToSurfaceMatrix(android.graphics.Matrix);
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.CompositorController getCompositorController();
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoSession.ContentDelegate getContentDelegate();
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.DynamicToolbarAnimator getDynamicToolbarAnimator();
-    method @android.support.annotation.AnyThread public org.mozilla.gecko.EventDispatcher getEventDispatcher();
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.SessionFinder getFinder();
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.GeckoSession.HistoryDelegate getHistoryDelegate();
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.GeckoSession.MediaDelegate getMediaDelegate();
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoSession.NavigationDelegate getNavigationDelegate();
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.OverscrollEdgeEffect getOverscrollEdgeEffect();
-    method @android.support.annotation.UiThread public void getPageToScreenMatrix(android.graphics.Matrix);
-    method @android.support.annotation.UiThread public void getPageToSurfaceMatrix(android.graphics.Matrix);
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.PanZoomController getPanZoomController();
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoSession.PermissionDelegate getPermissionDelegate();
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoSession.ProgressDelegate getProgressDelegate();
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.GeckoSession.PromptDelegate getPromptDelegate();
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoSession.ScrollDelegate getScrollDelegate();
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.GeckoSession.SelectionActionDelegate getSelectionActionDelegate();
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.GeckoSessionSettings getSettings();
-    method @android.support.annotation.UiThread public void getSurfaceBounds(android.graphics.Rect);
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.SessionTextInput getTextInput();
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.GeckoSession.TrackingProtectionDelegate getTrackingProtectionDelegate();
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.GeckoResult<java.lang.String> getUserAgent();
+    method @android.support.annotation.UiThread @android.support.annotation.NonNull public org.mozilla.geckoview.SessionAccessibility getAccessibility();
+    method @android.support.annotation.UiThread public void getClientBounds(@android.support.annotation.NonNull android.graphics.RectF);
+    method @android.support.annotation.UiThread public void getClientToScreenMatrix(@android.support.annotation.NonNull android.graphics.Matrix);
+    method @android.support.annotation.UiThread public void getClientToSurfaceMatrix(@android.support.annotation.NonNull android.graphics.Matrix);
+    method @android.support.annotation.UiThread @android.support.annotation.NonNull public org.mozilla.geckoview.CompositorController getCompositorController();
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoSession.ContentDelegate getContentDelegate();
+    method @android.support.annotation.UiThread @android.support.annotation.NonNull public org.mozilla.geckoview.DynamicToolbarAnimator getDynamicToolbarAnimator();
+    method @android.support.annotation.AnyThread @android.support.annotation.NonNull public org.mozilla.gecko.EventDispatcher getEventDispatcher();
+    method @android.support.annotation.AnyThread @android.support.annotation.NonNull public org.mozilla.geckoview.SessionFinder getFinder();
+    method @android.support.annotation.AnyThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoSession.HistoryDelegate getHistoryDelegate();
+    method @android.support.annotation.AnyThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoSession.MediaDelegate getMediaDelegate();
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoSession.NavigationDelegate getNavigationDelegate();
+    method @android.support.annotation.UiThread @android.support.annotation.NonNull public org.mozilla.geckoview.OverscrollEdgeEffect getOverscrollEdgeEffect();
+    method @android.support.annotation.UiThread public void getPageToScreenMatrix(@android.support.annotation.NonNull android.graphics.Matrix);
+    method @android.support.annotation.UiThread public void getPageToSurfaceMatrix(@android.support.annotation.NonNull android.graphics.Matrix);
+    method @android.support.annotation.UiThread @android.support.annotation.NonNull public org.mozilla.geckoview.PanZoomController getPanZoomController();
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoSession.PermissionDelegate getPermissionDelegate();
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoSession.ProgressDelegate getProgressDelegate();
+    method @android.support.annotation.AnyThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoSession.PromptDelegate getPromptDelegate();
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoSession.ScrollDelegate getScrollDelegate();
+    method @android.support.annotation.AnyThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoSession.SelectionActionDelegate getSelectionActionDelegate();
+    method @android.support.annotation.AnyThread @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoSessionSettings getSettings();
+    method @android.support.annotation.UiThread public void getSurfaceBounds(@android.support.annotation.NonNull android.graphics.Rect);
+    method @android.support.annotation.AnyThread @android.support.annotation.NonNull public org.mozilla.geckoview.SessionTextInput getTextInput();
+    method @android.support.annotation.AnyThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoSession.TrackingProtectionDelegate getTrackingProtectionDelegate();
+    method @android.support.annotation.AnyThread @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoResult<java.lang.String> getUserAgent();
     method @android.support.annotation.AnyThread public void goBack();
     method @android.support.annotation.AnyThread public void goForward();
-    method @android.support.annotation.AnyThread public int hashCode();
     method @android.support.annotation.AnyThread public boolean isOpen();
-    method @android.support.annotation.AnyThread public void loadData(byte[], java.lang.String);
-    method @android.support.annotation.AnyThread public void loadString(java.lang.String, java.lang.String);
-    method @android.support.annotation.AnyThread public void loadUri(java.lang.String);
-    method @android.support.annotation.AnyThread public void loadUri(java.lang.String, int);
-    method @android.support.annotation.AnyThread public void loadUri(java.lang.String, java.lang.String, int);
-    method @android.support.annotation.AnyThread public void loadUri(android.net.Uri);
-    method @android.support.annotation.AnyThread public void loadUri(android.net.Uri, int);
-    method @android.support.annotation.AnyThread public void loadUri(android.net.Uri, android.net.Uri, int);
-    method @android.support.annotation.UiThread public void open(org.mozilla.geckoview.GeckoRuntime);
-    method @android.support.annotation.AnyThread public void readFromParcel(android.os.Parcel);
-    method @android.support.annotation.UiThread public void releaseDisplay(org.mozilla.geckoview.GeckoDisplay);
+    method @android.support.annotation.AnyThread public void loadData(@android.support.annotation.NonNull byte[], @android.support.annotation.Nullable java.lang.String);
+    method @android.support.annotation.AnyThread public void loadString(@android.support.annotation.NonNull java.lang.String, @android.support.annotation.Nullable java.lang.String);
+    method @android.support.annotation.AnyThread public void loadUri(@android.support.annotation.NonNull java.lang.String);
+    method @android.support.annotation.AnyThread public void loadUri(@android.support.annotation.NonNull java.lang.String, int);
+    method @android.support.annotation.AnyThread public void loadUri(@android.support.annotation.NonNull java.lang.String, @android.support.annotation.Nullable java.lang.String, int);
+    method @android.support.annotation.AnyThread public void loadUri(@android.support.annotation.NonNull android.net.Uri);
+    method @android.support.annotation.AnyThread public void loadUri(@android.support.annotation.NonNull android.net.Uri, int);
+    method @android.support.annotation.AnyThread public void loadUri(@android.support.annotation.NonNull android.net.Uri, @android.support.annotation.Nullable android.net.Uri, int);
+    method @android.support.annotation.UiThread public void open(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoRuntime);
+    method @android.support.annotation.AnyThread public void readFromParcel(@android.support.annotation.NonNull android.os.Parcel);
+    method @android.support.annotation.UiThread public void releaseDisplay(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoDisplay);
     method @android.support.annotation.AnyThread public void reload();
-    method @android.support.annotation.AnyThread public void restoreState(org.mozilla.geckoview.GeckoSession.SessionState);
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.GeckoSession.SessionState> saveState();
+    method @android.support.annotation.AnyThread public void restoreState(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.SessionState);
+    method @android.support.annotation.AnyThread @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.GeckoSession.SessionState> saveState();
     method @android.support.annotation.AnyThread public void setActive(boolean);
-    method @android.support.annotation.UiThread public void setContentDelegate(org.mozilla.geckoview.GeckoSession.ContentDelegate);
+    method @android.support.annotation.UiThread public void setContentDelegate(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.ContentDelegate);
     method @android.support.annotation.AnyThread public void setFocused(boolean);
-    method @android.support.annotation.AnyThread public void setHistoryDelegate(org.mozilla.geckoview.GeckoSession.HistoryDelegate);
-    method @android.support.annotation.AnyThread public void setMediaDelegate(org.mozilla.geckoview.GeckoSession.MediaDelegate);
-    method @android.support.annotation.UiThread public void setNavigationDelegate(org.mozilla.geckoview.GeckoSession.NavigationDelegate);
-    method @android.support.annotation.UiThread public void setPermissionDelegate(org.mozilla.geckoview.GeckoSession.PermissionDelegate);
-    method @android.support.annotation.UiThread public void setProgressDelegate(org.mozilla.geckoview.GeckoSession.ProgressDelegate);
-    method @android.support.annotation.AnyThread public void setPromptDelegate(org.mozilla.geckoview.GeckoSession.PromptDelegate);
-    method @android.support.annotation.UiThread public void setScrollDelegate(org.mozilla.geckoview.GeckoSession.ScrollDelegate);
-    method @android.support.annotation.UiThread public void setSelectionActionDelegate(org.mozilla.geckoview.GeckoSession.SelectionActionDelegate);
-    method @android.support.annotation.AnyThread public void setTrackingProtectionDelegate(org.mozilla.geckoview.GeckoSession.TrackingProtectionDelegate);
+    method @android.support.annotation.AnyThread public void setHistoryDelegate(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.HistoryDelegate);
+    method @android.support.annotation.AnyThread public void setMediaDelegate(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.MediaDelegate);
+    method @android.support.annotation.UiThread public void setNavigationDelegate(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.NavigationDelegate);
+    method @android.support.annotation.UiThread public void setPermissionDelegate(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.PermissionDelegate);
+    method @android.support.annotation.UiThread public void setProgressDelegate(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.ProgressDelegate);
+    method @android.support.annotation.AnyThread public void setPromptDelegate(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.PromptDelegate);
+    method @android.support.annotation.UiThread public void setScrollDelegate(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.ScrollDelegate);
+    method @android.support.annotation.UiThread public void setSelectionActionDelegate(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.SelectionActionDelegate);
+    method @android.support.annotation.AnyThread public void setTrackingProtectionDelegate(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.TrackingProtectionDelegate);
     method @android.support.annotation.AnyThread public void stop();
-    method @android.support.annotation.AnyThread public void writeToParcel(android.os.Parcel, int);
     method @android.support.annotation.UiThread protected void setShouldPinOnScreen(boolean);
     field public static final android.os.Parcelable.Creator<org.mozilla.geckoview.GeckoSession> CREATOR;
     field public static final int FINDER_DISPLAY_DIM_PAGE = 2;
     field public static final int FINDER_DISPLAY_DRAW_LINK_OUTLINE = 4;
     field public static final int FINDER_DISPLAY_HIGHLIGHT_ALL = 1;
     field public static final int FINDER_FIND_BACKWARDS = 1;
     field public static final int FINDER_FIND_LINKS_ONLY = 8;
     field public static final int FINDER_FIND_MATCH_CASE = 2;
@@ -315,111 +299,111 @@ package org.mozilla.geckoview {
     field public static final int LOAD_FLAGS_BYPASS_CLASSIFIER = 16;
     field public static final int LOAD_FLAGS_BYPASS_PROXY = 2;
     field public static final int LOAD_FLAGS_EXTERNAL = 4;
     field public static final int LOAD_FLAGS_NONE = 0;
     field protected org.mozilla.geckoview.GeckoSession.Window mWindow;
   }
 
   public static interface GeckoSession.ContentDelegate {
-    method @android.support.annotation.UiThread public void onCloseRequest(org.mozilla.geckoview.GeckoSession);
-    method @android.support.annotation.UiThread public void onContextMenu(org.mozilla.geckoview.GeckoSession, int, int, org.mozilla.geckoview.GeckoSession.ContentDelegate.ContextElement);
-    method @android.support.annotation.UiThread public void onCrash(org.mozilla.geckoview.GeckoSession);
-    method @android.support.annotation.UiThread public void onExternalResponse(org.mozilla.geckoview.GeckoSession, org.mozilla.geckoview.GeckoSession.WebResponseInfo);
-    method @android.support.annotation.UiThread public void onFirstComposite(org.mozilla.geckoview.GeckoSession);
-    method @android.support.annotation.UiThread public void onFocusRequest(org.mozilla.geckoview.GeckoSession);
-    method @android.support.annotation.UiThread public void onFullScreen(org.mozilla.geckoview.GeckoSession, boolean);
-    method @android.support.annotation.UiThread public void onTitleChange(org.mozilla.geckoview.GeckoSession, java.lang.String);
+    method @android.support.annotation.UiThread public void onCloseRequest(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession);
+    method @android.support.annotation.UiThread public void onContextMenu(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, int, int, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.ContentDelegate.ContextElement);
+    method @android.support.annotation.UiThread public void onCrash(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession);
+    method @android.support.annotation.UiThread public void onExternalResponse(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.WebResponseInfo);
+    method @android.support.annotation.UiThread public void onFirstComposite(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession);
+    method @android.support.annotation.UiThread public void onFocusRequest(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession);
+    method @android.support.annotation.UiThread public void onFullScreen(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, boolean);
+    method @android.support.annotation.UiThread public void onTitleChange(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String);
   }
 
   public static class GeckoSession.ContentDelegate.ContextElement {
-    ctor protected ContextElement(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
+    ctor protected ContextElement(@android.support.annotation.Nullable java.lang.String, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.NonNull java.lang.String, @android.support.annotation.Nullable java.lang.String);
     field public static final int TYPE_AUDIO = 3;
     field public static final int TYPE_IMAGE = 1;
     field public static final int TYPE_NONE = 0;
     field public static final int TYPE_VIDEO = 2;
-    field public final java.lang.String altText;
-    field public final java.lang.String linkUri;
-    field public final java.lang.String srcUri;
-    field public final java.lang.String title;
+    field @android.support.annotation.Nullable public final java.lang.String altText;
+    field @android.support.annotation.Nullable public final java.lang.String linkUri;
+    field @android.support.annotation.Nullable public final java.lang.String srcUri;
+    field @android.support.annotation.Nullable public final java.lang.String title;
     field public final int type;
   }
 
   @android.support.annotation.AnyThread public static class GeckoSession.FinderResult {
     ctor protected FinderResult();
-    field public final android.graphics.RectF clientRect;
+    field @android.support.annotation.Nullable public final android.graphics.RectF clientRect;
     field public final int current;
     field public final int flags;
     field public final boolean found;
-    field public final java.lang.String linkUri;
-    field public final java.lang.String searchString;
+    field @android.support.annotation.Nullable public final java.lang.String linkUri;
+    field @android.support.annotation.NonNull public final java.lang.String searchString;
     field public final int total;
     field public final boolean wrapped;
   }
 
   public static interface GeckoSession.HistoryDelegate {
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoResult<boolean[]> getVisited(org.mozilla.geckoview.GeckoSession, java.lang.String[]);
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoResult<java.lang.Boolean> onVisited(org.mozilla.geckoview.GeckoSession, java.lang.String, java.lang.String, int);
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoResult<boolean[]> getVisited(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.NonNull java.lang.String[]);
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoResult<java.lang.Boolean> onVisited(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.NonNull java.lang.String, @android.support.annotation.Nullable java.lang.String, int);
     field public static final int VISIT_REDIRECT_PERMANENT = 4;
     field public static final int VISIT_REDIRECT_SOURCE = 8;
     field public static final int VISIT_REDIRECT_SOURCE_PERMANENT = 16;
     field public static final int VISIT_REDIRECT_TEMPORARY = 2;
     field public static final int VISIT_TOP_LEVEL = 1;
     field public static final int VISIT_UNRECOVERABLE_ERROR = 32;
   }
 
   public static interface GeckoSession.HistoryDelegate.VisitFlags implements java.lang.annotation.Annotation {
   }
 
   public static interface GeckoSession.MediaDelegate {
-    method @android.support.annotation.UiThread public void onMediaAdd(org.mozilla.geckoview.GeckoSession, org.mozilla.geckoview.MediaElement);
-    method @android.support.annotation.UiThread public void onMediaRemove(org.mozilla.geckoview.GeckoSession, org.mozilla.geckoview.MediaElement);
+    method @android.support.annotation.UiThread public void onMediaAdd(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.NonNull org.mozilla.geckoview.MediaElement);
+    method @android.support.annotation.UiThread public void onMediaRemove(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.NonNull org.mozilla.geckoview.MediaElement);
   }
 
   public static interface GeckoSession.NavigationDelegate {
-    method @android.support.annotation.UiThread public void onCanGoBack(org.mozilla.geckoview.GeckoSession, boolean);
-    method @android.support.annotation.UiThread public void onCanGoForward(org.mozilla.geckoview.GeckoSession, boolean);
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoResult<java.lang.String> onLoadError(org.mozilla.geckoview.GeckoSession, java.lang.String, org.mozilla.geckoview.WebRequestError);
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.AllowOrDeny> onLoadRequest(org.mozilla.geckoview.GeckoSession, org.mozilla.geckoview.GeckoSession.NavigationDelegate.LoadRequest);
-    method @android.support.annotation.UiThread public void onLocationChange(org.mozilla.geckoview.GeckoSession, java.lang.String);
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.GeckoSession> onNewSession(org.mozilla.geckoview.GeckoSession, java.lang.String);
+    method @android.support.annotation.UiThread public void onCanGoBack(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, boolean);
+    method @android.support.annotation.UiThread public void onCanGoForward(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, boolean);
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoResult<java.lang.String> onLoadError(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.NonNull org.mozilla.geckoview.WebRequestError);
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.AllowOrDeny> onLoadRequest(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.NavigationDelegate.LoadRequest);
+    method @android.support.annotation.UiThread public void onLocationChange(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String);
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.GeckoSession> onNewSession(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.NonNull java.lang.String);
     field public static final int LOAD_REQUEST_IS_REDIRECT = 8388608;
     field public static final int TARGET_WINDOW_CURRENT = 1;
     field public static final int TARGET_WINDOW_NEW = 2;
     field public static final int TARGET_WINDOW_NONE = 0;
   }
 
   public static class GeckoSession.NavigationDelegate.LoadRequest {
     ctor protected LoadRequest();
     field public final boolean isRedirect;
     field public final int target;
-    field public final java.lang.String triggerUri;
-    field public final java.lang.String uri;
+    field @android.support.annotation.Nullable public final java.lang.String triggerUri;
+    field @android.support.annotation.NonNull public final java.lang.String uri;
   }
 
   public static interface GeckoSession.NavigationDelegate.TargetWindow implements java.lang.annotation.Annotation {
   }
 
   public static interface GeckoSession.PermissionDelegate {
-    method @android.support.annotation.UiThread public void onAndroidPermissionsRequest(org.mozilla.geckoview.GeckoSession, java.lang.String[], org.mozilla.geckoview.GeckoSession.PermissionDelegate.Callback);
-    method @android.support.annotation.UiThread public void onContentPermissionRequest(org.mozilla.geckoview.GeckoSession, java.lang.String, int, org.mozilla.geckoview.GeckoSession.PermissionDelegate.Callback);
-    method @android.support.annotation.UiThread public void onMediaPermissionRequest(org.mozilla.geckoview.GeckoSession, java.lang.String, org.mozilla.geckoview.GeckoSession.PermissionDelegate.MediaSource[], org.mozilla.geckoview.GeckoSession.PermissionDelegate.MediaSource[], org.mozilla.geckoview.GeckoSession.PermissionDelegate.MediaCallback);
+    method @android.support.annotation.UiThread public void onAndroidPermissionsRequest(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String[], @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PermissionDelegate.Callback);
+    method @android.support.annotation.UiThread public void onContentPermissionRequest(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String, int, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PermissionDelegate.Callback);
+    method @android.support.annotation.UiThread public void onMediaPermissionRequest(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.NonNull java.lang.String, @android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.PermissionDelegate.MediaSource[], @android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.PermissionDelegate.MediaSource[], @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PermissionDelegate.MediaCallback);
     field public static final int PERMISSION_AUTOPLAY_MEDIA = 2;
     field public static final int PERMISSION_DESKTOP_NOTIFICATION = 1;
     field public static final int PERMISSION_GEOLOCATION = 0;
   }
 
   public static interface GeckoSession.PermissionDelegate.Callback {
     method @android.support.annotation.UiThread public void grant();
     method @android.support.annotation.UiThread public void reject();
   }
 
   public static interface GeckoSession.PermissionDelegate.MediaCallback {
-    method @android.support.annotation.UiThread public void grant(java.lang.String, java.lang.String);
-    method @android.support.annotation.UiThread public void grant(org.mozilla.geckoview.GeckoSession.PermissionDelegate.MediaSource, org.mozilla.geckoview.GeckoSession.PermissionDelegate.MediaSource);
+    method @android.support.annotation.UiThread public void grant(@android.support.annotation.Nullable java.lang.String, @android.support.annotation.Nullable java.lang.String);
+    method @android.support.annotation.UiThread public void grant(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.PermissionDelegate.MediaSource, @android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.PermissionDelegate.MediaSource);
     method @android.support.annotation.UiThread public void reject();
   }
 
   public static class GeckoSession.PermissionDelegate.MediaSource {
     ctor protected MediaSource();
     field public static final int SOURCE_APPLICATION = 2;
     field public static final int SOURCE_AUDIOCAPTURE = 6;
     field public static final int SOURCE_BROWSER = 4;
@@ -436,20 +420,20 @@ package org.mozilla.geckoview {
     field public final int source;
     field public final int type;
   }
 
   public static interface GeckoSession.PermissionDelegate.Permission implements java.lang.annotation.Annotation {
   }
 
   public static interface GeckoSession.ProgressDelegate {
-    method @android.support.annotation.UiThread public void onPageStart(org.mozilla.geckoview.GeckoSession, java.lang.String);
-    method @android.support.annotation.UiThread public void onPageStop(org.mozilla.geckoview.GeckoSession, boolean);
-    method @android.support.annotation.UiThread public void onProgressChange(org.mozilla.geckoview.GeckoSession, int);
-    method @android.support.annotation.UiThread public void onSecurityChange(org.mozilla.geckoview.GeckoSession, org.mozilla.geckoview.GeckoSession.ProgressDelegate.SecurityInformation);
+    method @android.support.annotation.UiThread public void onPageStart(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.NonNull java.lang.String);
+    method @android.support.annotation.UiThread public void onPageStop(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, boolean);
+    method @android.support.annotation.UiThread public void onProgressChange(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, int);
+    method @android.support.annotation.UiThread public void onSecurityChange(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.ProgressDelegate.SecurityInformation);
   }
 
   public static class GeckoSession.ProgressDelegate.SecurityInformation {
     ctor protected SecurityInformation();
     field public static final int CONTENT_BLOCKED = 1;
     field public static final int CONTENT_LOADED = 2;
     field public static final int CONTENT_UNKNOWN = 0;
     field public static final int SECURITY_MODE_IDENTIFIED = 1;
@@ -465,48 +449,48 @@ package org.mozilla.geckoview {
     field public final java.lang.String organization;
     field public final java.lang.String origin;
     field public final int securityMode;
     field public final java.lang.String subjectName;
     field public final int trackingMode;
   }
 
   public static interface GeckoSession.PromptDelegate {
-    method @android.support.annotation.UiThread public void onAlert(org.mozilla.geckoview.GeckoSession, java.lang.String, java.lang.String, org.mozilla.geckoview.GeckoSession.PromptDelegate.AlertCallback);
-    method @android.support.annotation.UiThread public void onAuthPrompt(org.mozilla.geckoview.GeckoSession, java.lang.String, java.lang.String, org.mozilla.geckoview.GeckoSession.PromptDelegate.AuthOptions, org.mozilla.geckoview.GeckoSession.PromptDelegate.AuthCallback);
-    method @android.support.annotation.UiThread public void onButtonPrompt(org.mozilla.geckoview.GeckoSession, java.lang.String, java.lang.String, java.lang.String[], org.mozilla.geckoview.GeckoSession.PromptDelegate.ButtonCallback);
-    method @android.support.annotation.UiThread public void onChoicePrompt(org.mozilla.geckoview.GeckoSession, java.lang.String, java.lang.String, int, org.mozilla.geckoview.GeckoSession.PromptDelegate.Choice[], org.mozilla.geckoview.GeckoSession.PromptDelegate.ChoiceCallback);
-    method @android.support.annotation.UiThread public void onColorPrompt(org.mozilla.geckoview.GeckoSession, java.lang.String, java.lang.String, org.mozilla.geckoview.GeckoSession.PromptDelegate.TextCallback);
-    method @android.support.annotation.UiThread public void onDateTimePrompt(org.mozilla.geckoview.GeckoSession, java.lang.String, int, java.lang.String, java.lang.String, java.lang.String, org.mozilla.geckoview.GeckoSession.PromptDelegate.TextCallback);
-    method @android.support.annotation.UiThread public void onFilePrompt(org.mozilla.geckoview.GeckoSession, java.lang.String, int, java.lang.String[], org.mozilla.geckoview.GeckoSession.PromptDelegate.FileCallback);
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.AllowOrDeny> onPopupRequest(org.mozilla.geckoview.GeckoSession, java.lang.String);
-    method @android.support.annotation.UiThread public void onTextPrompt(org.mozilla.geckoview.GeckoSession, java.lang.String, java.lang.String, java.lang.String, org.mozilla.geckoview.GeckoSession.PromptDelegate.TextCallback);
+    method @android.support.annotation.UiThread public void onAlert(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PromptDelegate.AlertCallback);
+    method @android.support.annotation.UiThread public void onAuthPrompt(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PromptDelegate.AuthOptions, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PromptDelegate.AuthCallback);
+    method @android.support.annotation.UiThread public void onButtonPrompt(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.Nullable java.lang.String[], @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PromptDelegate.ButtonCallback);
+    method @android.support.annotation.UiThread public void onChoicePrompt(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.Nullable java.lang.String, int, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PromptDelegate.Choice[], @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PromptDelegate.ChoiceCallback);
+    method @android.support.annotation.UiThread public void onColorPrompt(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PromptDelegate.TextCallback);
+    method @android.support.annotation.UiThread public void onDateTimePrompt(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String, int, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PromptDelegate.TextCallback);
+    method @android.support.annotation.UiThread public void onFilePrompt(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String, int, @android.support.annotation.Nullable java.lang.String[], @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PromptDelegate.FileCallback);
+    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.AllowOrDeny> onPopupRequest(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String);
+    method @android.support.annotation.UiThread public void onTextPrompt(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.Nullable java.lang.String, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PromptDelegate.TextCallback);
     field public static final int BUTTON_TYPE_NEGATIVE = 2;
     field public static final int BUTTON_TYPE_NEUTRAL = 1;
     field public static final int BUTTON_TYPE_POSITIVE = 0;
     field public static final int DATETIME_TYPE_DATE = 1;
     field public static final int DATETIME_TYPE_DATETIME_LOCAL = 5;
     field public static final int DATETIME_TYPE_MONTH = 2;
     field public static final int DATETIME_TYPE_TIME = 4;
     field public static final int DATETIME_TYPE_WEEK = 3;
     field public static final int FILE_TYPE_MULTIPLE = 2;
     field public static final int FILE_TYPE_SINGLE = 1;
   }
 
   public static interface GeckoSession.PromptDelegate.AlertCallback {
     method @android.support.annotation.UiThread public void dismiss();
-    method @android.support.annotation.UiThread public java.lang.String getCheckboxMessage();
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public java.lang.String getCheckboxMessage();
     method @android.support.annotation.UiThread public boolean getCheckboxValue();
     method @android.support.annotation.UiThread public boolean hasCheckbox();
     method @android.support.annotation.UiThread public void setCheckboxValue(boolean);
   }
 
   public static interface GeckoSession.PromptDelegate.AuthCallback implements org.mozilla.geckoview.GeckoSession.PromptDelegate.AlertCallback {
-    method @android.support.annotation.UiThread public void confirm(java.lang.String);
-    method @android.support.annotation.UiThread public void confirm(java.lang.String, java.lang.String);
+    method @android.support.annotation.UiThread public void confirm(@android.support.annotation.Nullable java.lang.String);
+    method @android.support.annotation.UiThread public void confirm(@android.support.annotation.NonNull java.lang.String, @android.support.annotation.NonNull java.lang.String);
   }
 
   public static class GeckoSession.PromptDelegate.AuthOptions {
     ctor protected AuthOptions();
     field public static final int AUTH_FLAG_CROSS_ORIGIN_SUB_RESOURCE = 32;
     field public static final int AUTH_FLAG_HOST = 1;
     field public static final int AUTH_FLAG_ONLY_PASSWORD = 8;
     field public static final int AUTH_FLAG_PREVIOUS_FAILED = 16;
@@ -535,44 +519,44 @@ package org.mozilla.geckoview {
     field public final java.lang.String id;
     field public final org.mozilla.geckoview.GeckoSession.PromptDelegate.Choice[] items;
     field public final java.lang.String label;
     field public final boolean selected;
     field public final boolean separator;
   }
 
   public static interface GeckoSession.PromptDelegate.ChoiceCallback implements org.mozilla.geckoview.GeckoSession.PromptDelegate.AlertCallback {
-    method @android.support.annotation.UiThread public void confirm(java.lang.String);
-    method @android.support.annotation.UiThread public void confirm(java.lang.String[]);
-    method @android.support.annotation.UiThread public void confirm(org.mozilla.geckoview.GeckoSession.PromptDelegate.Choice);
-    method @android.support.annotation.UiThread public void confirm(org.mozilla.geckoview.GeckoSession.PromptDelegate.Choice[]);
+    method @android.support.annotation.UiThread public void confirm(@android.support.annotation.Nullable java.lang.String);
+    method @android.support.annotation.UiThread public void confirm(@android.support.annotation.NonNull java.lang.String[]);
+    method @android.support.annotation.UiThread public void confirm(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.PromptDelegate.Choice);
+    method @android.support.annotation.UiThread public void confirm(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.PromptDelegate.Choice[]);
   }
 
   public static interface GeckoSession.PromptDelegate.DatetimeType implements java.lang.annotation.Annotation {
   }
 
   public static interface GeckoSession.PromptDelegate.FileCallback implements org.mozilla.geckoview.GeckoSession.PromptDelegate.AlertCallback {
-    method @android.support.annotation.UiThread public void confirm(android.content.Context, android.net.Uri);
-    method @android.support.annotation.UiThread public void confirm(android.content.Context, android.net.Uri[]);
+    method @android.support.annotation.UiThread public void confirm(@android.support.annotation.Nullable android.content.Context, @android.support.annotation.Nullable android.net.Uri);
+    method @android.support.annotation.UiThread public void confirm(@android.support.annotation.Nullable android.content.Context, @android.support.annotation.Nullable android.net.Uri[]);
   }
 
   public static interface GeckoSession.PromptDelegate.FileType implements java.lang.annotation.Annotation {
   }
 
   public static interface GeckoSession.PromptDelegate.TextCallback implements org.mozilla.geckoview.GeckoSession.PromptDelegate.AlertCallback {
-    method @android.support.annotation.UiThread public void confirm(java.lang.String);
+    method @android.support.annotation.UiThread public void confirm(@android.support.annotation.Nullable java.lang.String);
   }
 
   public static interface GeckoSession.ScrollDelegate {
-    method @android.support.annotation.UiThread public void onScrollChanged(org.mozilla.geckoview.GeckoSession, int, int);
+    method @android.support.annotation.UiThread public void onScrollChanged(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, int, int);
   }
 
   public static interface GeckoSession.SelectionActionDelegate {
-    method @android.support.annotation.UiThread public void onHideAction(org.mozilla.geckoview.GeckoSession, int);
-    method @android.support.annotation.UiThread public void onShowActionRequest(org.mozilla.geckoview.GeckoSession, org.mozilla.geckoview.GeckoSession.SelectionActionDelegate.Selection, java.lang.String[], org.mozilla.geckoview.GeckoResponse<java.lang.String>);
+    method @android.support.annotation.UiThread public void onHideAction(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, int);
+    method @android.support.annotation.UiThread public void onShowActionRequest(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession.SelectionActionDelegate.Selection, java.lang.String[], @android.support.annotation.NonNull org.mozilla.geckoview.GeckoResponse<java.lang.String>);
     field public static final java.lang.String ACTION_COLLAPSE_TO_END = "org.mozilla.geckoview.COLLAPSE_TO_END";
     field public static final java.lang.String ACTION_COLLAPSE_TO_START = "org.mozilla.geckoview.COLLAPSE_TO_START";
     field public static final java.lang.String ACTION_COPY = "org.mozilla.geckoview.COPY";
     field public static final java.lang.String ACTION_CUT = "org.mozilla.geckoview.CUT";
     field public static final java.lang.String ACTION_DELETE = "org.mozilla.geckoview.DELETE";
     field public static final java.lang.String ACTION_HIDE = "org.mozilla.geckoview.HIDE";
     field public static final java.lang.String ACTION_PASTE = "org.mozilla.geckoview.PASTE";
     field public static final java.lang.String ACTION_SELECT_ALL = "org.mozilla.geckoview.SELECT_ALL";
@@ -599,31 +583,28 @@ package org.mozilla.geckoview {
     ctor protected Selection();
     field public final android.graphics.RectF clientRect;
     field public final int flags;
     field public final java.lang.String text;
   }
 
   @android.support.annotation.AnyThread public static class GeckoSession.SessionState implements android.os.Parcelable {
     ctor public SessionState(java.lang.String);
-    method public int describeContents();
-    method public void readFromParcel(android.os.Parcel);
-    method public java.lang.String toString();
-    method public void writeToParcel(android.os.Parcel, int);
+    method public void readFromParcel(@android.support.annotation.NonNull android.os.Parcel);
     field public static final android.os.Parcelable.Creator<org.mozilla.geckoview.GeckoSession.SessionState> CREATOR;
   }
 
   public static interface GeckoSession.TextInputDelegate {
-    method @android.support.annotation.UiThread public void hideSoftInput(org.mozilla.geckoview.GeckoSession);
-    method @android.support.annotation.UiThread public void notifyAutoFill(org.mozilla.geckoview.GeckoSession, int, int);
-    method @android.support.annotation.UiThread public void restartInput(org.mozilla.geckoview.GeckoSession, int);
-    method @android.support.annotation.UiThread public void showSoftInput(org.mozilla.geckoview.GeckoSession);
-    method @android.support.annotation.UiThread public void updateCursorAnchorInfo(org.mozilla.geckoview.GeckoSession, android.view.inputmethod.CursorAnchorInfo);
-    method @android.support.annotation.UiThread public void updateExtractedText(org.mozilla.geckoview.GeckoSession, android.view.inputmethod.ExtractedTextRequest, android.view.inputmethod.ExtractedText);
-    method @android.support.annotation.UiThread public void updateSelection(org.mozilla.geckoview.GeckoSession, int, int, int, int);
+    method @android.support.annotation.UiThread public void hideSoftInput(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession);
+    method @android.support.annotation.UiThread public void notifyAutoFill(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, int, int);
+    method @android.support.annotation.UiThread public void restartInput(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, int);
+    method @android.support.annotation.UiThread public void showSoftInput(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession);
+    method @android.support.annotation.UiThread public void updateCursorAnchorInfo(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.NonNull android.view.inputmethod.CursorAnchorInfo);
+    method @android.support.annotation.UiThread public void updateExtractedText(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.NonNull android.view.inputmethod.ExtractedTextRequest, @android.support.annotation.NonNull android.view.inputmethod.ExtractedText);
+    method @android.support.annotation.UiThread public void updateSelection(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, int, int, int, int);
     field public static final int AUTO_FILL_NOTIFY_CANCELED = 2;
     field public static final int AUTO_FILL_NOTIFY_COMMITTED = 1;
     field public static final int AUTO_FILL_NOTIFY_STARTED = 0;
     field public static final int AUTO_FILL_NOTIFY_VIEW_ADDED = 3;
     field public static final int AUTO_FILL_NOTIFY_VIEW_ENTERED = 6;
     field public static final int AUTO_FILL_NOTIFY_VIEW_EXITED = 7;
     field public static final int AUTO_FILL_NOTIFY_VIEW_REMOVED = 4;
     field public static final int AUTO_FILL_NOTIFY_VIEW_UPDATED = 5;
@@ -634,52 +615,47 @@ package org.mozilla.geckoview {
 
   public static interface GeckoSession.TextInputDelegate.AutoFillNotification implements java.lang.annotation.Annotation {
   }
 
   public static interface GeckoSession.TextInputDelegate.RestartReason implements java.lang.annotation.Annotation {
   }
 
   public static interface GeckoSession.TrackingProtectionDelegate {
-    method @android.support.annotation.UiThread public void onTrackerBlocked(org.mozilla.geckoview.GeckoSession, java.lang.String, int);
+    method @android.support.annotation.UiThread public void onTrackerBlocked(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable java.lang.String, int);
     field public static final int CATEGORY_AD = 1;
     field public static final int CATEGORY_ALL = 31;
     field public static final int CATEGORY_ANALYTIC = 2;
     field public static final int CATEGORY_CONTENT = 8;
     field public static final int CATEGORY_NONE = 0;
     field public static final int CATEGORY_SOCIAL = 4;
     field public static final int CATEGORY_TEST = 16;
   }
 
   public static interface GeckoSession.TrackingProtectionDelegate.Category implements java.lang.annotation.Annotation {
   }
 
   @android.support.annotation.AnyThread public static class GeckoSession.WebResponseInfo {
     ctor protected WebResponseInfo();
-    field public final long contentLength;
-    field public final java.lang.String contentType;
-    field public final java.lang.String filename;
-    field public final java.lang.String uri;
+    field @android.support.annotation.Nullable public final long contentLength;
+    field @android.support.annotation.Nullable public final java.lang.String contentType;
+    field @android.support.annotation.Nullable public final java.lang.String filename;
+    field @android.support.annotation.NonNull public final java.lang.String uri;
   }
 
   @android.support.annotation.AnyThread public final class GeckoSessionSettings implements android.os.Parcelable {
     ctor public GeckoSessionSettings();
-    ctor public GeckoSessionSettings(org.mozilla.geckoview.GeckoSessionSettings);
-    method public int describeContents();
-    method public boolean equals(java.lang.Object);
-    method public boolean getBoolean(org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.Boolean>);
-    method public int getInt(org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.Integer>);
-    method public java.lang.String getString(org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.String>);
-    method public int hashCode();
-    method public void readFromParcel(android.os.Parcel);
-    method public void setBoolean(org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.Boolean>, boolean);
-    method public void setInt(org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.Integer>, int);
-    method public void setString(org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.String>, java.lang.String);
-    method public java.lang.String toString();
-    method public void writeToParcel(android.os.Parcel, int);
+    ctor public GeckoSessionSettings(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSessionSettings);
+    method public boolean getBoolean(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.Boolean>);
+    method public int getInt(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.Integer>);
+    method public java.lang.String getString(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.String>);
+    method public void readFromParcel(@android.support.annotation.NonNull android.os.Parcel);
+    method public void setBoolean(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.Boolean>, boolean);
+    method public void setInt(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.Integer>, int);
+    method public void setString(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.String>, @android.support.annotation.Nullable java.lang.String);
     field public static final org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.Boolean> ALLOW_JAVASCRIPT;
     field public static final org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.String> CHROME_URI;
     field public static final android.os.Parcelable.Creator<org.mozilla.geckoview.GeckoSessionSettings> CREATOR;
     field public static final org.mozilla.geckoview.GeckoSessionSettings.Key<java.lang.Integer> DISPLAY_MODE;
     field public static final int DISPLAY_MODE_BROWSER = 0;
     field public static final int DISPLAY_MODE_FULLSCREEN = 3;
     field public static final int DISPLAY_MODE_MINIMAL_UI = 1;
     field public static final int DISPLAY_MODE_STANDALONE = 2;
@@ -697,71 +673,50 @@ package org.mozilla.geckoview {
   }
 
   public static class GeckoSessionSettings.Key<T> {
   }
 
   @android.support.annotation.UiThread public class GeckoView extends android.widget.FrameLayout {
     ctor public GeckoView(android.content.Context);
     ctor public GeckoView(android.content.Context, android.util.AttributeSet);
-    method public void autofill(android.util.SparseArray<android.view.autofill.AutofillValue>);
     method public void coverUntilFirstPaint(int);
-    method public void dispatchDraw(android.graphics.Canvas);
-    method public boolean gatherTransparentRegion(android.graphics.Region);
-    method public org.mozilla.geckoview.DynamicToolbarAnimator getDynamicToolbarAnimator();
-    method @android.support.annotation.AnyThread public org.mozilla.gecko.EventDispatcher getEventDispatcher();
-    method public android.os.Handler getHandler();
-    method public org.mozilla.geckoview.PanZoomController getPanZoomController();
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.GeckoSession getSession();
-    method public void onAttachedToWindow();
-    method public android.view.inputmethod.InputConnection onCreateInputConnection(android.view.inputmethod.EditorInfo);
-    method public void onDetachedFromWindow();
-    method public boolean onGenericMotionEvent(android.view.MotionEvent);
-    method public boolean onKeyDown(int, android.view.KeyEvent);
-    method public boolean onKeyLongPress(int, android.view.KeyEvent);
-    method public boolean onKeyMultiple(int, int, android.view.KeyEvent);
-    method public boolean onKeyPreIme(int, android.view.KeyEvent);
-    method public boolean onKeyUp(int, android.view.KeyEvent);
-    method public void onProvideAutofillVirtualStructure(android.view.ViewStructure, int);
-    method public boolean onTouchEvent(android.view.MotionEvent);
-    method public void onWindowFocusChanged(boolean);
-    method public org.mozilla.geckoview.GeckoSession releaseSession();
-    method public void setSession(org.mozilla.geckoview.GeckoSession);
-    method public void setSession(org.mozilla.geckoview.GeckoSession, org.mozilla.geckoview.GeckoRuntime);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.DynamicToolbarAnimator getDynamicToolbarAnimator();
+    method @android.support.annotation.AnyThread @android.support.annotation.NonNull public org.mozilla.gecko.EventDispatcher getEventDispatcher();
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.PanZoomController getPanZoomController();
+    method @android.support.annotation.AnyThread @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoSession getSession();
+    method @android.support.annotation.Nullable public org.mozilla.geckoview.GeckoSession releaseSession();
+    method public void setSession(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession);
+    method public void setSession(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoSession, @android.support.annotation.Nullable org.mozilla.geckoview.GeckoRuntime);
     method public boolean shouldPinOnScreen();
-    method protected void onConfigurationChanged(android.content.res.Configuration);
-    method protected void onFocusChanged(boolean, int, android.graphics.Rect);
-    method protected void onRestoreInstanceState(android.os.Parcelable);
-    method protected android.os.Parcelable onSaveInstanceState();
-    method protected void onWindowVisibilityChanged(int);
     field protected final org.mozilla.geckoview.GeckoView.Display mDisplay;
     field protected org.mozilla.geckoview.GeckoRuntime mRuntime;
     field protected org.mozilla.geckoview.GeckoSession mSession;
     field protected android.view.SurfaceView mSurfaceView;
   }
 
   @android.support.annotation.AnyThread public class GeckoWebExecutor {
-    ctor public GeckoWebExecutor(org.mozilla.geckoview.GeckoRuntime);
-    method public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.WebResponse> fetch(org.mozilla.geckoview.WebRequest);
-    method public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.WebResponse> fetch(org.mozilla.geckoview.WebRequest, int);
-    method public org.mozilla.geckoview.GeckoResult<java.net.InetAddress[]> resolve(java.lang.String);
-    method public void speculativeConnect(java.lang.String);
+    ctor public GeckoWebExecutor(@android.support.annotation.NonNull org.mozilla.geckoview.GeckoRuntime);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.WebResponse> fetch(@android.support.annotation.NonNull org.mozilla.geckoview.WebRequest);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.WebResponse> fetch(@android.support.annotation.NonNull org.mozilla.geckoview.WebRequest, int);
+    method public org.mozilla.geckoview.GeckoResult<java.net.InetAddress[]> resolve(@android.support.annotation.NonNull java.lang.String);
+    method public void speculativeConnect(@android.support.annotation.NonNull java.lang.String);
     field public static final int FETCH_FLAGS_ANONYMOUS = 1;
     field public static final int FETCH_FLAGS_NONE = 0;
   }
 
   public static interface GeckoWebExecutor.FetchFlags implements java.lang.annotation.Annotation {
   }
 
   @android.support.annotation.AnyThread public class MediaElement {
-    method public org.mozilla.geckoview.MediaElement.Delegate getDelegate();
+    method @android.support.annotation.Nullable public org.mozilla.geckoview.MediaElement.Delegate getDelegate();
     method public void pause();
     method public void play();
     method public void seek(double);
-    method public void setDelegate(org.mozilla.geckoview.MediaElement.Delegate);
+    method public void setDelegate(@android.support.annotation.Nullable org.mozilla.geckoview.MediaElement.Delegate);
     method public void setMuted(boolean);
     method public void setPlaybackRate(double);
     method public void setVolume(double);
     field public static final int MEDIA_ERROR_ABORTED = 1;
     field public static final int MEDIA_ERROR_DECODE = 3;
     field public static final int MEDIA_ERROR_NETWORK = 2;
     field public static final int MEDIA_ERROR_NETWORK_NO_SOURCE = 0;
     field public static final int MEDIA_ERROR_SRC_NOT_SUPPORTED = 4;
@@ -782,30 +737,30 @@ package org.mozilla.geckoview {
     field public static final int MEDIA_STATE_SUSPEND = 7;
     field public static final int MEDIA_STATE_WAITING = 8;
     field protected org.mozilla.geckoview.MediaElement.Delegate mDelegate;
     field protected final org.mozilla.geckoview.GeckoSession mSession;
     field protected final long mVideoId;
   }
 
   public static interface MediaElement.Delegate {
-    method @android.support.annotation.UiThread public void onError(org.mozilla.geckoview.MediaElement, int);
-    method @android.support.annotation.UiThread public void onFullscreenChange(org.mozilla.geckoview.MediaElement, boolean);
-    method @android.support.annotation.UiThread public void onLoadProgress(org.mozilla.geckoview.MediaElement, org.mozilla.geckoview.MediaElement.LoadProgressInfo);
-    method @android.support.annotation.UiThread public void onMetadataChange(org.mozilla.geckoview.MediaElement, org.mozilla.geckoview.MediaElement.Metadata);
-    method @android.support.annotation.UiThread public void onPlaybackRateChange(org.mozilla.geckoview.MediaElement, double);
-    method @android.support.annotation.UiThread public void onPlaybackStateChange(org.mozilla.geckoview.MediaElement, int);
-    method @android.support.annotation.UiThread public void onReadyStateChange(org.mozilla.geckoview.MediaElement, int);
-    method @android.support.annotation.UiThread public void onTimeChange(org.mozilla.geckoview.MediaElement, double);
-    method @android.support.annotation.UiThread public void onVolumeChange(org.mozilla.geckoview.MediaElement, double, boolean);
+    method @android.support.annotation.UiThread public void onError(@android.support.annotation.NonNull org.mozilla.geckoview.MediaElement, int);
+    method @android.support.annotation.UiThread public void onFullscreenChange(@android.support.annotation.NonNull org.mozilla.geckoview.MediaElement, boolean);
+    method @android.support.annotation.UiThread public void onLoadProgress(@android.support.annotation.NonNull org.mozilla.geckoview.MediaElement, @android.support.annotation.NonNull org.mozilla.geckoview.MediaElement.LoadProgressInfo);
+    method @android.support.annotation.UiThread public void onMetadataChange(@android.support.annotation.NonNull org.mozilla.geckoview.MediaElement, @android.support.annotation.NonNull org.mozilla.geckoview.MediaElement.Metadata);
+    method @android.support.annotation.UiThread public void onPlaybackRateChange(@android.support.annotation.NonNull org.mozilla.geckoview.MediaElement, double);
+    method @android.support.annotation.UiThread public void onPlaybackStateChange(@android.support.annotation.NonNull org.mozilla.geckoview.MediaElement, int);
+    method @android.support.annotation.UiThread public void onReadyStateChange(@android.support.annotation.NonNull org.mozilla.geckoview.MediaElement, int);
+    method @android.support.annotation.UiThread public void onTimeChange(@android.support.annotation.NonNull org.mozilla.geckoview.MediaElement, double);
+    method @android.support.annotation.UiThread public void onVolumeChange(@android.support.annotation.NonNull org.mozilla.geckoview.MediaElement, double, boolean);
   }
 
   public static class MediaElement.LoadProgressInfo {
     ctor protected LoadProgressInfo();
-    field public final org.mozilla.geckoview.MediaElement.LoadProgressInfo.TimeRange[] buffered;
+    field @android.support.annotation.Nullable public final org.mozilla.geckoview.MediaElement.LoadProgressInfo.TimeRange[] buffered;
     field public final long loadedBytes;
     field public final long totalBytes;
   }
 
   public class MediaElement.LoadProgressInfo.TimeRange {
     ctor protected TimeRange(double, double);
     field public final double end;
     field public final double start;
@@ -818,113 +773,105 @@ package org.mozilla.geckoview {
     field public final double duration;
     field public final long height;
     field public final boolean isSeekable;
     field public final int videoTrackCount;
     field public final long width;
   }
 
   @android.support.annotation.UiThread public final class OverscrollEdgeEffect {
-    method public void draw(android.graphics.Canvas);
-    method public java.lang.Runnable getInvalidationCallback();
-    method public void setInvalidationCallback(java.lang.Runnable);
-    method public void setTheme(android.content.Context);
+    method public void draw(@android.support.annotation.NonNull android.graphics.Canvas);
+    method @android.support.annotation.Nullable public java.lang.Runnable getInvalidationCallback();
+    method public void setInvalidationCallback(@android.support.annotation.Nullable java.lang.Runnable);
+    method public void setTheme(@android.support.annotation.NonNull android.content.Context);
   }
 
   @android.support.annotation.UiThread public class PanZoomController extends org.mozilla.gecko.mozglue.JNIObject {
     ctor protected PanZoomController(org.mozilla.geckoview.GeckoSession);
     method public float getScrollFactor();
-    method public boolean onMotionEvent(android.view.MotionEvent);
-    method public boolean onMouseEvent(android.view.MotionEvent);
-    method public boolean onTouchEvent(android.view.MotionEvent);
+    method public boolean onMotionEvent(@android.support.annotation.NonNull android.view.MotionEvent);
+    method public boolean onMouseEvent(@android.support.annotation.NonNull android.view.MotionEvent);
+    method public boolean onTouchEvent(@android.support.annotation.NonNull android.view.MotionEvent);
     method public void setIsLongpressEnabled(boolean);
     method public void setScrollFactor(float);
-    method protected void disposeNative();
-    method protected void finalize();
   }
 
   public final class RuntimeTelemetry {
-    method @android.support.annotation.AnyThread public org.mozilla.geckoview.GeckoResult<org.mozilla.gecko.util.GeckoBundle> getSnapshots(boolean);
+    method @android.support.annotation.AnyThread @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoResult<org.mozilla.gecko.util.GeckoBundle> getSnapshots(boolean);
   }
 
   @android.support.annotation.UiThread public class SessionAccessibility {
-    method public android.view.View getView();
-    method public boolean onMotionEvent(android.view.MotionEvent);
-    method @android.support.annotation.UiThread public void setView(android.view.View);
+    method @android.support.annotation.Nullable public android.view.View getView();
+    method public boolean onMotionEvent(@android.support.annotation.NonNull android.view.MotionEvent);
+    method @android.support.annotation.UiThread public void setView(@android.support.annotation.Nullable android.view.View);
   }
 
   @android.support.annotation.AnyThread public final class SessionFinder {
     method public void clear();
-    method public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.GeckoSession.FinderResult> find(java.lang.String, int);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoResult<org.mozilla.geckoview.GeckoSession.FinderResult> find(@android.support.annotation.Nullable java.lang.String, int);
     method public int getDisplayFlags();
     method public void setDisplayFlags(int);
   }
 
   public final class SessionTextInput {
-    method @android.support.annotation.UiThread public void autofill(android.util.SparseArray<java.lang.CharSequence>);
-    method @android.support.annotation.UiThread public org.mozilla.geckoview.GeckoSession.TextInputDelegate getDelegate();
-    method @android.support.annotation.AnyThread public synchronized android.os.Handler getHandler(android.os.Handler);
-    method @android.support.annotation.UiThread public android.view.View getView();
-    method @android.support.annotation.AnyThread public synchronized android.view.inputmethod.InputConnection onCreateInputConnection(android.view.inputmethod.EditorInfo);
-    method @android.support.annotation.UiThread public boolean onKeyDown(int, android.view.KeyEvent);
-    method @android.support.annotation.UiThread public boolean onKeyLongPress(int, android.view.KeyEvent);
-    method @android.support.annotation.UiThread public boolean onKeyMultiple(int, int, android.view.KeyEvent);
-    method @android.support.annotation.UiThread public boolean onKeyPreIme(int, android.view.KeyEvent);
-    method @android.support.annotation.UiThread public boolean onKeyUp(int, android.view.KeyEvent);
-    method @android.support.annotation.UiThread public void onProvideAutofillVirtualStructure(android.view.ViewStructure, int);
-    method @android.support.annotation.UiThread public void setDelegate(org.mozilla.geckoview.GeckoSession.TextInputDelegate);
-    method @android.support.annotation.UiThread public synchronized void setView(android.view.View);
+    method @android.support.annotation.UiThread public void autofill(@android.support.annotation.NonNull android.util.SparseArray<java.lang.CharSequence>);
+    method @android.support.annotation.UiThread @android.support.annotation.NonNull public org.mozilla.geckoview.GeckoSession.TextInputDelegate getDelegate();
+    method @android.support.annotation.AnyThread @android.support.annotation.NonNull public synchronized android.os.Handler getHandler(@android.support.annotation.NonNull android.os.Handler);
+    method @android.support.annotation.UiThread @android.support.annotation.Nullable public android.view.View getView();
+    method @android.support.annotation.AnyThread @android.support.annotation.Nullable public synchronized android.view.inputmethod.InputConnection onCreateInputConnection(@android.support.annotation.NonNull android.view.inputmethod.EditorInfo);
+    method @android.support.annotation.UiThread public boolean onKeyDown(int, @android.support.annotation.NonNull android.view.KeyEvent);
+    method @android.support.annotation.UiThread public boolean onKeyLongPress(int, @android.support.annotation.NonNull android.view.KeyEvent);
+    method @android.support.annotation.UiThread public boolean onKeyMultiple(int, int, @android.support.annotation.NonNull android.view.KeyEvent);
+    method @android.support.annotation.UiThread public boolean onKeyPreIme(int, @android.support.annotation.NonNull android.view.KeyEvent);
+    method @android.support.annotation.UiThread public boolean onKeyUp(int, @android.support.annotation.NonNull android.view.KeyEvent);
+    method @android.support.annotation.UiThread public void onProvideAutofillVirtualStructure(@android.support.annotation.NonNull android.view.ViewStructure, int);
+    method @android.support.annotation.UiThread public void setDelegate(@android.support.annotation.Nullable org.mozilla.geckoview.GeckoSession.TextInputDelegate);
+    method @android.support.annotation.UiThread public synchronized void setView(@android.support.annotation.Nullable android.view.View);
   }
 
   @android.support.annotation.AnyThread public abstract class WebMessage {
-    ctor protected WebMessage(org.mozilla.geckoview.WebMessage.Builder);
-    field public final java.nio.ByteBuffer body;
-    field public final java.util.Map<java.lang.String, java.lang.String> headers;
-    field public final java.lang.String uri;
+    ctor protected WebMessage(@android.support.annotation.NonNull org.mozilla.geckoview.WebMessage.Builder);
+    field @android.support.annotation.Nullable public final java.nio.ByteBuffer body;
+    field @android.support.annotation.NonNull public final java.util.Map<java.lang.String, java.lang.String> headers;
+    field @android.support.annotation.NonNull public final java.lang.String uri;
   }
 
   @android.support.annotation.AnyThread public abstract static class WebMessage.Builder {
-    method public org.mozilla.geckoview.WebMessage.Builder addHeader(java.lang.String, java.lang.String);
-    method public org.mozilla.geckoview.WebMessage.Builder body(java.nio.ByteBuffer);
-    method public org.mozilla.geckoview.WebMessage.Builder header(java.lang.String, java.lang.String);
-    method public org.mozilla.geckoview.WebMessage.Builder uri(java.lang.String);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.WebMessage.Builder addHeader(@android.support.annotation.NonNull java.lang.String, @android.support.annotation.NonNull java.lang.String);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.WebMessage.Builder body(@android.support.annotation.Nullable java.nio.ByteBuffer);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.WebMessage.Builder header(@android.support.annotation.NonNull java.lang.String, @android.support.annotation.NonNull java.lang.String);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.WebMessage.Builder uri(@android.support.annotation.NonNull java.lang.String);
   }
 
   @android.support.annotation.AnyThread public class WebRequest extends org.mozilla.geckoview.WebMessage {
-    ctor public WebRequest(java.lang.String);
+    ctor public WebRequest(@android.support.annotation.NonNull java.lang.String);
     field public static final int CACHE_MODE_DEFAULT = 1;
     field public static final int CACHE_MODE_FORCE_CACHE = 5;
     field public static final int CACHE_MODE_NO_CACHE = 4;
     field public static final int CACHE_MODE_NO_STORE = 2;
     field public static final int CACHE_MODE_ONLY_IF_CACHED = 6;
     field public static final int CACHE_MODE_RELOAD = 3;
     field public final int cacheMode;
-    field public final java.lang.String method;
-    field public final java.lang.String referrer;
+    field @android.support.annotation.NonNull public final java.lang.String method;
+    field @android.support.annotation.Nullable public final java.lang.String referrer;
   }
 
   @android.support.annotation.AnyThread public static class WebRequest.Builder extends org.mozilla.geckoview.WebMessage.Builder {
-    ctor public Builder(java.lang.String);
-    method public org.mozilla.geckoview.WebRequest.Builder addHeader(java.lang.String, java.lang.String);
-    method public org.mozilla.geckoview.WebRequest.Builder body(java.nio.ByteBuffer);
-    method public org.mozilla.geckoview.WebRequest build();
-    method public org.mozilla.geckoview.WebRequest.Builder cacheMode(int);
-    method public org.mozilla.geckoview.WebRequest.Builder header(java.lang.String, java.lang.String);
-    method public org.mozilla.geckoview.WebRequest.Builder method(java.lang.String);
-    method public org.mozilla.geckoview.WebRequest.Builder referrer(java.lang.String);
-    method public org.mozilla.geckoview.WebRequest.Builder uri(java.lang.String);
+    ctor public Builder(@android.support.annotation.NonNull java.lang.String);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.WebRequest build();
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.WebRequest.Builder cacheMode(int);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.WebRequest.Builder method(@android.support.annotation.NonNull java.lang.String);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.WebRequest.Builder referrer(@android.support.annotation.Nullable java.lang.String);
   }
 
   public static interface WebRequest.CacheMode implements java.lang.annotation.Annotation {
   }
 
   @android.support.annotation.AnyThread public class WebRequestError extends java.lang.Exception {
     ctor public WebRequestError(int, int);
-    method public boolean equals(java.lang.Object);
-    method public int hashCode();
     field public static final int ERROR_CATEGORY_CONTENT = 4;
     field public static final int ERROR_CATEGORY_NETWORK = 3;
     field public static final int ERROR_CATEGORY_PROXY = 6;
     field public static final int ERROR_CATEGORY_SAFEBROWSING = 7;
     field public static final int ERROR_CATEGORY_SECURITY = 2;
     field public static final int ERROR_CATEGORY_UNKNOWN = 1;
     field public static final int ERROR_CATEGORY_URI = 5;
     field public static final int ERROR_CONNECTION_REFUSED = 67;
@@ -959,26 +906,22 @@ package org.mozilla.geckoview {
 
   public static interface WebRequestError.Error implements java.lang.annotation.Annotation {
   }
 
   public static interface WebRequestError.ErrorCategory implements java.lang.annotation.Annotation {
   }
 
   @android.support.annotation.AnyThread public class WebResponse extends org.mozilla.geckoview.WebMessage {
-    ctor protected WebResponse(org.mozilla.geckoview.WebResponse.Builder);
+    ctor protected WebResponse(@android.support.annotation.NonNull org.mozilla.geckoview.WebResponse.Builder);
     field public final boolean redirected;
     field public final int statusCode;
   }
 
   @android.support.annotation.AnyThread public static class WebResponse.Builder extends org.mozilla.geckoview.WebMessage.Builder {
-    ctor public Builder(java.lang.String);
-    method public org.mozilla.geckoview.WebResponse.Builder addHeader(java.lang.String, java.lang.String);
-    method public org.mozilla.geckoview.WebResponse.Builder body(java.nio.ByteBuffer);
-    method public org.mozilla.geckoview.WebResponse build();
-    method public org.mozilla.geckoview.WebResponse.Builder header(java.lang.String, java.lang.String);
-    method public org.mozilla.geckoview.WebResponse.Builder redirected(boolean);
-    method public org.mozilla.geckoview.WebResponse.Builder statusCode(int);
-    method public org.mozilla.geckoview.WebResponse.Builder uri(java.lang.String);
+    ctor public Builder(@android.support.annotation.NonNull java.lang.String);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.WebResponse build();
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.WebResponse.Builder redirected(boolean);
+    method @android.support.annotation.NonNull public org.mozilla.geckoview.WebResponse.Builder statusCode(int);
   }
 
 }
 
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentDelegateTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/ContentDelegateTest.kt
@@ -41,17 +41,17 @@ import kotlin.concurrent.thread
 @MediumTest
 class ContentDelegateTest : BaseSessionTest() {
 
     @Test fun titleChange() {
         sessionRule.session.loadTestPath(TITLE_CHANGE_HTML_PATH)
 
         sessionRule.waitUntilCalled(object : Callbacks.ContentDelegate {
             @AssertCalled(count = 2)
-            override fun onTitleChange(session: GeckoSession, title: String) {
+            override fun onTitleChange(session: GeckoSession, title: String?) {
                 assertThat("Title should match", title,
                            equalTo(forEachCall("Title1", "Title2")))
             }
         })
     }
 
     @Test fun download() {
         sessionRule.session.loadTestPath(DOWNLOAD_HTML_PATH)
@@ -182,17 +182,17 @@ class ContentDelegateTest : BaseSessionT
         mainSession.loadUri("about:blank")
         sessionRule.waitForPageStop()
 
         mainSession.restoreState(state)
         sessionRule.waitForPageStop()
 
         sessionRule.forCallbacksDuringWait(object : Callbacks.NavigationDelegate {
             @AssertCalled
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
                 assertThat("URI should match", url, equalTo(startUri))
             }
         })
 
         assertThat("'name' field should match",
                 mainSession.evaluateJS("$('#name').value").toString(),
                 equalTo("the name"))
 
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/GeckoSessionTestRuleTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/GeckoSessionTestRuleTest.kt
@@ -869,17 +869,17 @@ class GeckoSessionTestRuleTest : BaseSes
         sessionRule.session.loadTestPath(HELLO_HTML_PATH)
         sessionRule.waitForPageStop()
     }
 
     @Test(expected = AssertionError::class)
     @NullDelegate(GeckoSession.NavigationDelegate::class)
     fun delegateDuringNextWait_throwOnNullDelegate() {
         sessionRule.session.delegateDuringNextWait(object : Callbacks.NavigationDelegate {
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
             }
         })
     }
 
     @Test fun wrapSession() {
         val session = sessionRule.wrapSession(
           GeckoSession(sessionRule.session.settings))
         sessionRule.openSession(session)
@@ -1332,17 +1332,18 @@ class GeckoSessionTestRuleTest : BaseSes
                    equalTo("foo"))
     }
 
     @WithDevToolsAPI
     @TimeoutMillis(1000)
     @Test(expected = UiThreadUtils.TimeoutException::class)
     fun evaluateJS_canTimeout() {
         sessionRule.session.delegateUntilTestEnd(object : Callbacks.PromptDelegate {
-            override fun onAlert(session: GeckoSession, title: String, msg: String, callback: GeckoSession.PromptDelegate.AlertCallback) {
+            override fun onAlert(session: GeckoSession, title: String?, msg: String?,
+                                 callback: GeckoSession.PromptDelegate.AlertCallback) {
                 // Do nothing for the alert, so it hangs forever.
             }
         })
         sessionRule.session.evaluateJS("alert()")
     }
 
     @Test(expected = AssertionError::class)
     fun evaluateJS_throwOnNotWithDevTools() {
@@ -1489,33 +1490,35 @@ class GeckoSessionTestRuleTest : BaseSes
     @WithDevToolsAPI
     @Test fun waitForJS() {
         assertThat("waitForJS should return correct result",
                    sessionRule.session.waitForJS("alert(), 'foo'") as String,
                    equalTo("foo"))
 
         sessionRule.session.forCallbacksDuringWait(object : Callbacks.PromptDelegate {
             @AssertCalled(count = 1)
-            override fun onAlert(session: GeckoSession, title: String, msg: String, callback: GeckoSession.PromptDelegate.AlertCallback) {
+            override fun onAlert(session: GeckoSession, title: String?, msg: String?,
+                                 callback: GeckoSession.PromptDelegate.AlertCallback) {
             }
         })
     }
 
     @WithDevToolsAPI
     @Test fun waitForJS_resolvePromise() {
         assertThat("waitForJS should wait for promises",
                    sessionRule.session.waitForJS("Promise.resolve('foo')") as String,
                    equalTo("foo"))
     }
 
     @WithDevToolsAPI
     @Test fun waitForJS_delegateDuringWait() {
         var count = 0
         sessionRule.session.delegateDuringNextWait(object : Callbacks.PromptDelegate {
-            override fun onAlert(session: GeckoSession, title: String, msg: String, callback: GeckoSession.PromptDelegate.AlertCallback) {
+            override fun onAlert(session: GeckoSession, title: String?, msg: String?,
+                                 callback: GeckoSession.PromptDelegate.AlertCallback) {
                 count++
                 callback.dismiss()
             }
         })
 
         sessionRule.session.waitForJS("alert()")
         sessionRule.session.waitForJS("alert()")
 
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/LocaleTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/LocaleTest.kt
@@ -15,17 +15,17 @@ import org.junit.Test
 import org.junit.runner.RunWith
 
 @MediumTest
 @RunWith(AndroidJUnit4::class)
 @WithDevToolsAPI
 class LocaleTest : BaseSessionTest() {
 
     @Test fun setLocale() {
-        sessionRule.runtime.getSettings().setLocales(arrayOf("en-GB"));
+        sessionRule.runtime.getSettings()!!.setLocales(arrayOf("en-GB"));
 
         val index = sessionRule.waitForChromeJS(String.format(
                 "(function() {" +
                 "  return ChromeUtils.import('resource://gre/modules/Services.jsm', {})" +
                 "    .Services.locale.requestedLocales.indexOf('en-GB');" +
                 "})()")) as Double;
 
         assertThat("Requested locale is found", index, greaterThanOrEqualTo(0.0));
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/NavigationDelegateTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/NavigationDelegateTest.kt
@@ -66,22 +66,22 @@ class NavigationDelegateTest : BaseSessi
                 })
 
         sessionRule.session.loadUri(testUri);
         sessionRule.waitForPageStop()
 
         if (errorPageUrl != null) {
             sessionRule.waitUntilCalled(object : Callbacks.ContentDelegate, Callbacks.NavigationDelegate {
                 @AssertCalled(count = 1, order = [1])
-                override fun onLocationChange(session: GeckoSession, url: String) {
+                override fun onLocationChange(session: GeckoSession, url: String?) {
                     assertThat("URL should match", url, equalTo(testUri))
                 }
 
                 @AssertCalled(count = 1, order = [2])
-                override fun onTitleChange(session: GeckoSession, title: String) {
+                override fun onTitleChange(session: GeckoSession, title: String?) {
                     assertThat("Title should not be empty", title, not(isEmptyOrNullString()))
                 }
             })
         }
     }
 
     fun testLoadExpectError(testUri: String, expectedCategory: Int,
                             expectedError: Int) {
@@ -118,17 +118,17 @@ class NavigationDelegateTest : BaseSessi
                 })
 
         sessionRule.session.loadUri(testUri)
         sessionRule.waitUntilCalled(Callbacks.NavigationDelegate::class, "onLoadError")
 
         if (errorPageUrl != null) {
             sessionRule.waitUntilCalled(object: Callbacks.ContentDelegate {
                 @AssertCalled(count = 1)
-                override fun onTitleChange(session: GeckoSession, title: String) {
+                override fun onTitleChange(session: GeckoSession, title: String?) {
                     assertThat("Title should not be empty", title, not(isEmptyOrNullString()));
                 }
             })
         }
     }
 
     fun testLoadEarlyError(testUri: String, expectedCategory: Int,
                            expectedError: Int) {
@@ -169,23 +169,23 @@ class NavigationDelegateTest : BaseSessi
         testLoadExpectError(uri,
                 WebRequestError.ERROR_CATEGORY_SECURITY,
                 WebRequestError.ERROR_SECURITY_BAD_CERT);
     }
 
     @Setting(key = Setting.Key.USE_TRACKING_PROTECTION, value = "true")
     @Test fun trackingProtection() {
         val category = TrackingProtectionDelegate.CATEGORY_TEST;
-        sessionRule.runtime.settings.trackingProtectionCategories = category
+        sessionRule.runtime.settings!!.trackingProtectionCategories = category
         sessionRule.session.loadTestPath(TRACKERS_PATH)
 
         sessionRule.waitUntilCalled(
                 object : Callbacks.TrackingProtectionDelegate {
             @AssertCalled(count = 3)
-            override fun onTrackerBlocked(session: GeckoSession, uri: String,
+            override fun onTrackerBlocked(session: GeckoSession, uri: String?,
                                           categories: Int) {
                 assertThat("Category should be set",
                            categories,
                            equalTo(category))
                 assertThat("URI should not be null", uri, notNullValue())
                 assertThat("URI should match", uri, endsWith("tracker.js"))
             }
         })
@@ -194,17 +194,17 @@ class NavigationDelegateTest : BaseSessi
             GeckoSessionSettings.USE_TRACKING_PROTECTION, false)
 
         sessionRule.session.reload()
         sessionRule.session.waitForPageStop()
 
         sessionRule.forCallbacksDuringWait(
                 object : Callbacks.TrackingProtectionDelegate {
             @AssertCalled(false)
-            override fun onTrackerBlocked(session: GeckoSession, uri: String,
+            override fun onTrackerBlocked(session: GeckoSession, uri: String?,
                                           categories: Int) {
             }
         })
     }
 
     @Test fun redirectLoad() {
         val redirectUri = if (sessionRule.env.isAutomation) {
             "http://example.org/tests/robocop/robocop_blank_02.html"
@@ -239,17 +239,17 @@ class NavigationDelegateTest : BaseSessi
                 return null
             }
         })
     }
 
     @Test fun bypassClassifier() {
         val phishingUri = "https://www.itisatrap.org/firefox/its-a-trap.html"
 
-        sessionRule.runtime.settings.blockPhishing = true
+        sessionRule.runtime.settings!!.blockPhishing = true
 
         sessionRule.session.loadUri(phishingUri + "?bypass=true",
                                     GeckoSession.LOAD_FLAGS_BYPASS_CLASSIFIER)
         sessionRule.session.waitForPageStop()
 
         sessionRule.forCallbacksDuringWait(
                 object : Callbacks.NavigationDelegate {
             @AssertCalled(false)
@@ -258,24 +258,24 @@ class NavigationDelegateTest : BaseSessi
                 return null
             }
         })
     }
 
     @Test fun safebrowsingPhishing() {
         val phishingUri = "https://www.itisatrap.org/firefox/its-a-trap.html"
 
-        sessionRule.runtime.settings.blockPhishing = true
+        sessionRule.runtime.settings!!.blockPhishing = true
 
         // Add query string to avoid bypassing classifier check because of cache.
         testLoadExpectError(phishingUri + "?block=true",
                         WebRequestError.ERROR_CATEGORY_SAFEBROWSING,
                         WebRequestError.ERROR_SAFEBROWSING_PHISHING_URI)
 
-        sessionRule.runtime.settings.blockPhishing = false
+        sessionRule.runtime.settings!!.blockPhishing = false
 
         sessionRule.session.loadUri(phishingUri + "?block=false")
         sessionRule.session.waitForPageStop()
 
         sessionRule.forCallbacksDuringWait(
                 object : Callbacks.NavigationDelegate {
             @AssertCalled(false)
             override fun onLoadError(session: GeckoSession, uri: String?,
@@ -283,23 +283,23 @@ class NavigationDelegateTest : BaseSessi
                 return null
             }
         })
     }
 
     @Test fun safebrowsingMalware() {
         val malwareUri = "https://www.itisatrap.org/firefox/its-an-attack.html"
 
-        sessionRule.runtime.settings.blockMalware = true
+        sessionRule.runtime.settings!!.blockMalware = true
 
         testLoadExpectError(malwareUri + "?block=true",
                         WebRequestError.ERROR_CATEGORY_SAFEBROWSING,
                         WebRequestError.ERROR_SAFEBROWSING_MALWARE_URI)
 
-        sessionRule.runtime.settings.blockMalware = false
+        sessionRule.runtime.settings!!.blockMalware = false
 
         sessionRule.session.loadUri(malwareUri + "?block=false")
         sessionRule.session.waitForPageStop()
 
         sessionRule.forCallbacksDuringWait(
                 object : Callbacks.NavigationDelegate {
             @AssertCalled(false)
             override fun onLoadError(session: GeckoSession, uri: String?,
@@ -307,23 +307,23 @@ class NavigationDelegateTest : BaseSessi
                 return null
             }
         })
     }
 
     @Test fun safebrowsingUnwanted() {
         val unwantedUri = "https://www.itisatrap.org/firefox/unwanted.html"
 
-        sessionRule.runtime.settings.blockMalware = true
+        sessionRule.runtime.settings!!.blockMalware = true
 
         testLoadExpectError(unwantedUri + "?block=true",
                         WebRequestError.ERROR_CATEGORY_SAFEBROWSING,
                         WebRequestError.ERROR_SAFEBROWSING_UNWANTED_URI)
 
-        sessionRule.runtime.settings.blockMalware = false
+        sessionRule.runtime.settings!!.blockMalware = false
 
         sessionRule.session.loadUri(unwantedUri + "?block=false")
         sessionRule.session.waitForPageStop()
 
         sessionRule.forCallbacksDuringWait(
                 object : Callbacks.NavigationDelegate {
             @AssertCalled(false)
             override fun onLoadError(session: GeckoSession, uri: String?,
@@ -331,23 +331,23 @@ class NavigationDelegateTest : BaseSessi
                 return null
             }
         })
     }
 
     @Test fun safebrowsingHarmful() {
         val harmfulUri = "https://www.itisatrap.org/firefox/harmful.html"
 
-        sessionRule.runtime.settings.blockMalware = true
+        sessionRule.runtime.settings!!.blockMalware = true
 
         testLoadExpectError(harmfulUri + "?block=true",
                         WebRequestError.ERROR_CATEGORY_SAFEBROWSING,
                         WebRequestError.ERROR_SAFEBROWSING_HARMFUL_URI)
 
-        sessionRule.runtime.settings.blockMalware = false
+        sessionRule.runtime.settings!!.blockMalware = false
 
         sessionRule.session.loadUri(harmfulUri + "?block=false")
         sessionRule.session.waitForPageStop()
 
         sessionRule.forCallbacksDuringWait(
                 object : Callbacks.NavigationDelegate {
             @AssertCalled(false)
             override fun onLoadError(session: GeckoSession, uri: String?,
@@ -524,17 +524,17 @@ class NavigationDelegateTest : BaseSessi
                 assertThat("Target should not be null", request.target, notNullValue())
                 assertThat("Target should match", request.target,
                            equalTo(GeckoSession.NavigationDelegate.TARGET_WINDOW_CURRENT))
                 assertThat("Redirect flag is not set", request.isRedirect, equalTo(false))
                 return null
             }
 
             @AssertCalled(count = 1, order = [2])
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
                 assertThat("Session should not be null", session, notNullValue())
                 assertThat("URL should not be null", url, notNullValue())
                 assertThat("URL should match", url, endsWith(HELLO_HTML_PATH))
             }
 
             @AssertCalled(count = 1, order = [2])
             override fun onCanGoBack(session: GeckoSession, canGoBack: Boolean) {
                 assertThat("Session should not be null", session, notNullValue())
@@ -556,17 +556,17 @@ class NavigationDelegateTest : BaseSessi
 
     @Test fun load_dataUri() {
         val dataUrl = "data:,Hello%2C%20World!"
         sessionRule.session.loadUri(dataUrl);
         sessionRule.waitForPageStop();
 
         sessionRule.forCallbacksDuringWait(object : Callbacks.NavigationDelegate, Callbacks.ProgressDelegate {
             @AssertCalled(count = 1)
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
                 assertThat("URL should match the provided data URL", url, equalTo(dataUrl))
             }
 
             @AssertCalled(count = 1)
             override fun onPageStop(session: GeckoSession, success: Boolean) {
                 assertThat("Page should load successfully", success, equalTo(true))
             }
         })
@@ -582,17 +582,17 @@ class NavigationDelegateTest : BaseSessi
         sessionRule.session.waitForPageStop()
     }
 
     @NullDelegate(GeckoSession.NavigationDelegate::class)
     @Test fun load_canUnsetNavigationDelegate() {
         // Test that if we unset the navigation delegate during a load, the load still proceeds.
         var onLocationCount = 0
         sessionRule.session.navigationDelegate = object : Callbacks.NavigationDelegate {
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
                 onLocationCount++
             }
         }
         sessionRule.session.loadTestPath(HELLO_HTML_PATH)
         sessionRule.session.waitForPageStop()
 
         assertThat("Should get callback for first load",
                    onLocationCount, equalTo(1))
@@ -608,22 +608,22 @@ class NavigationDelegateTest : BaseSessi
     @Test fun loadString() {
         val dataString = "<html><head><title>TheTitle</title></head><body>TheBody</body></html>"
         val mimeType = "text/html"
         sessionRule.session.loadString(dataString, mimeType)
         sessionRule.waitForPageStop();
 
         sessionRule.forCallbacksDuringWait(object : Callbacks.NavigationDelegate, Callbacks.ProgressDelegate, Callbacks.ContentDelegate {
             @AssertCalled
-            override fun onTitleChange(session: GeckoSession, title: String) {
+            override fun onTitleChange(session: GeckoSession, title: String?) {
                 assertThat("Title should match", title, equalTo("TheTitle"));
             }
 
             @AssertCalled(count = 1)
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
                 assertThat("URL should be a data URL", url,
                            equalTo(GeckoSession.createDataUri(dataString, mimeType)))
             }
 
             @AssertCalled(count = 1)
             override fun onPageStop(session: GeckoSession, success: Boolean) {
                 assertThat("Page should load successfully", success, equalTo(true))
             }
@@ -631,17 +631,17 @@ class NavigationDelegateTest : BaseSessi
     }
 
     @Test fun loadString_noMimeType() {
         sessionRule.session.loadString("Hello, World!", null)
         sessionRule.waitForPageStop();
 
         sessionRule.forCallbacksDuringWait(object : Callbacks.NavigationDelegate, Callbacks.ProgressDelegate {
             @AssertCalled(count = 1)
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
                 assertThat("URL should be a data URL", url, startsWith("data:"))
             }
 
             @AssertCalled(count = 1)
             override fun onPageStop(session: GeckoSession, success: Boolean) {
                 assertThat("Page should load successfully", success, equalTo(true))
             }
         })
@@ -651,22 +651,22 @@ class NavigationDelegateTest : BaseSessi
         val bytes = getTestBytes(HELLO_HTML_PATH)
         assertThat("test html should have data", bytes.size, greaterThan(0))
 
         sessionRule.session.loadData(bytes, "text/html");
         sessionRule.waitForPageStop();
 
         sessionRule.forCallbacksDuringWait(object : Callbacks.NavigationDelegate, Callbacks.ProgressDelegate, Callbacks.ContentDelegate {
             @AssertCalled(count = 1)
-            override fun onTitleChange(session: GeckoSession, title: String) {
+            override fun onTitleChange(session: GeckoSession, title: String?) {
                 assertThat("Title should match", title, equalTo("Hello, world!"))
             }
 
             @AssertCalled(count = 1)
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
                 assertThat("URL should match", url, equalTo(GeckoSession.createDataUri(bytes, "text/html")))
             }
 
             @AssertCalled(count = 1)
             override fun onPageStop(session: GeckoSession, success: Boolean) {
                 assertThat("Page should load successfully", success, equalTo(true))
             }
         })
@@ -676,17 +676,17 @@ class NavigationDelegateTest : BaseSessi
         val bytes = getTestBytes(assetPath)
         assertThat("test data should have bytes", bytes.size, greaterThan(0))
 
         sessionRule.session.loadData(bytes, mimeType);
         sessionRule.waitForPageStop();
 
         sessionRule.forCallbacksDuringWait(object : Callbacks.NavigationDelegate, Callbacks.ProgressDelegate {
             @AssertCalled(count = 1)
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
                 assertThat("URL should match", url, equalTo(GeckoSession.createDataUri(bytes, mimeType)))
             }
 
             @AssertCalled(count = 1)
             override fun onPageStop(session: GeckoSession, success: Boolean) {
                 assertThat("Page should load successfully", success, equalTo(true))
             }
         })
@@ -717,17 +717,17 @@ class NavigationDelegateTest : BaseSessi
                 assertThat("Trigger URL should be null", request.triggerUri,
                            nullValue())
                 assertThat("Target should match", request.target,
                            equalTo(GeckoSession.NavigationDelegate.TARGET_WINDOW_CURRENT))
                 return null
             }
 
             @AssertCalled(count = 1, order = [2])
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
                 assertThat("URL should match", url, endsWith(HELLO_HTML_PATH))
             }
 
             @AssertCalled(count = 1, order = [2])
             override fun onCanGoBack(session: GeckoSession, canGoBack: Boolean) {
                 assertThat("Cannot go back", canGoBack, equalTo(false))
             }
 
@@ -747,17 +747,17 @@ class NavigationDelegateTest : BaseSessi
         sessionRule.session.loadTestPath(HELLO_HTML_PATH)
         sessionRule.waitForPageStop()
 
         sessionRule.session.loadTestPath(HELLO2_HTML_PATH)
         sessionRule.waitForPageStop()
 
         sessionRule.forCallbacksDuringWait(object : Callbacks.NavigationDelegate {
             @AssertCalled(count = 1)
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
                 assertThat("URL should match", url, endsWith(HELLO2_HTML_PATH))
             }
         })
 
         sessionRule.session.goBack()
         sessionRule.waitForPageStop()
 
         sessionRule.forCallbacksDuringWait(object : Callbacks.NavigationDelegate {
@@ -769,17 +769,17 @@ class NavigationDelegateTest : BaseSessi
                 assertThat("Trigger URL should be null", request.triggerUri,
                            nullValue())
                 assertThat("Target should match", request.target,
                            equalTo(GeckoSession.NavigationDelegate.TARGET_WINDOW_CURRENT))
                 return null
             }
 
             @AssertCalled(count = 1, order = [2])
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
                 assertThat("URL should match", url, endsWith(HELLO_HTML_PATH))
             }
 
             @AssertCalled(count = 1, order = [2])
             override fun onCanGoBack(session: GeckoSession, canGoBack: Boolean) {
                 assertThat("Cannot go back", canGoBack, equalTo(false))
             }
 
@@ -806,17 +806,17 @@ class NavigationDelegateTest : BaseSessi
                 assertThat("Trigger URL should be null", request.triggerUri,
                            nullValue())
                 assertThat("Target should match", request.target,
                            equalTo(GeckoSession.NavigationDelegate.TARGET_WINDOW_CURRENT))
                 return null
             }
 
             @AssertCalled(count = 1, order = [2])
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
                 assertThat("URL should match", url, endsWith(HELLO2_HTML_PATH))
             }
 
             @AssertCalled(count = 1, order = [2])
             override fun onCanGoBack(session: GeckoSession, canGoBack: Boolean) {
                 assertThat("Can go back", canGoBack, equalTo(true))
             }
 
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/PermissionDelegateTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/PermissionDelegateTest.kt
@@ -48,40 +48,46 @@ class PermissionDelegateTest : BaseSessi
         sessionRule.forceGarbageCollection()
 
         mainSession.loadTestPath(HELLO_HTML_PATH)
         mainSession.waitForPageStop()
 
 
         mainSession.delegateDuringNextWait(object : Callbacks.PermissionDelegate {
             @AssertCalled(count = 1)
-            override fun onAndroidPermissionsRequest(session: GeckoSession, permissions: Array<out String>, callback: GeckoSession.PermissionDelegate.Callback) {
+            override fun onAndroidPermissionsRequest(
+                    session: GeckoSession, permissions: Array<out String>?,
+                    callback: GeckoSession.PermissionDelegate.Callback) {
                 assertThat("Permissions list should be correct",
-                           listOf(*permissions), hasItems(Manifest.permission.CAMERA,
-                                                          Manifest.permission.RECORD_AUDIO))
+                           listOf(*permissions!!), hasItems(Manifest.permission.CAMERA,
+                                                            Manifest.permission.RECORD_AUDIO))
                 callback.grant()
             }
         })
 
         val devices = mainSession.waitForJS(
                 "window.navigator.mediaDevices.enumerateDevices()")
 
         assertThat("Device list should contain camera device",
                    devices.asJSList<Any>(), hasItem(hasEntry("kind", "videoinput")))
         assertThat("Device list should contain microphone device",
                    devices.asJSList<Any>(), hasItem(hasEntry("kind", "audioinput")))
 
 
         mainSession.delegateDuringNextWait(object : Callbacks.PermissionDelegate {
             @AssertCalled(count = 1)
-            override fun onMediaPermissionRequest(session: GeckoSession, uri: String, video: Array<out GeckoSession.PermissionDelegate.MediaSource>, audio: Array<out GeckoSession.PermissionDelegate.MediaSource>, callback: GeckoSession.PermissionDelegate.MediaCallback) {
+            override fun onMediaPermissionRequest(
+                    session: GeckoSession, uri: String,
+                    video: Array<out GeckoSession.PermissionDelegate.MediaSource>?,
+                    audio: Array<out GeckoSession.PermissionDelegate.MediaSource>?,
+                    callback: GeckoSession.PermissionDelegate.MediaCallback) {
                 assertThat("URI should match", uri, endsWith(HELLO_HTML_PATH))
                 assertThat("Video source should be valid", video, not(emptyArray()))
                 assertThat("Audio source should be valid", audio, not(emptyArray()))
-                callback.grant(video[0], audio[0])
+                callback.grant(video!![0], audio!![0])
             }
         })
 
         // Start a video/audio stream.
         val stream = mainSession.waitForJS(
                 """window.navigator.mediaDevices.getUserMedia({
                        video: { width: 320, height: 240, frameRate: 10 },
                        audio: true,
@@ -95,17 +101,21 @@ class PermissionDelegateTest : BaseSessi
         // Stop the stream.
         mainSession.waitForJS(
                 "\$_.then(stream => stream.getTracks().forEach(track => track.stop()))")
 
 
         // Now test rejecting the request.
         mainSession.delegateDuringNextWait(object : Callbacks.PermissionDelegate {
             @AssertCalled(count = 1)
-            override fun onMediaPermissionRequest(session: GeckoSession, uri: String, video: Array<out GeckoSession.PermissionDelegate.MediaSource>, audio: Array<out GeckoSession.PermissionDelegate.MediaSource>, callback: GeckoSession.PermissionDelegate.MediaCallback) {
+            override fun onMediaPermissionRequest(
+                    session: GeckoSession, uri: String,
+                    video: Array<out GeckoSession.PermissionDelegate.MediaSource>?,
+                    audio: Array<out GeckoSession.PermissionDelegate.MediaSource>?,
+                    callback: GeckoSession.PermissionDelegate.MediaCallback) {
                 callback.reject()
             }
         })
 
         try {
             mainSession.waitForJS("""
                     window.navigator.mediaDevices.getUserMedia({ audio: true, video: true })""")
             fail("Request should have failed")
@@ -122,27 +132,31 @@ class PermissionDelegateTest : BaseSessi
                                equalTo(true))
 
         mainSession.loadTestPath(HELLO_HTML_PATH)
         mainSession.waitForPageStop()
 
         mainSession.delegateDuringNextWait(object : Callbacks.PermissionDelegate {
             // Ensure the content permission is asked first, before the Android permission.
             @AssertCalled(count = 1, order = [1])
-            override fun onContentPermissionRequest(session: GeckoSession, uri: String, type: Int, callback: GeckoSession.PermissionDelegate.Callback) {
+            override fun onContentPermissionRequest(
+                    session: GeckoSession, uri: String?, type: Int,
+                    callback: GeckoSession.PermissionDelegate.Callback) {
                 assertThat("URI should match", uri, endsWith(HELLO_HTML_PATH))
                 assertThat("Type should match", type,
                            equalTo(GeckoSession.PermissionDelegate.PERMISSION_GEOLOCATION))
                 callback.grant()
             }
 
             @AssertCalled(count = 1, order = [2])
-            override fun onAndroidPermissionsRequest(session: GeckoSession, permissions: Array<out String>, callback: GeckoSession.PermissionDelegate.Callback) {
+            override fun onAndroidPermissionsRequest(
+                    session: GeckoSession, permissions: Array<out String>?,
+                    callback: GeckoSession.PermissionDelegate.Callback) {
                 assertThat("Permissions list should be correct",
-                           listOf(*permissions), hasItems(Manifest.permission.ACCESS_FINE_LOCATION))
+                           listOf(*permissions!!), hasItems(Manifest.permission.ACCESS_FINE_LOCATION))
                 callback.grant()
             }
         })
 
         val position = mainSession.waitForJS("""new Promise((resolve, reject) =>
                 window.navigator.geolocation.getCurrentPosition(resolve, reject))""")
 
         assertThat("Request should succeed",
@@ -153,22 +167,26 @@ class PermissionDelegateTest : BaseSessi
 
     @WithDevToolsAPI
     @Test fun geolocation_reject() {
         mainSession.loadTestPath(HELLO_HTML_PATH)
         mainSession.waitForPageStop()
 
         mainSession.delegateDuringNextWait(object : Callbacks.PermissionDelegate {
             @AssertCalled(count = 1)
-            override fun onContentPermissionRequest(session: GeckoSession, uri: String, type: Int, callback: GeckoSession.PermissionDelegate.Callback) {
+            override fun onContentPermissionRequest(
+                    session: GeckoSession, uri: String?, type: Int,
+                    callback: GeckoSession.PermissionDelegate.Callback) {
                 callback.reject()
             }
 
             @AssertCalled(count = 0)
-            override fun onAndroidPermissionsRequest(session: GeckoSession, permissions: Array<out String>, callback: GeckoSession.PermissionDelegate.Callback) {
+            override fun onAndroidPermissionsRequest(
+                    session: GeckoSession, permissions: Array<out String>?,
+                    callback: GeckoSession.PermissionDelegate.Callback) {
             }
         })
 
         val error = mainSession.waitForJS("""new Promise((resolve, reject) =>
                 window.navigator.geolocation.getCurrentPosition(reject, resolve))""")
 
         assertThat("Request should fail",
                    error.asJSMap(), hasEntry("code", 1.0)) // Error code 1 means permission denied.
@@ -176,17 +194,19 @@ class PermissionDelegateTest : BaseSessi
 
     @WithDevToolsAPI
     @Test fun notification() {
         mainSession.loadTestPath(HELLO_HTML_PATH)
         mainSession.waitForPageStop()
 
         mainSession.delegateDuringNextWait(object : Callbacks.PermissionDelegate {
             @AssertCalled(count = 1)
-            override fun onContentPermissionRequest(session: GeckoSession, uri: String, type: Int, callback: GeckoSession.PermissionDelegate.Callback) {
+            override fun onContentPermissionRequest(
+                    session: GeckoSession, uri: String?, type: Int,
+                    callback: GeckoSession.PermissionDelegate.Callback) {
                 assertThat("URI should match", uri, endsWith(HELLO_HTML_PATH))
                 assertThat("Type should match", type,
                            equalTo(GeckoSession.PermissionDelegate.PERMISSION_DESKTOP_NOTIFICATION))
                 callback.grant()
             }
         })
 
         val result = mainSession.waitForJS("Notification.requestPermission()")
@@ -197,17 +217,19 @@ class PermissionDelegateTest : BaseSessi
 
     @WithDevToolsAPI
     @Test fun notification_reject() {
         mainSession.loadTestPath(HELLO_HTML_PATH)
         mainSession.waitForPageStop()
 
         mainSession.delegateDuringNextWait(object : Callbacks.PermissionDelegate {
             @AssertCalled(count = 1)
-            override fun onContentPermissionRequest(session: GeckoSession, uri: String, type: Int, callback: GeckoSession.PermissionDelegate.Callback) {
+            override fun onContentPermissionRequest(
+                    session: GeckoSession, uri: String?, type: Int,
+                    callback: GeckoSession.PermissionDelegate.Callback) {
                 callback.reject()
             }
         })
 
         val result = mainSession.waitForJS("Notification.requestPermission()")
 
         assertThat("Permission should not be granted",
                    result as String, equalTo("default"))
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/PromptDelegateTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/PromptDelegateTest.kt
@@ -22,32 +22,34 @@ import org.junit.runner.RunWith
 class PromptDelegateTest : BaseSessionTest() {
     @Test fun popupTest() {
         // Ensure popup blocking is enabled for this test.
         sessionRule.setPrefsUntilTestEnd(mapOf("dom.disable_open_during_load" to true))
         sessionRule.session.loadTestPath(POPUP_HTML_PATH)
 
         sessionRule.waitUntilCalled(object : Callbacks.PromptDelegate {
             @AssertCalled(count = 1)
-            override fun onPopupRequest(session: GeckoSession, targetUri: String): GeckoResult<AllowOrDeny>? {
+            override fun onPopupRequest(session: GeckoSession, targetUri: String?)
+                    : GeckoResult<AllowOrDeny>? {
                 assertThat("Session should not be null", session, notNullValue())
                 assertThat("URL should not be null", targetUri, notNullValue())
                 assertThat("URL should match", targetUri, endsWith(HELLO_HTML_PATH))
                 return null
             }
         })
     }
 
     @Test fun popupTestAllow() {
         // Ensure popup blocking is enabled for this test.
         sessionRule.setPrefsUntilTestEnd(mapOf("dom.disable_open_during_load" to true))
 
         sessionRule.delegateDuringNextWait(object : Callbacks.PromptDelegate, Callbacks.NavigationDelegate {
             @AssertCalled(count = 1)
-            override fun onPopupRequest(session: GeckoSession, targetUri: String): GeckoResult<AllowOrDeny>? {
+            override fun onPopupRequest(session: GeckoSession, targetUri: String?)
+                    : GeckoResult<AllowOrDeny>? {
                 assertThat("Session should not be null", session, notNullValue())
                 assertThat("URL should not be null", targetUri, notNullValue())
                 assertThat("URL should match", targetUri, endsWith(HELLO_HTML_PATH))
                 return GeckoResult.fromValue(AllowOrDeny.ALLOW)
             }
 
             @AssertCalled(count = 2)
             override fun onLoadRequest(session: GeckoSession,
@@ -64,17 +66,18 @@ class PromptDelegateTest : BaseSessionTe
     }
 
     @Test fun popupTestBlock() {
         // Ensure popup blocking is enabled for this test.
         sessionRule.setPrefsUntilTestEnd(mapOf("dom.disable_open_during_load" to true))
 
         sessionRule.delegateDuringNextWait(object : Callbacks.PromptDelegate, Callbacks.NavigationDelegate {
             @AssertCalled(count = 1)
-            override fun onPopupRequest(session: GeckoSession, targetUri: String): GeckoResult<AllowOrDeny>? {
+            override fun onPopupRequest(session: GeckoSession, targetUri: String?)
+                    : GeckoResult<AllowOrDeny>? {
                 assertThat("Session should not be null", session, notNullValue())
                 assertThat("URL should not be null", targetUri, notNullValue())
                 assertThat("URL should match", targetUri, endsWith(HELLO_HTML_PATH))
                 return GeckoResult.fromValue(AllowOrDeny.DENY)
             }
 
             @AssertCalled(count = 1)
             override fun onLoadRequest(session: GeckoSession,
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/SessionLifecycleTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/SessionLifecycleTest.kt
@@ -237,17 +237,17 @@ class SessionLifecycleTest : BaseSession
 
         // Disable navigation notifications on the old, open session.
         assertThat("Old session navigation delegate should be null",
                    session.navigationDelegate, nullValue())
 
         // Enable navigation notifications on the new, closed session.
         var onLocationCount = 0
         sessionRule.session.navigationDelegate = object : Callbacks.NavigationDelegate {
-            override fun onLocationChange(session: GeckoSession, url: String) {
+            override fun onLocationChange(session: GeckoSession, url: String?) {
                 onLocationCount++
             }
         }
 
         // Transferring the old session to the new session should
         // automatically re-enable navigation notifications.
         session.toParcel { parcel ->
             sessionRule.session.readFromParcel(parcel)
@@ -388,25 +388,25 @@ class SessionLifecycleTest : BaseSession
         view.session?.reload()
         sessionRule.waitForPageStop()
     }
 
     @ClosedSessionAtStart
     @Test fun restoreInstanceState_sameClosedSession() {
         val view = testRestoreInstanceState(mainSession, mainSession)
         assertThat("View session is unchanged", view.session, equalTo(mainSession))
-        assertThat("View session is closed", view.session.isOpen, equalTo(false))
+        assertThat("View session is closed", view.session!!.isOpen, equalTo(false))
     }
 
     @Test fun restoreInstanceState_sameOpenSession() {
         // We should keep the session open when restoring the same open session.
         val view = testRestoreInstanceState(mainSession, mainSession)
         assertThat("View session is unchanged", view.session, equalTo(mainSession))
-        assertThat("View session is open", view.session.isOpen, equalTo(true))
-        view.session.reload()
+        assertThat("View session is open", view.session!!.isOpen, equalTo(true))
+        view.session!!.reload()
         sessionRule.waitForPageStop()
     }
 
     @Test fun createFromParcel() {
         val session = sessionRule.createOpenSession()
 
         session.toParcel { parcel ->
             val newSession = sessionRule.wrapSession(
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/WebExecutorTest.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/WebExecutorTest.kt
@@ -74,17 +74,17 @@ class WebExecutorTest {
         server.stop()
     }
 
     private fun fetch(request: WebRequest): WebResponse {
         return fetch(request, GeckoWebExecutor.FETCH_FLAGS_NONE)
     }
 
     private fun fetch(request: WebRequest, @GeckoWebExecutor.FetchFlags flags: Int): WebResponse {
-        return executor.fetch(request, flags).poll(env.defaultTimeoutMillis)
+        return executor.fetch(request, flags).poll(env.defaultTimeoutMillis)!!
     }
 
     fun String.toDirectByteBuffer(): ByteBuffer {
         val chars = CharBuffer.wrap(this)
         val buffer = ByteBuffer.allocateDirect(this.length)
         Charset.forName("UTF-8").newEncoder().encode(chars, buffer, true)
 
         return buffer
@@ -206,29 +206,29 @@ class WebExecutorTest {
         executor.speculativeConnect("http://localhost")
 
         // This is just a fence to ensure the above actually ran.
         fetch(WebRequest("$TEST_ENDPOINT/cookies"))
     }
 
     @Test
     fun testResolveV4() {
-        val addresses = executor.resolve("localhost").poll()
+        val addresses = executor.resolve("localhost").poll()!!
         assertThat("Addresses should not be null",
                 addresses, notNullValue())
         assertThat("First address should be loopback",
                 addresses.first().isLoopbackAddress, equalTo(true))
         assertThat("First address size should be 4",
                 addresses.first().address.size, equalTo(4))
     }
 
     @Test
     @SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP)
     fun testResolveV6() {
-        val addresses = executor.resolve("ip6-localhost").poll()
+        val addresses = executor.resolve("ip6-localhost").poll()!!
         assertThat("Addresses should not be null",
                 addresses, notNullValue())
         assertThat("First address should be loopback",
                 addresses.first().isLoopbackAddress, equalTo(true))
         assertThat("First address size should be 16",
                 addresses.first().address.size, equalTo(16))
     }
 
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/Callbacks.kt
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/Callbacks.kt
@@ -22,17 +22,17 @@ class Callbacks private constructor() {
     object Default : All
 
     interface All : ContentDelegate, HistoryDelegate, MediaDelegate,
                     NavigationDelegate, PermissionDelegate, ProgressDelegate,
                     PromptDelegate, ScrollDelegate, SelectionActionDelegate,
                     TextInputDelegate, TrackingProtectionDelegate
 
     interface ContentDelegate : GeckoSession.ContentDelegate {
-        override fun onTitleChange(session: GeckoSession, title: String) {
+        override fun onTitleChange(session: GeckoSession, title: String?) {
         }
 
         override fun onFocusRequest(session: GeckoSession) {
         }
 
         override fun onCloseRequest(session: GeckoSession) {
         }
 
@@ -50,17 +50,17 @@ class Callbacks private constructor() {
         override fun onCrash(session: GeckoSession) {
         }
 
         override fun onFirstComposite(session: GeckoSession) {
         }
     }
 
     interface NavigationDelegate : GeckoSession.NavigationDelegate {
-        override fun onLocationChange(session: GeckoSession, url: String) {
+        override fun onLocationChange(session: GeckoSession, url: String?) {
         }
 
         override fun onCanGoBack(session: GeckoSession, canGoBack: Boolean) {
         }
 
         override fun onCanGoForward(session: GeckoSession, canGoForward: Boolean) {
         }
 
@@ -75,25 +75,33 @@ class Callbacks private constructor() {
 
         override fun onLoadError(session: GeckoSession, uri: String?,
                                  error: WebRequestError): GeckoResult<String>? {
             return null
         }
     }
 
     interface PermissionDelegate : GeckoSession.PermissionDelegate {
-        override fun onAndroidPermissionsRequest(session: GeckoSession, permissions: Array<out String>, callback: GeckoSession.PermissionDelegate.Callback) {
+        override fun onAndroidPermissionsRequest(
+                session: GeckoSession, permissions: Array<out String>?,
+                callback: GeckoSession.PermissionDelegate.Callback) {
             callback.reject()
         }
 
-        override fun onContentPermissionRequest(session: GeckoSession, uri: String, type: Int, callback: GeckoSession.PermissionDelegate.Callback) {
+        override fun onContentPermissionRequest(
+                session: GeckoSession, uri: String?, type: Int,
+                callback: GeckoSession.PermissionDelegate.Callback) {
             callback.reject()
         }
 
-        override fun onMediaPermissionRequest(session: GeckoSession, uri: String, video: Array<out GeckoSession.PermissionDelegate.MediaSource>, audio: Array<out GeckoSession.PermissionDelegate.MediaSource>, callback: GeckoSession.PermissionDelegate.MediaCallback) {
+        override fun onMediaPermissionRequest(
+                session: GeckoSession, uri: String,
+                video: Array<out GeckoSession.PermissionDelegate.MediaSource>?,
+                audio: Array<out GeckoSession.PermissionDelegate.MediaSource>?,
+                callback: GeckoSession.PermissionDelegate.MediaCallback) {
             callback.reject()
         }
     }
 
     interface ProgressDelegate : GeckoSession.ProgressDelegate {
         override fun onPageStart(session: GeckoSession, url: String) {
         }
 
@@ -103,60 +111,75 @@ class Callbacks private constructor() {
         override fun onProgressChange(session: GeckoSession, progress: Int) {
         }
 
         override fun onSecurityChange(session: GeckoSession, securityInfo: GeckoSession.ProgressDelegate.SecurityInformation) {
         }
     }
 
     interface PromptDelegate : GeckoSession.PromptDelegate {
-        override fun onAlert(session: GeckoSession, title: String, msg: String, callback: GeckoSession.PromptDelegate.AlertCallback) {
+        override fun onAlert(session: GeckoSession, title: String?, msg: String?,
+                             callback: GeckoSession.PromptDelegate.AlertCallback) {
             callback.dismiss()
         }
 
-        override fun onButtonPrompt(session: GeckoSession, title: String, msg: String, btnMsg: Array<out String>, callback: GeckoSession.PromptDelegate.ButtonCallback) {
+        override fun onButtonPrompt(session: GeckoSession, title: String?, msg: String?,
+                                    btnMsg: Array<out String>?,
+                                    callback: GeckoSession.PromptDelegate.ButtonCallback) {
             callback.dismiss()
         }
 
-        override fun onTextPrompt(session: GeckoSession, title: String, msg: String, value: String, callback: GeckoSession.PromptDelegate.TextCallback) {
+        override fun onTextPrompt(session: GeckoSession, title: String?, msg: String?,
+                                  value: String?,
+                                  callback: GeckoSession.PromptDelegate.TextCallback) {
             callback.dismiss()
         }
 
-        override fun onAuthPrompt(session: GeckoSession, title: String, msg: String, options: GeckoSession.PromptDelegate.AuthOptions, callback: GeckoSession.PromptDelegate.AuthCallback) {
+        override fun onAuthPrompt(session: GeckoSession, title: String?, msg: String?,
+                                  options: GeckoSession.PromptDelegate.AuthOptions,
+                                  callback: GeckoSession.PromptDelegate.AuthCallback) {
             callback.dismiss()
         }
 
-        override fun onChoicePrompt(session: GeckoSession, title: String, msg: String, type: Int, choices: Array<out GeckoSession.PromptDelegate.Choice>, callback: GeckoSession.PromptDelegate.ChoiceCallback) {
+        override fun onChoicePrompt(session: GeckoSession, title: String?, msg: String?, type: Int,
+                                    choices: Array<out GeckoSession.PromptDelegate.Choice>,
+                                    callback: GeckoSession.PromptDelegate.ChoiceCallback) {
             callback.dismiss()
         }
 
-        override fun onColorPrompt(session: GeckoSession, title: String, value: String, callback: GeckoSession.PromptDelegate.TextCallback) {
+        override fun onColorPrompt(session: GeckoSession, title: String?, value: String?,
+                                   callback: GeckoSession.PromptDelegate.TextCallback) {
             callback.dismiss()
         }
 
-        override fun onDateTimePrompt(session: GeckoSession, title: String, type: Int, value: String, min: String, max: String, callback: GeckoSession.PromptDelegate.TextCallback) {
+        override fun onDateTimePrompt(session: GeckoSession, title: String?, type: Int,
+                                      value: String?, min: String?, max: String?,
+                                      callback: GeckoSession.PromptDelegate.TextCallback) {
             callback.dismiss()
         }
 
-        override fun onFilePrompt(session: GeckoSession, title: String, type: Int, mimeTypes: Array<out String>, callback: GeckoSession.PromptDelegate.FileCallback) {
+        override fun onFilePrompt(session: GeckoSession, title: String?, type: Int,
+                                  mimeTypes: Array<out String>?,
+                                  callback: GeckoSession.PromptDelegate.FileCallback) {
             callback.dismiss()
         }
 
-        override fun onPopupRequest(session: GeckoSession, targetUri: String): GeckoResult<AllowOrDeny>? {
+        override fun onPopupRequest(session: GeckoSession, targetUri: String?)
+                : GeckoResult<AllowOrDeny>? {
             return null
         }
     }
 
     interface ScrollDelegate : GeckoSession.ScrollDelegate {
         override fun onScrollChanged(session: GeckoSession, scrollX: Int, scrollY: Int) {
         }
     }
 
     interface TrackingProtectionDelegate : GeckoSession.TrackingProtectionDelegate {
-        override fun onTrackerBlocked(session: GeckoSession, uri: String, categories: Int) {
+        override fun onTrackerBlocked(session: GeckoSession, uri: String?, categories: Int) {
         }
     }
 
     interface SelectionActionDelegate : GeckoSession.SelectionActionDelegate {
         override fun onShowActionRequest(session: GeckoSession, selection: GeckoSession.SelectionActionDelegate.Selection, actions: Array<out String>, response: GeckoResponse<String>) {
         }
 
         override fun onHideAction(session: GeckoSession, reason: Int) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java
@@ -325,21 +325,21 @@ public class GeckoThread extends Thread 
                 args.add(token);
             }
         }
 
         return args.toArray(new String[args.size()]);
     }
 
     @RobocopTarget
-    public static GeckoProfile getActiveProfile() {
+    public static @Nullable GeckoProfile getActiveProfile() {
         return INSTANCE.getProfile();
     }
 
-    public synchronized GeckoProfile getProfile() {
+    public synchronized @Nullable GeckoProfile getProfile() {
         if (!mInitialized) {
             return null;
         }
         if (isChildProcess()) {
             throw new UnsupportedOperationException(
                     "Cannot access profile from child process");
         }
         if (mInitInfo.profile == null) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/BasicSelectionActionDelegate.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/BasicSelectionActionDelegate.java
@@ -11,16 +11,17 @@ import android.app.Activity;
 import android.content.ActivityNotFoundException;
 import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.graphics.Matrix;
 import android.graphics.Rect;
 import android.graphics.RectF;
 import android.os.Build;
 import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
 import android.support.annotation.UiThread;
 import android.util.Log;
 import android.view.ActionMode;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
 
 import org.mozilla.gecko.util.ThreadUtils;
@@ -343,17 +344,18 @@ public class BasicSelectionActionDelegat
         }
         mSession = null;
         mSelection = null;
         mActions = null;
         mResponse = null;
         mActionMode = null;
     }
 
-    public void onGetContentRect(final ActionMode mode, final View view, final Rect outRect) {
+    public void onGetContentRect(final @Nullable ActionMode mode, final @Nullable View view,
+                                 final @NonNull Rect outRect) {
         ThreadUtils.assertOnUiThread();
         if (mSelection.clientRect == null) {
             return;
         }
         mSession.getClientToScreenMatrix(mTempMatrix);
         mTempMatrix.mapRect(mTempRect, mSelection.clientRect);
         mTempRect.roundOut(outRect);
     }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/CompositorController.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/CompositorController.java
@@ -5,29 +5,30 @@
 
 package org.mozilla.geckoview;
 
 import org.mozilla.gecko.annotation.RobocopTarget;
 import org.mozilla.gecko.util.ThreadUtils;
 
 import android.graphics.Color;
 import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
 import android.support.annotation.UiThread;
 
 import java.nio.IntBuffer;
 import java.util.ArrayList;
 import java.util.List;
 
 @UiThread
 public final class CompositorController {
     private final GeckoSession.Compositor mCompositor;
 
     public interface GetPixelsCallback {
         @UiThread
-        void onPixelsResult(int width, int height, IntBuffer pixels);
+        void onPixelsResult(int width, int height, @Nullable IntBuffer pixels);
     }
 
     private List<Runnable> mDrawCallbacks;
     private GetPixelsCallback mGetPixelsCallback;
     private int mDefaultClearColor = Color.WHITE;
     private Runnable mFirstPaintCallback;
 
     /* package */ CompositorController(final GeckoSession session) {
@@ -142,27 +143,27 @@ public final class CompositorController 
         }
     }
 
     /**
      * Get the current first paint callback.
      *
      * @return Current first paint callback or null if not set.
      */
-    public Runnable getFirstPaintCallback() {
+    public @Nullable Runnable getFirstPaintCallback() {
         ThreadUtils.assertOnUiThread();
         return mFirstPaintCallback;
     }
 
     /**
      * Set a callback to run when a document is first drawn.
      *
      * @param callback First paint callback.
      */
-    public void setFirstPaintCallback(final Runnable callback) {
+    public void setFirstPaintCallback(final @Nullable Runnable callback) {
         ThreadUtils.assertOnUiThread();
         mFirstPaintCallback = callback;
     }
 
     /* package */ void onFirstPaint() {
         if (mFirstPaintCallback != null) {
             mFirstPaintCallback.run();
         }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/CrashReporter.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/CrashReporter.java
@@ -2,16 +2,17 @@ package org.mozilla.geckoview;
 
 import org.mozilla.gecko.util.ProxySelector;
 
 import android.content.Context;
 import android.content.Intent;
 import android.os.Build;
 import android.os.Bundle;
 import android.support.annotation.AnyThread;
+import android.support.annotation.NonNull;
 import android.util.Log;
 
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -66,17 +67,19 @@ public class CrashReporter {
      * @param appName A human-readable app name.
      * @throws IOException This can be thrown if there was a networking error while sending the report.
      * @throws URISyntaxException This can be thrown if the crash server URI from the extra data was invalid.
      * @return A GeckoResult containing the crash ID as a String.
      * @see GeckoRuntimeSettings.Builder#crashHandler(Class)
      * @see GeckoRuntime#ACTION_CRASHED
      */
     @AnyThread
-    public static GeckoResult<String> sendCrashReport(Context context, Intent intent, String appName)
+    public static GeckoResult<String> sendCrashReport(@NonNull Context context,
+                                                      @NonNull Intent intent,
+                                                      @NonNull String appName)
             throws IOException, URISyntaxException {
         return sendCrashReport(context, intent.getExtras(), appName);
     }
 
     /**
      * Sends a crash report to the Mozilla  <a href="https://wiki.mozilla.org/Socorro">Socorro</a>
      * crash report server.
      * <br>
@@ -89,17 +92,19 @@ public class CrashReporter {
      * @param appName A human-readable app name.
      * @throws IOException This can be thrown if there was a networking error while sending the report.
      * @throws URISyntaxException This can be thrown if the crash server URI from the extra data was invalid.
      * @return A GeckoResult containing the crash ID as a String.
      * @see GeckoRuntimeSettings.Builder#crashHandler(Class)
      * @see GeckoRuntime#ACTION_CRASHED
      */
     @AnyThread
-    public static GeckoResult<String> sendCrashReport(Context context, Bundle intentExtras, String appName)
+    public static @NonNull GeckoResult<String> sendCrashReport(@NonNull Context context,
+                                                               @NonNull Bundle intentExtras,
+                                                               @NonNull String appName)
             throws IOException, URISyntaxException {
         final File dumpFile = new File(intentExtras.getString(GeckoRuntime.EXTRA_MINIDUMP_PATH));
         final File extrasFile = new File(intentExtras.getString(GeckoRuntime.EXTRA_EXTRAS_PATH));
         final boolean success = intentExtras.getBoolean(GeckoRuntime.EXTRA_MINIDUMP_SUCCESS, false);
 
         return sendCrashReport(context, dumpFile, extrasFile, success, appName);
     }
 
@@ -118,18 +123,22 @@ public class CrashReporter {
      * @param appName A human-readable app name.
      * @throws IOException This can be thrown if there was a networking error while sending the report.
      * @throws URISyntaxException This can be thrown if the crash server URI from the extra data was invalid.
      * @return A GeckoResult containing the crash ID as a String.
      * @see GeckoRuntimeSettings.Builder#crashHandler(Class)
      * @see GeckoRuntime#ACTION_CRASHED
      */
     @AnyThread
-    public static GeckoResult<String> sendCrashReport(Context context, File minidumpFile, File extrasFile,
-                                       boolean success, String appName) throws IOException, URISyntaxException {
+    public static @NonNull GeckoResult<String> sendCrashReport(@NonNull Context context,
+                                                               @NonNull File minidumpFile,
+                                                               @NonNull File extrasFile,
+                                                               boolean success,
+                                                               @NonNull String appName)
+            throws IOException, URISyntaxException {
         // Compute the minidump hash and generate the stack traces
         computeMinidumpHash(extrasFile, minidumpFile);
 
         // Extract the annotations from the .extra file
         HashMap<String, String> extrasMap = readStringsFromFile(extrasFile.getPath());
 
         return sendCrashReport(context, minidumpFile, extrasMap, success, appName);
     }
@@ -145,19 +154,22 @@ public class CrashReporter {
      * @param appName A human-readable app name.
      * @throws IOException This can be thrown if there was a networking error while sending the report.
      * @throws URISyntaxException This can be thrown if the crash server URI from the extra data was invalid.
      * @return A GeckoResult containing the crash ID as a String.
      * @see GeckoRuntimeSettings.Builder#crashHandler(Class)
      * @see GeckoRuntime#ACTION_CRASHED
      */
     @AnyThread
-    public static GeckoResult<String> sendCrashReport(Context context, File minidumpFile,
-                                       Map<String, String> extras, boolean success,
-                                       String appName) throws IOException, URISyntaxException {
+    public static @NonNull GeckoResult<String> sendCrashReport(@NonNull Context context,
+                                                               @NonNull File minidumpFile,
+                                                               @NonNull Map<String, String> extras,
+                                                               boolean success,
+                                                               @NonNull String appName)
+            throws IOException, URISyntaxException {
         Log.d(LOGTAG, "Sending crash report: " + minidumpFile.getPath());
 
         String spec = extras.get(SERVER_URL_KEY);
         if (spec == null) {
             return GeckoResult.fromException(new Exception("No server url present"));
         }
 
         extras.put(PRODUCT_NAME_KEY, appName);
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/DynamicToolbarAnimator.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/DynamicToolbarAnimator.java
@@ -4,16 +4,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.geckoview;
 
 import org.mozilla.gecko.util.ThreadUtils;
 
 import android.graphics.Bitmap;
 import android.support.annotation.AnyThread;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
 import android.support.annotation.UiThread;
 import android.util.Log;
 
 import java.util.EnumSet;
 import java.util.Set;
 
 @UiThread
 public final class DynamicToolbarAnimator {
@@ -33,17 +35,17 @@ public final class DynamicToolbarAnimato
 
         PinReason(final int aValue) {
             value = aValue;
         }
     }
 
     public interface ToolbarChromeProxy {
         @UiThread
-        public Bitmap getBitmapOfToolbarChrome();
+        public @Nullable Bitmap getBitmapOfToolbarChrome();
         @UiThread
         public boolean isToolbarChromeVisible();
         @UiThread
         public void toggleToolbarChrome(boolean aShow);
     }
 
     private final Set<PinReason> mPinFlags = EnumSet.noneOf(PinReason.class);
 
@@ -52,22 +54,22 @@ public final class DynamicToolbarAnimato
     private ToolbarChromeProxy mToolbarChromeProxy;
     private int mMaxToolbarHeight;
 
     /* package */ DynamicToolbarAnimator(final GeckoSession aTarget) {
         mTarget = aTarget;
         mCompositor = aTarget.mCompositor;
     }
 
-    public ToolbarChromeProxy getToolbarChromeProxy() {
+    public @Nullable ToolbarChromeProxy getToolbarChromeProxy() {
         ThreadUtils.assertOnUiThread();
         return mToolbarChromeProxy;
     }
 
-    public void setToolbarChromeProxy(ToolbarChromeProxy aToolbarChromeProxy) {
+    public void setToolbarChromeProxy(@Nullable ToolbarChromeProxy aToolbarChromeProxy) {
         ThreadUtils.assertOnUiThread();
         mToolbarChromeProxy = aToolbarChromeProxy;
     }
 
     public void setMaxToolbarHeight(int maxToolbarHeight) {
         ThreadUtils.assertOnUiThread();
 
         mMaxToolbarHeight = maxToolbarHeight;
@@ -93,23 +95,23 @@ public final class DynamicToolbarAnimato
      * @return True if the toolbar is pinned.
      */
     public boolean isPinned() {
         ThreadUtils.assertOnUiThread();
 
         return !mPinFlags.isEmpty();
     }
 
-    public boolean isPinnedBy(PinReason reason) {
+    public boolean isPinnedBy(@NonNull PinReason reason) {
         ThreadUtils.assertOnUiThread();
 
         return mPinFlags.contains(reason);
     }
 
-    public void setPinned(final boolean pinned, final PinReason reason) {
+    public void setPinned(final boolean pinned, final @NonNull PinReason reason) {
         ThreadUtils.assertOnUiThread();
 
         if (pinned != mPinFlags.contains(reason) && mCompositor.isReady()) {
             mCompositor.setPinned(pinned, reason.value);
         }
 
         if (pinned) {
             mPinFlags.add(reason);
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoDisplay.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoDisplay.java
@@ -1,16 +1,17 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
  * vim: ts=4 sw=4 expandtab:
  * 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.geckoview;
 
+import android.support.annotation.NonNull;
 import android.support.annotation.UiThread;
 import android.view.Surface;
 
 import org.mozilla.gecko.util.ThreadUtils;
 
 /**
  * Applications use a GeckoDisplay instance to provide {@link GeckoSession} with a {@link Surface} for
  * displaying content. To ensure drawing only happens on a valid {@link Surface}, {@link GeckoSession}
@@ -31,17 +32,17 @@ public class GeckoDisplay {
      * called on the application main thread. GeckoSession may block this call to ensure
      * the Surface is valid while resuming drawing.
      *
      * @param surface The new Surface.
      * @param width New width of the Surface. Can not be negative.
      * @param height New height of the Surface. Can not be negative.
      */
     @UiThread
-    public void surfaceChanged(Surface surface, int width, int height) {
+    public void surfaceChanged(@NonNull Surface surface, int width, int height) {
         surfaceChanged(surface, 0, 0, width, height);
     }
 
     /**
      * Sets a surface for the compositor render a surface.
      *
      * Required call. The display's Surface has been created or changed. Must be
      * called on the application main thread. GeckoSession may block this call to ensure
@@ -51,17 +52,17 @@ public class GeckoDisplay {
      * @param surface The new Surface.
      * @param left The compositor origin offset in the X axis. Can not be negative.
      * @param top The compositor origin offset in the Y axis. Can not be negative.
      * @param width New width of the Surface. Can not be negative.
      * @param height New height of the Surface. Can not be negative.
      * @throws IllegalArgumentException if left or top are negative.
      */
     @UiThread
-    public void surfaceChanged(Surface surface, int left, int top, int width, int height) {
+    public void surfaceChanged(@NonNull Surface surface, int left, int top, int width, int height) {
         ThreadUtils.assertOnUiThread();
 
         if ((left < 0) || (top < 0)) {
             throw new IllegalArgumentException("Parameters can not be negative.");
         }
 
         if (session.getDisplay() == this) {
             session.onSurfaceChanged(surface, left, top, width, height);
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoResponse.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoResponse.java
@@ -2,21 +2,22 @@
  * vim: ts=4 sw=4 expandtab:
  * 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.geckoview;
 
 import android.support.annotation.AnyThread;
+import android.support.annotation.Nullable;
 
 /**
  * This is used to receive async responses from delegate methods.
  */
 public interface GeckoResponse<T> {
     /**
      * Called when async processing has finished.
      *
      * @param value The value contained in the response.
      */
     @AnyThread
-    void respond(T value);
+    void respond(@Nullable T value);
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoResult.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoResult.java
@@ -447,17 +447,17 @@ public class GeckoResult<T> {
      * You must not call this method if the current thread has a {@link Looper} due to
      * the possibility of a deadlock. If this occurs, {@link IllegalStateException}
      * is thrown.
      *
      * @return The value of this result.
      * @throws Throwable The {@link Throwable} contained in this result, if any.
      * @throws IllegalThreadStateException if this method is called on a thread that has a {@link Looper}.
      */
-    public synchronized T poll() throws Throwable {
+    public synchronized @Nullable T poll() throws Throwable {
         if (Looper.myLooper() != null) {
             throw new IllegalThreadStateException("Cannot poll indefinitely from thread with Looper");
         }
 
         return poll(Long.MAX_VALUE);
     }
 
     /**
@@ -472,17 +472,17 @@ public class GeckoResult<T> {
      *
      * @param timeoutMillis Number of milliseconds to wait for the result
      *                      to complete.
      * @return The value of this result.
      * @throws Throwable The {@link Throwable} contained in this result, if any.
      * @throws TimeoutException if we wait more than timeoutMillis before the result
      *                          is completed.
      */
-    public synchronized T poll(long timeoutMillis) throws Throwable {
+    public synchronized @Nullable T poll(long timeoutMillis) throws Throwable {
         final long start = SystemClock.uptimeMillis();
         long remaining = timeoutMillis;
         while (!mComplete && remaining > 0) {
             try {
                 wait(remaining);
             } catch (InterruptedException e) {
             }
 
@@ -503,17 +503,17 @@ public class GeckoResult<T> {
     /**
      * Complete the result with the specified value. IllegalStateException is thrown
      * if the result is already complete.
      *
      * @param value The value used to complete the result.
      * @throws IllegalStateException If the result is already completed.
      */
     @WrapForJNI
-    public synchronized void complete(final T value) {
+    public synchronized void complete(final @Nullable T value) {
         if (mComplete) {
             throw new IllegalStateException("result is already complete");
         }
 
         mValue = value;
         mComplete = true;
 
         dispatchLocked();
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntime.java
@@ -312,33 +312,33 @@ public final class GeckoRuntime implemen
     }
 
     /**
      * Set a delegate for receiving callbacks relevant to to this GeckoRuntime.
      *
      * @param delegate an implementation of {@link GeckoRuntime.Delegate}.
      */
     @UiThread
-    public void setDelegate(final Delegate delegate) {
+    public void setDelegate(final @Nullable Delegate delegate) {
         ThreadUtils.assertOnUiThread();
         mDelegate = delegate;
     }
 
     /**
      * Returns the current delegate, if any.
      *
      * @return an instance of {@link GeckoRuntime.Delegate} or null if no delegate has been set.
      */
     @UiThread
     public @Nullable Delegate getDelegate() {
         return mDelegate;
     }
 
     @AnyThread
-    public GeckoRuntimeSettings getSettings() {
+    public @Nullable GeckoRuntimeSettings getSettings() {
         return mSettings;
     }
 
     /* package */ void setPref(final String name, final Object value,
                                boolean override) {
         if (override || !GeckoAppShell.isFennec()) {
             // Override pref on Fennec only when requested to prevent
             // overriding of persistent prefs.
@@ -347,34 +347,34 @@ public final class GeckoRuntime implemen
     }
 
     /**
      * Return the telemetry object for this runtime.
      *
      * @return The telemetry object.
      */
     @UiThread
-    public RuntimeTelemetry getTelemetry() {
+    public @NonNull RuntimeTelemetry getTelemetry() {
         ThreadUtils.assertOnUiThread();
 
         if (mTelemetry == null) {
             mTelemetry = new RuntimeTelemetry(this);
         }
         return mTelemetry;
 
     }
 
     /**
      * Get the profile directory for this runtime. This is where Gecko stores
      * internal data.
      *
      * @return Profile directory
      */
     @UiThread
-    public File getProfileDir() {
+    public @Nullable File getProfileDir() {
         ThreadUtils.assertOnUiThread();
         return GeckoThread.getActiveProfile().getDir();
     }
 
     /**
      * Notify Gecko that the screen orientation has changed.
      */
     @UiThread
@@ -403,17 +403,17 @@ public final class GeckoRuntime implemen
     @Override // Parcelable
     @AnyThread
     public void writeToParcel(Parcel out, int flags) {
         out.writeParcelable(mSettings, flags);
     }
 
     // AIDL code may call readFromParcel even though it's not part of Parcelable.
     @AnyThread
-    public void readFromParcel(final Parcel source) {
+    public void readFromParcel(final @NonNull Parcel source) {
         mSettings = source.readParcelable(getClass().getClassLoader());
     }
 
     public static final Parcelable.Creator<GeckoRuntime> CREATOR
         = new Parcelable.Creator<GeckoRuntime>() {
         @Override
         @AnyThread
         public GeckoRuntime createFromParcel(final Parcel in) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
@@ -496,26 +496,26 @@ public final class GeckoRuntimeSettings 
         return mUseContentProcess;
     }
 
     /**
      * Get the custom Gecko process arguments.
      *
      * @return The Gecko process arguments.
      */
-    public String[] getArguments() {
+    public @NonNull String[] getArguments() {
         return mArgs;
     }
 
     /**
      * Get the custom Gecko intent extras.
      *
      * @return The Gecko intent extras.
      */
-    public Bundle getExtras() {
+    public @NonNull Bundle getExtras() {
         return mExtras;
     }
 
     /**
      * Get whether JavaScript support is enabled.
      *
      * @return Whether JavaScript support is enabled.
      */
@@ -588,67 +588,67 @@ public final class GeckoRuntimeSettings 
      */
     public boolean getUseMaxScreenDepth() { return mUseMaxScreenDepth; }
 
     /**
      * Gets the display density override value.
      *
      * @return Returns a positive number. Will return null if not set.
      */
-    public Float getDisplayDensityOverride() {
+    public @Nullable Float getDisplayDensityOverride() {
         if (mDisplayDensityOverride > 0.0f) {
             return mDisplayDensityOverride;
         }
         return null;
     }
 
     /**
      * Gets the display DPI override value.
      *
      * @return Returns a positive number. Will return null if not set.
      */
-    public Integer getDisplayDpiOverride() {
+    public @Nullable Integer getDisplayDpiOverride() {
         if (mDisplayDpiOverride > 0) {
             return mDisplayDpiOverride;
         }
         return null;
     }
 
-    public Class<? extends Service> getCrashHandler() {
+    public @Nullable Class<? extends Service> getCrashHandler() {
         return mCrashHandler;
     }
 
     /**
      * Gets the screen size  override value.
      *
      * @return Returns a Rect containing the dimensions to use for the window size.
      * Will return null if not set.
      */
-    public Rect getScreenSizeOverride() {
+    public @Nullable Rect getScreenSizeOverride() {
         if ((mScreenWidthOverride > 0) && (mScreenHeightOverride > 0)) {
             return new Rect(0, 0, mScreenWidthOverride, mScreenHeightOverride);
         }
         return null;
     }
 
     /**
      * Gets the list of requested locales.
      *
      * @return A list of locale codes in Gecko format ("en" or "en-US").
      */
-    public String[] getLocales() {
+    public @Nullable String[] getLocales() {
         return mRequestedLocales;
     }
 
     /**
      * Set the locale.
      *
      * @param requestedLocales An ordered list of locales in Gecko format ("en-US").
      */
-    public void setLocales(String[] requestedLocales) {
+    public void setLocales(@Nullable String[] requestedLocales) {
         mRequestedLocales = requestedLocales;
         flushLocales();
     }
 
     private void flushLocales() {
         if (mRequestedLocales == null) {
             return;
         }
@@ -872,17 +872,17 @@ public final class GeckoRuntimeSettings 
         out.writeInt(mDisplayDpiOverride);
         out.writeInt(mScreenWidthOverride);
         out.writeInt(mScreenHeightOverride);
         out.writeString(mCrashHandler != null ? mCrashHandler.getName() : null);
         out.writeStringArray(mRequestedLocales);
     }
 
     // AIDL code may call readFromParcel even though it's not part of Parcelable.
-    public void readFromParcel(final Parcel source) {
+    public void readFromParcel(final @NonNull Parcel source) {
         mUseContentProcess = ParcelableUtils.readBoolean(source);
         mArgs = source.createStringArray();
         mExtras.readFromParcel(source);
 
         for (final Pref<?> pref : mPrefs) {
             // We know this is safe.
             @SuppressWarnings("unchecked")
             final Pref<Object> uncheckedPref = (Pref<Object>) pref;
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
@@ -891,27 +891,27 @@ public class GeckoSession implements Par
         return result;
     }
 
     /**
      * Get the current prompt delegate for this GeckoSession.
      * @return PromptDelegate instance or null if using default delegate.
      */
     @UiThread
-    public PermissionDelegate getPermissionDelegate() {
+    public @Nullable PermissionDelegate getPermissionDelegate() {
         ThreadUtils.assertOnUiThread();
         return mPermissionHandler.getDelegate();
     }
 
     /**
      * Set the current permission delegate for this GeckoSession.
      * @param delegate PermissionDelegate instance or null to use the default delegate.
      */
     @UiThread
-    public void setPermissionDelegate(final PermissionDelegate delegate) {
+    public void setPermissionDelegate(final @Nullable PermissionDelegate delegate) {
         ThreadUtils.assertOnUiThread();
         mPermissionHandler.setDelegate(delegate, this);
     }
 
     private PromptDelegate mPromptDelegate;
 
     private final Listener mListener = new Listener();
 
@@ -1164,17 +1164,17 @@ public class GeckoSession implements Par
     public void writeToParcel(Parcel out, int flags) {
         out.writeStrongInterface(mWindow);
         out.writeParcelable(mSettings, flags);
         out.writeString(mId);
     }
 
     // AIDL code may call readFromParcel even though it's not part of Parcelable.
     @AnyThread
-    public void readFromParcel(final Parcel source) {
+    public void readFromParcel(final @NonNull Parcel source) {
         final IBinder binder = source.readStrongBinder();
         final IInterface ifce = (binder != null) ?
                 binder.queryLocalInterface(Window.class.getName()) : null;
         final Window window = (ifce instanceof Window) ? (Window) ifce : null;
         final GeckoSessionSettings settings =
                 source.readParcelable(getClass().getClassLoader());
         final String id = source.readString();
         transferFrom(window, settings, id);
@@ -1649,17 +1649,17 @@ public class GeckoSession implements Par
     }
 
     /**
      * Get the SessionFinder instance for this session, to perform find-in-page operations.
      *
      * @return SessionFinder instance.
      */
     @AnyThread
-    public SessionFinder getFinder() {
+    public @NonNull SessionFinder getFinder() {
         if (mFinder == null) {
             mFinder = new SessionFinder(getEventDispatcher());
         }
         return mFinder;
     }
 
     /**
      * Set this GeckoSession as active or inactive, which represents if the session is currently
@@ -1722,17 +1722,17 @@ public class GeckoSession implements Par
         }
 
         @Override // Parcelable
         public void writeToParcel(final Parcel dest, final int flags) {
             dest.writeString(mState);
         }
 
         // AIDL code may call readFromParcel even though it's not part of Parcelable.
-        public void readFromParcel(final Parcel source) {
+        public void readFromParcel(final @NonNull Parcel source) {
             mState = source.readString();
         }
 
         public static final Parcelable.Creator<SessionState> CREATOR =
                 new Parcelable.Creator<SessionState>() {
             @Override
             public SessionState createFromParcel(final Parcel source) {
                 return new SessionState(source.readString());
@@ -1768,17 +1768,17 @@ public class GeckoSession implements Par
     /**
      * Restore a saved state to this GeckoSession; only data that is saved (history, scroll
      * position, zoom, and form data) will be restored. These will overwrite the corresponding
      * state of this GeckoSession.
      *
      * @param state A saved session state; this should originate from GeckoSession.saveState().
      */
     @AnyThread
-    public void restoreState(final SessionState state) {
+    public void restoreState(final @NonNull SessionState state) {
         final GeckoBundle msg = new GeckoBundle(1);
         msg.putString("state", state.toString());
         mEventDispatcher.dispatch("GeckoView:RestoreState", msg);
     }
 
     // This is the GeckoDisplay acquired via acquireDisplay(), if any.
     private GeckoDisplay mDisplay;
     /* package */ GeckoDisplay getDisplay() {
@@ -1820,17 +1820,17 @@ public class GeckoSession implements Par
         if (display != mDisplay) {
             throw new IllegalArgumentException("Display not attached");
         }
 
         mDisplay = null;
     }
 
     @AnyThread
-    public GeckoSessionSettings getSettings() {
+    public @NonNull GeckoSessionSettings getSettings() {
         return mSettings;
     }
 
     /**
     * Exits fullscreen mode
     */
     @AnyThread
     public void exitFullScreen() {
@@ -1838,86 +1838,86 @@ public class GeckoSession implements Par
     }
 
     /**
     * Set the content callback handler.
     * This will replace the current handler.
     * @param delegate An implementation of ContentDelegate.
     */
     @UiThread
-    public void setContentDelegate(ContentDelegate delegate) {
+    public void setContentDelegate(@Nullable ContentDelegate delegate) {
         ThreadUtils.assertOnUiThread();
         mContentHandler.setDelegate(delegate, this);
     }
 
     /**
     * Get the content callback handler.
     * @return The current content callback handler.
     */
     @UiThread
-    public ContentDelegate getContentDelegate() {
+    public @Nullable ContentDelegate getContentDelegate() {
         ThreadUtils.assertOnUiThread();
         return mContentHandler.getDelegate();
     }
 
     /**
     * Set the progress callback handler.
     * This will replace the current handler.
     * @param delegate An implementation of ProgressDelegate.
     */
     @UiThread
-    public void setProgressDelegate(ProgressDelegate delegate) {
+    public void setProgressDelegate(@Nullable ProgressDelegate delegate) {
         ThreadUtils.assertOnUiThread();
         mProgressHandler.setDelegate(delegate, this);
     }
 
     /**
     * Get the progress callback handler.
     * @return The current progress callback handler.
     */
     @UiThread
-    public ProgressDelegate getProgressDelegate() {
+    public @Nullable ProgressDelegate getProgressDelegate() {
         ThreadUtils.assertOnUiThread();
         return mProgressHandler.getDelegate();
     }
 
     /**
     * Set the navigation callback handler.
     * This will replace the current handler.
     * @param delegate An implementation of NavigationDelegate.
     */
     @UiThread
-    public void setNavigationDelegate(NavigationDelegate delegate) {
+    public void setNavigationDelegate(@Nullable NavigationDelegate delegate) {
         ThreadUtils.assertOnUiThread();
         mNavigationHandler.setDelegate(delegate, this);
     }
 
     /**
     * Get the navigation callback handler.
     * @return The current navigation callback handler.
     */
     @UiThread
-    public NavigationDelegate getNavigationDelegate() {
+    public @Nullable NavigationDelegate getNavigationDelegate() {
         ThreadUtils.assertOnUiThread();
         return mNavigationHandler.getDelegate();
     }
 
     /**
     * Set the content scroll callback handler.
     * This will replace the current handler.
     * @param delegate An implementation of ScrollDelegate.
     */
     @UiThread
-    public void setScrollDelegate(ScrollDelegate delegate) {
+    public void setScrollDelegate(@Nullable ScrollDelegate delegate) {
         ThreadUtils.assertOnUiThread();
         mScrollHandler.setDelegate(delegate, this);
     }
 
     @UiThread
-    public ScrollDelegate getScrollDelegate() {
+    public @Nullable ScrollDelegate getScrollDelegate() {
         ThreadUtils.assertOnUiThread();
         return mScrollHandler.getDelegate();
     }
 
     /**
      * Set the history tracking delegate for this session, replacing the
      * current delegate if one is set.
      *
@@ -1935,44 +1935,44 @@ public class GeckoSession implements Par
     }
 
     /**
     * Set the tracking protection callback handler.
     * This will replace the current handler.
     * @param delegate An implementation of TrackingProtectionDelegate.
     */
     @AnyThread
-    public void setTrackingProtectionDelegate(TrackingProtectionDelegate delegate) {
+    public void setTrackingProtectionDelegate(@Nullable TrackingProtectionDelegate delegate) {
         mTrackingProtectionHandler.setDelegate(delegate, this);
     }
 
     /**
     * Get the tracking protection callback handler.
     * @return The current tracking protection callback handler.
     */
     @AnyThread
-    public TrackingProtectionDelegate getTrackingProtectionDelegate() {
+    public @Nullable TrackingProtectionDelegate getTrackingProtectionDelegate() {
         return mTrackingProtectionHandler.getDelegate();
     }
 
     /**
      * Set the current prompt delegate for this GeckoSession.
      * @param delegate PromptDelegate instance or null to use the built-in delegate.
      */
     @AnyThread
-    public void setPromptDelegate(PromptDelegate delegate) {
+    public void setPromptDelegate(@Nullable PromptDelegate delegate) {
         mPromptDelegate = delegate;
     }
 
     /**
      * Get the current prompt delegate for this GeckoSession.
      * @return PromptDelegate instance or null if using built-in delegate.
      */
     @AnyThread
-    public PromptDelegate getPromptDelegate() {
+    public @Nullable PromptDelegate getPromptDelegate() {
         return mPromptDelegate;
     }
 
     /**
      * Set the current selection action delegate for this GeckoSession.
      *
      * @param delegate SelectionActionDelegate instance or null to unset.
      */
@@ -2422,17 +2422,17 @@ public class GeckoSession implements Par
     }
 
     /* package */ boolean shouldPinOnScreen() {
         ThreadUtils.assertOnUiThread();
         return mShouldPinOnScreen;
     }
 
     @AnyThread
-    public EventDispatcher getEventDispatcher() {
+    public @NonNull EventDispatcher getEventDispatcher() {
         return mEventDispatcher;
     }
 
     public interface ProgressDelegate {
         /**
          * Class representing security information for a site.
          */
         public class SecurityInformation {
@@ -2543,41 +2543,42 @@ public class GeckoSession implements Par
         }
 
         /**
         * A View has started loading content from the network.
         * @param session GeckoSession that initiated the callback.
         * @param url The resource being loaded.
         */
         @UiThread
-        void onPageStart(GeckoSession session, String url);
+        void onPageStart(@NonNull GeckoSession session, @NonNull String url);
 
         /**
         * A View has finished loading content from the network.
         * @param session GeckoSession that initiated the callback.
         * @param success Whether the page loaded successfully or an error occurred.
         */
         @UiThread
-        void onPageStop(GeckoSession session, boolean success);
+        void onPageStop(@NonNull GeckoSession session, boolean success);
 
         /**
          * Page loading has progressed.
          * @param session GeckoSession that initiated the callback.
          * @param progress Current page load progress value [0, 100].
          */
         @UiThread
-        void onProgressChange(GeckoSession session, int progress);
+        void onProgressChange(@NonNull GeckoSession session, int progress);
 
         /**
         * The security status has been updated.
         * @param session GeckoSession that initiated the callback.
         * @param securityInfo The new security information.
         */
         @UiThread
-        void onSecurityChange(GeckoSession session, SecurityInformation securityInfo);
+        void onSecurityChange(@NonNull GeckoSession session,
+                              @NonNull SecurityInformation securityInfo);
     }
 
     /**
      * WebResponseInfo contains information about a single web response.
      */
     @AnyThread
     static public class WebResponseInfo {
         /**
@@ -2626,43 +2627,43 @@ public class GeckoSession implements Par
     public interface ContentDelegate {
         /**
         * A page title was discovered in the content or updated after the content
         * loaded.
         * @param session The GeckoSession that initiated the callback.
         * @param title The title sent from the content.
         */
         @UiThread
-        void onTitleChange(GeckoSession session, String title);
+        void onTitleChange(@NonNull GeckoSession session, @Nullable String title);
 
         /**
         * A page has requested focus. Note that window.focus() in content will not result
         * in this being called.
         * @param session The GeckoSession that initiated the callback.
         */
         @UiThread
-        void onFocusRequest(GeckoSession session);
+        void onFocusRequest(@NonNull GeckoSession session);
 
         /**
         * A page has requested to close
         * @param session The GeckoSession that initiated the callback.
         */
         @UiThread
-        void onCloseRequest(GeckoSession session);
+        void onCloseRequest(@NonNull GeckoSession session);
 
         /**
          * A page has entered or exited full screen mode. Typically, the implementation
          * would set the Activity containing the GeckoSession to full screen when the page is
          * in full screen mode.
          *
          * @param session The GeckoSession that initiated the callback.
          * @param fullScreen True if the page is in full screen mode.
          */
         @UiThread
-        void onFullScreen(GeckoSession session, boolean fullScreen);
+        void onFullScreen(@NonNull GeckoSession session, boolean fullScreen);
 
         /**
          * Element details for onContextMenu callbacks.
          */
         public static class ContextElement {
             @Retention(RetentionPolicy.SOURCE)
             @IntDef({TYPE_NONE, TYPE_IMAGE, TYPE_VIDEO, TYPE_AUDIO})
             /* package */ @interface Type {}
@@ -2741,38 +2742,38 @@ public class GeckoSession implements Par
         /**
          * This is fired when there is a response that cannot be handled
          * by Gecko (e.g., a download).
          *
          * @param session the GeckoSession that received the external response.
          * @param response the WebResponseInfo for the external response
          */
         @UiThread
-        void onExternalResponse(GeckoSession session, WebResponseInfo response);
+        void onExternalResponse(@NonNull GeckoSession session, @NonNull WebResponseInfo response);
 
         /**
          * The content process hosting this GeckoSession has crashed. The
          * GeckoSession is now closed and unusable. You may call
          * {@link #open(GeckoRuntime)} to recover the session, but no state
          * is preserved. Most applications will want to call
          * {@link #loadUri(Uri)} or {@link #restoreState(SessionState)} at this point.
          *
          * @param session The GeckoSession that crashed.
          */
         @UiThread
-        void onCrash(GeckoSession session);
+        void onCrash(@NonNull GeckoSession session);
 
         /**
          * Notification that the first content composition has occurred.
          * This callback is invoked for the first content composite after either
          * a start or a restart of the compositor.
          * @param session The GeckoSession that had a first paint event.
          */
         @UiThread
-        void onFirstComposite(GeckoSession session);
+        void onFirstComposite(@NonNull GeckoSession session);
     }
 
     public interface SelectionActionDelegate {
         @Retention(RetentionPolicy.SOURCE)
         @IntDef(flag = true, value = {FLAG_IS_COLLAPSED,
                                       FLAG_IS_EDITABLE})
         /* package */ @interface Flag {}
 
@@ -2915,18 +2916,18 @@ public class GeckoSession implements Par
          * @param selection Current selection attributes.
          * @param actions Array of built-in actions available; possible values
          * come from the {@link #ACTION_HIDE ACTION_*} constants.
          * @param response Callback object for performing built-in actions. For example,
          * {@code response.respond(actions[0])} performs the first action. May be used
          * multiple times to perform multiple actions at once.
          */
         @UiThread
-        void onShowActionRequest(GeckoSession session, Selection selection,
-                                 @Action String[] actions, GeckoResponse<String> response);
+        void onShowActionRequest(@NonNull GeckoSession session, @NonNull Selection selection,
+                                 @Action String[] actions, @NonNull GeckoResponse<String> response);
 
         @Retention(RetentionPolicy.SOURCE)
         @IntDef({HIDE_REASON_NO_SELECTION,
                  HIDE_REASON_INVISIBLE_SELECTION,
                  HIDE_REASON_ACTIVE_SELECTION,
                  HIDE_REASON_ACTIVE_SCROLL})
         /* package */ @interface HideReason {}
 
@@ -2957,43 +2958,43 @@ public class GeckoSession implements Par
          * Previous actions are no longer available due to the user interacting with the
          * page. Applications typically hide the action toolbar in response.
          *
          * @param session The GeckoSession that initiated the callback.
          * @param reason The reason that actions are no longer available, as one of the
          * {@link #HIDE_REASON_NO_SELECTION HIDE_REASON_*} constants.
          */
         @UiThread
-        void onHideAction(GeckoSession session, @HideReason int reason);
+        void onHideAction(@NonNull GeckoSession session, @HideReason int reason);
     }
 
     public interface NavigationDelegate {
         /**
         * A view has started loading content from the network.
         * @param session The GeckoSession that initiated the callback.
         * @param url The resource being loaded.
         */
         @UiThread
-        void onLocationChange(GeckoSession session, String url);
+        void onLocationChange(@NonNull GeckoSession session, @Nullable String url);
 
         /**
         * The view's ability to go back has changed.
         * @param session The GeckoSession that initiated the callback.
         * @param canGoBack The new value for the ability.
         */
         @UiThread
-        void onCanGoBack(GeckoSession session, boolean canGoBack);
+        void onCanGoBack(@NonNull GeckoSession session, boolean canGoBack);
 
         /**
         * The view's ability to go forward has changed.
         * @param session The GeckoSession that initiated the callback.
         * @param canGoForward The new value for the ability.
         */
         @UiThread
-        void onCanGoForward(GeckoSession session, boolean canGoForward);
+        void onCanGoForward(@NonNull GeckoSession session, boolean canGoForward);
 
         @Retention(RetentionPolicy.SOURCE)
         @IntDef({TARGET_WINDOW_NONE, TARGET_WINDOW_CURRENT, TARGET_WINDOW_NEW})
         /* package */ @interface TargetWindow {}
         public static final int TARGET_WINDOW_NONE = 0;
         public static final int TARGET_WINDOW_CURRENT = 1;
         public static final int TARGET_WINDOW_NEW = 2;
 
@@ -3097,17 +3098,19 @@ public class GeckoSession implements Par
 
         /**
          * @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
-        GeckoResult<String> onLoadError(GeckoSession session, String uri, WebRequestError error);
+        @Nullable GeckoResult<String> onLoadError(@NonNull GeckoSession session,
+                                                  @Nullable String uri,
+                                                  @NonNull WebRequestError error);
     }
 
     /**
      * GeckoSession applications implement this interface to handle prompts triggered by
      * content in the GeckoSession, such as alerts, authentication dialogs, and select list
      * pickers.
      **/
     public interface PromptDelegate {
@@ -3137,17 +3140,17 @@ public class GeckoSession implements Par
             boolean hasCheckbox();
 
             /**
              * Return the message label for the optional checkbox.
              *
              * @return Checkbox message or null if none.
              */
             @UiThread
-            String getCheckboxMessage();
+            @Nullable String getCheckboxMessage();
 
             /**
              * Return the initial value for the optional checkbox.
              *
              * @return Initial checkbox value.
              */
             @UiThread
             boolean getCheckboxValue();
@@ -3165,17 +3168,18 @@ public class GeckoSession implements Par
          * Display a simple message prompt.
          *
          * @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
-        void onAlert(GeckoSession session, String title, String msg, AlertCallback callback);
+        void onAlert(@NonNull GeckoSession session, @Nullable String title, @Nullable String msg,
+                     @NonNull AlertCallback callback);
 
         /**
          * Callback interface for notifying the result of a button prompt.
          */
         interface ButtonCallback extends AlertCallback {
             /**
              * Called by the prompt implementation when the button prompt is dismissed by
              * the user pressing one of the buttons.
@@ -3199,69 +3203,71 @@ public class GeckoSession implements Par
          * @param btnMsg Array of 3 elements indicating labels for the individual buttons.
          *               btnMsg[BUTTON_TYPE_POSITIVE] is the label for the "positive" button.
          *               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
-        void onButtonPrompt(GeckoSession session, String title, String msg,
-                             String[] btnMsg, ButtonCallback callback);
+        void onButtonPrompt(@NonNull GeckoSession session, @Nullable String title,
+                            @Nullable String msg, @Nullable String[] btnMsg,
+                            @NonNull ButtonCallback callback);
 
         /**
          * Callback interface for notifying the result of prompts that have text results,
          * including color and date/time pickers.
          */
         interface TextCallback extends AlertCallback {
             /**
              * Called by the prompt implementation when the text prompt is confirmed by
              * the user, for example by pressing the "OK" button.
              *
              * @param text Text result.
              */
             @UiThread
-            void confirm(String text);
+            void confirm(@Nullable String text);
         }
 
         /**
          * Display a prompt for inputting text.
          *
          * @param session GeckoSession that triggered the prompt
          * @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
-        void onTextPrompt(GeckoSession session, String title, String msg,
-                           String value, TextCallback callback);
+        void onTextPrompt(@NonNull GeckoSession session, @Nullable String title,
+                          @Nullable String msg, @Nullable String value,
+                          @NonNull TextCallback callback);
 
         /**
          * Callback interface for notifying the result of authentication prompts.
          */
         interface AuthCallback extends AlertCallback {
             /**
              * Called by the prompt implementation when a password-only prompt is
              * confirmed by the user.
              *
              * @param password Entered password.
              */
             @UiThread
-            void confirm(String password);
+            void confirm(@Nullable String password);
 
             /**
              * Called by the prompt implementation when a username/password prompt is
              * confirmed by the user.
              *
              * @param username Entered username.
              * @param password Entered password.
              */
             @UiThread
-            void confirm(String username, String password);
+            void confirm(@NonNull String username, @NonNull String password);
         }
 
         class AuthOptions {
             @Retention(RetentionPolicy.SOURCE)
             @IntDef(flag = true,
                     value = {AUTH_FLAG_HOST, AUTH_FLAG_PROXY,
                              AUTH_FLAG_ONLY_PASSWORD, AUTH_FLAG_PREVIOUS_FAILED,
                              AUTH_FLAG_CROSS_ORIGIN_SUB_RESOURCE})
@@ -3355,18 +3361,19 @@ 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 options AuthOptions containing options for the prompt
          * @param callback Callback interface.
          */
         @UiThread
-        void onAuthPrompt(GeckoSession session, String title, String msg,
-                           AuthOptions options, AuthCallback callback);
+        void onAuthPrompt(@NonNull GeckoSession session, @Nullable String title,
+                          @Nullable String msg, @NonNull AuthOptions options,
+                          @NonNull AuthCallback callback);
 
         class Choice {
             @Retention(RetentionPolicy.SOURCE)
             @IntDef({CHOICE_TYPE_MENU, CHOICE_TYPE_SINGLE, CHOICE_TYPE_MULTIPLE})
             /* package */ @interface ChoiceType {}
 
             /**
              * Display choices in a menu that dismisses as soon as an item is chosen.
@@ -3461,76 +3468,76 @@ public class GeckoSession implements Par
         interface ChoiceCallback extends AlertCallback {
             /**
              * Called by the prompt implementation when the menu or single-choice list is
              * dismissed by the user.
              *
              * @param id ID of the selected item.
              */
             @UiThread
-            void confirm(String id);
+            void confirm(@Nullable String id);
 
             /**
              * Called by the prompt implementation when the multiple-choice list is
              * dismissed by the user.
              *
              * @param ids IDs of the selected items.
              */
             @UiThread
-            void confirm(String[] ids);
+            void confirm(@NonNull String[] ids);
 
             /**
              * Called by the prompt implementation when the menu or single-choice list is
              * dismissed by the user.
              *
              * @param item Choice representing the selected item; must be an original
              *             Choice object that was passed to the implementation.
              */
             @UiThread
-            void confirm(Choice item);
+            void confirm(@NonNull Choice item);
 
             /**
              * Called by the prompt implementation when the multiple-choice list is
              * dismissed by the user.
              *
              * @param items Choice array representing the selected items; must be original
              *              Choice objects that were passed to the implementation.
              */
             @UiThread
-            void confirm(Choice[] items);
+            void confirm(@Nullable Choice[] items);
         }
 
 
         /**
          * Display a menu prompt or list prompt.
          *
          * @param session GeckoSession that triggered the prompt
          * @param title Title for the prompt dialog, or null for no title.
          * @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
-        void onChoicePrompt(GeckoSession session, String title, String msg,
-                            @Choice.ChoiceType int type, Choice[] choices,
-                            ChoiceCallback callback);
+        void onChoicePrompt(@NonNull GeckoSession session, @Nullable String title,
+                            @Nullable String msg, @Choice.ChoiceType int type,
+                            @NonNull Choice[] choices, @NonNull ChoiceCallback callback);
 
         /**
          * 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
-        void onColorPrompt(GeckoSession session, String title, String value,
-                            TextCallback callback);
+        void onColorPrompt(@NonNull GeckoSession session, @Nullable String title,
+                           @Nullable String value, @NonNull TextCallback callback);
 
         @Retention(RetentionPolicy.SOURCE)
         @IntDef({DATETIME_TYPE_DATE, DATETIME_TYPE_MONTH, DATETIME_TYPE_WEEK,
                  DATETIME_TYPE_TIME, DATETIME_TYPE_DATETIME_LOCAL})
         /* package */ @interface DatetimeType {}
 
         /**
          * Prompt for year, month, and day.
@@ -3565,43 +3572,43 @@ public class GeckoSession implements Par
          * @param type One of DATETIME_TYPE_* indicating the type of prompt.
          * @param value Initial date/time value in HTML date/time format.
          * @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
-        void onDateTimePrompt(GeckoSession session, String title,
-                              @DatetimeType int type, String value, String min,
-                              String max, TextCallback callback);
+        void onDateTimePrompt(@NonNull GeckoSession session, @Nullable String title,
+                              @DatetimeType int type, @Nullable String value, @Nullable String min,
+                              @Nullable String max, @NonNull TextCallback callback);
 
         /**
          * Callback interface for notifying the result of file prompts.
          */
         interface FileCallback extends AlertCallback {
             /**
              * Called by the prompt implementation when the user makes a file selection in
              * single-selection mode.
              *
              * @param context An application Context for parsing URIs.
              * @param uri The URI of the selected file.
              */
             @UiThread
-            void confirm(Context context, Uri uri);
+            void confirm(@Nullable Context context, @Nullable Uri uri);
 
             /**
              * Called by the prompt implementation when the user makes file selections in
              * multiple-selection mode.
              *
              * @param context An application Context for parsing URIs.
              * @param uris Array of URI objects for the selected files.
              */
             @UiThread
-            void confirm(Context context, Uri[] uris);
+            void confirm(@Nullable Context context, @Nullable Uri[] uris);
         }
 
         @Retention(RetentionPolicy.SOURCE)
         @IntDef({FILE_TYPE_SINGLE, FILE_TYPE_MULTIPLE})
         /* package */ @interface FileType {}
         static final int FILE_TYPE_SINGLE = 1;
         static final int FILE_TYPE_MULTIPLE = 2;
 
@@ -3612,56 +3619,57 @@ public class GeckoSession implements Par
          * @param title Title for the prompt dialog.
          * @param type One of FILE_TYPE_* indicating the prompt type.
          * @param mimeTypes Array of permissible MIME types for the selected files, in
          *                  the form "type/subtype", where "type" and/or "subtype" can be
          *                  "*" to indicate any value.
          * @param callback Callback interface.
          */
         @UiThread
-        void onFilePrompt(GeckoSession session, String title, @FileType int type,
-                          String[] mimeTypes, FileCallback callback);
+        void onFilePrompt(@NonNull GeckoSession session, @Nullable String title, @FileType int type,
+                          @Nullable String[] mimeTypes, @NonNull FileCallback callback);
 
         /**
          * 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
-        GeckoResult<AllowOrDeny> onPopupRequest(GeckoSession session, String targetUri);
+        GeckoResult<AllowOrDeny> onPopupRequest(@NonNull GeckoSession session,
+                                                @Nullable String targetUri);
     }
 
     /**
      * GeckoSession applications implement this interface to handle content scroll
      * events.
      **/
     public interface ScrollDelegate {
         /**
          * The scroll position of the content has changed.
          *
         * @param session GeckoSession that initiated the callback.
         * @param scrollX The new horizontal scroll position in pixels.
         * @param scrollY The new vertical scroll position in pixels.
         */
         @UiThread
-        public void onScrollChanged(GeckoSession session, int scrollX, int scrollY);
+        public void onScrollChanged(@NonNull GeckoSession session, int scrollX, int scrollY);
     }
 
     /**
      * Get the PanZoomController instance for this session.
      *
      * @return PanZoomController instance.
      */
     @UiThread
-    public PanZoomController getPanZoomController() {
+    public @NonNull PanZoomController getPanZoomController() {
         ThreadUtils.assertOnUiThread();
 
         if (mNPZC == null) {
             mNPZC = new PanZoomController(this);
             if (mAttachedCompositor) {
                 mCompositor.attachNPZC(mNPZC);
             }
         }
@@ -3669,17 +3677,17 @@ public class GeckoSession implements Par
     }
 
     /**
      * Get the OverscrollEdgeEffect instance for this session.
      *
      * @return OverscrollEdgeEffect instance.
      */
     @UiThread
-    public OverscrollEdgeEffect getOverscrollEdgeEffect() {
+    public @NonNull OverscrollEdgeEffect getOverscrollEdgeEffect() {
         ThreadUtils.assertOnUiThread();
 
         if (mOverscroll == null) {
             mOverscroll = new OverscrollEdgeEffect(this);
         }
         return mOverscroll;
     }
 
@@ -3858,17 +3866,17 @@ public class GeckoSession implements Par
          * tracking protection via GeckoSessionSettings.
          *
         * @param session The GeckoSession that initiated the callback.
         * @param uri The URI of the blocked element.
         * @param categories The tracker categories of the blocked element.
         *                   One or more of the {@link #CATEGORY_AD CATEGORY_*} flags.
         */
         @UiThread
-        void onTrackerBlocked(GeckoSession session, String uri,
+        void onTrackerBlocked(@NonNull GeckoSession session, @Nullable String uri,
                               @Category int categories);
     }
 
     /**
      * GeckoSession applications implement this interface to handle requests for permissions
      * from content, such as geolocation and notifications. For each permission, usually
      * two requests are generated: one request for the Android app permission through
      * requestAppPermissions, which is typically handled by a system permission dialog;
@@ -3924,33 +3932,34 @@ public class GeckoSession implements Par
          * @param permissions List of permissions to request; possible values are,
          *                    android.Manifest.permission.ACCESS_COARSE_LOCATION
          *                    android.Manifest.permission.ACCESS_FINE_LOCATION
          *                    android.Manifest.permission.CAMERA
          *                    android.Manifest.permission.RECORD_AUDIO
          * @param callback Callback interface.
          */
         @UiThread
-        void onAndroidPermissionsRequest(GeckoSession session, String[] permissions,
-                                         Callback callback);
+        void onAndroidPermissionsRequest(@NonNull GeckoSession session,
+                                         @Nullable String[] permissions,
+                                         @NonNull Callback callback);
 
         /**
          * 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
          *             PERMISSION_AUTOPLAY_MEDIA
          * @param callback Callback interface.
          */
         @UiThread
-        void onContentPermissionRequest(GeckoSession session, String uri,
-                                        @Permission int type, Callback callback);
+        void onContentPermissionRequest(@NonNull GeckoSession session, @Nullable String uri,
+                                        @Permission int type, @NonNull Callback callback);
 
         class MediaSource {
             @Retention(RetentionPolicy.SOURCE)
             @IntDef({SOURCE_CAMERA, SOURCE_SCREEN, SOURCE_APPLICATION,
                      SOURCE_WINDOW, SOURCE_BROWSER, SOURCE_MICROPHONE,
                      SOURCE_AUDIOCAPTURE, SOURCE_OTHER})
             /* package */ @interface Source {}
 
@@ -4103,31 +4112,31 @@ public class GeckoSession implements Par
              * implementation must call one of grant() or reject() for every request.
              *
              * @param video "id" value from the bundle for the video source to use,
              *              or null when video is not requested.
              * @param audio "id" value from the bundle for the audio source to use,
              *              or null when audio is not requested.
              */
             @UiThread
-            void grant(final String video, final String audio);
+            void grant(final @Nullable String video, final @Nullable String audio);
 
             /**
              * Called by the implementation after permissions are granted; the
              * implementation must call one of grant() or reject() for every request.
              *
              * @param video MediaSource for the video source to use (must be an original
              *              MediaSource object that was passed to the implementation);
              *              or null when video is not requested.
              * @param audio MediaSource for the audio source to use (must be an original
              *              MediaSource object that was passed to the implementation);
              *              or null when audio is not requested.
              */
             @UiThread
-            void grant(final MediaSource video, final MediaSource audio);
+            void grant(final @Nullable MediaSource video, final @Nullable MediaSource audio);
 
             /**
              * Called by the implementation when permissions are not granted; the
              * implementation must call one of grant() or reject() for every request.
              */
             @UiThread
             void reject();
         }
@@ -4138,18 +4147,19 @@ public class GeckoSession implements Par
          *
          * @param session GeckoSession instance requesting the permission.
          * @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
-        void onMediaPermissionRequest(GeckoSession session, String uri, MediaSource[] video,
-                                      MediaSource[] audio, MediaCallback callback);
+        void onMediaPermissionRequest(@NonNull GeckoSession session, @NonNull String uri,
+                                      @Nullable MediaSource[] video, @Nullable MediaSource[] audio,
+                                      @NonNull MediaCallback callback);
     }
 
     /**
      * 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.
      */
     public interface TextInputDelegate {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java
@@ -151,56 +151,56 @@ public final class GeckoSessionSettings 
         mBundle.putBoolean(SUSPEND_MEDIA_WHEN_INACTIVE.name, false);
         mBundle.putBoolean(ALLOW_JAVASCRIPT.name, true);
         mBundle.putBoolean(FULL_ACCESSIBILITY_TREE.name, false);
         mBundle.putInt(USER_AGENT_MODE.name, USER_AGENT_MODE_MOBILE);
         mBundle.putString(USER_AGENT_OVERRIDE.name, null);
         mBundle.putInt(DISPLAY_MODE.name, DISPLAY_MODE_BROWSER);
     }
 
-    public void setBoolean(final Key<Boolean> key, final boolean value) {
+    public void setBoolean(final @NonNull Key<Boolean> key, final boolean value) {
         synchronized (mBundle) {
             if (valueChangedLocked(key, value)) {
                 mBundle.putBoolean(key.name, value);
                 dispatchUpdate();
             }
         }
     }
 
-    public boolean getBoolean(final Key<Boolean> key) {
+    public boolean getBoolean(final @NonNull Key<Boolean> key) {
         synchronized (mBundle) {
             return mBundle.getBoolean(key.name);
         }
     }
 
-    public void setInt(final Key<Integer> key, final int value) {
+    public void setInt(final @NonNull Key<Integer> key, final int value) {
         synchronized (mBundle) {
             if (valueChangedLocked(key, value)) {
                 mBundle.putInt(key.name, value);
                 dispatchUpdate();
             }
         }
     }
 
-    public int getInt(final Key<Integer> key) {
+    public int getInt(final @NonNull Key<Integer> key) {
         synchronized (mBundle) {
             return mBundle.getInt(key.name);
         }
     }
 
-    public void setString(final Key<String> key, final String value) {
+    public void setString(final @NonNull Key<String> key, final @Nullable String value) {
         synchronized (mBundle) {
             if (valueChangedLocked(key, value)) {
                 mBundle.putString(key.name, value);
                 dispatchUpdate();
             }
         }
     }
 
-    public String getString(final Key<String> key) {
+    public String getString(final @NonNull Key<String> key) {
         synchronized (mBundle) {
             return mBundle.getString(key.name);
         }
     }
 
     /* package */ GeckoBundle toBundle() {
         return new GeckoBundle(mBundle);
     }
@@ -239,22 +239,22 @@ public final class GeckoSessionSettings 
     }
 
     @Override // Parcelable
     public int describeContents() {
         return 0;
     }
 
     @Override // Parcelable
-    public void writeToParcel(Parcel out, int flags) {
+    public void writeToParcel(@NonNull Parcel out, int flags) {
         mBundle.writeToParcel(out, flags);
     }
 
     // AIDL code may call readFromParcel even though it's not part of Parcelable.
-    public void readFromParcel(final Parcel source) {
+    public void readFromParcel(final @NonNull Parcel source) {
         mBundle.readFromParcel(source);
     }
 
     public static final Parcelable.Creator<GeckoSessionSettings> CREATOR
             = new Parcelable.Creator<GeckoSessionSettings>() {
         @Override
         public GeckoSessionSettings createFromParcel(final Parcel in) {
             final GeckoSessionSettings settings = new GeckoSessionSettings();
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java
@@ -237,17 +237,17 @@ public class GeckoView extends FrameLayo
     }
 
     /* package */ void setActive(final boolean active) {
         if (mSession != null) {
             mSession.setActive(active);
         }
     }
 
-    public GeckoSession releaseSession() {
+    public @Nullable GeckoSession releaseSession() {
         ThreadUtils.assertOnUiThread();
 
         if (mSession == null) {
             return null;
         }
 
         // Cover the view while we are not drawing to the surface.
         coverUntilFirstPaint(Color.WHITE);
@@ -366,31 +366,31 @@ public class GeckoView extends FrameLayo
         }
 
         if (isFocused()) {
             session.setFocused(true);
         }
     }
 
     @AnyThread
-    public GeckoSession getSession() {
+    public @Nullable GeckoSession getSession() {
         return mSession;
     }
 
     @AnyThread
-    public EventDispatcher getEventDispatcher() {
+    public @NonNull EventDispatcher getEventDispatcher() {
         return mSession.getEventDispatcher();
     }
 
-    public PanZoomController getPanZoomController() {
+    public @NonNull PanZoomController getPanZoomController() {
         ThreadUtils.assertOnUiThread();
         return mSession.getPanZoomController();
     }
 
-    public DynamicToolbarAnimator getDynamicToolbarAnimator() {
+    public @NonNull DynamicToolbarAnimator getDynamicToolbarAnimator() {
         ThreadUtils.assertOnUiThread();
         return mSession.getDynamicToolbarAnimator();
     }
 
     @Override
     public void onAttachedToWindow() {
         if (mSession == null) {
             setSession(new GeckoSession(), GeckoRuntime.getDefault(getContext()));
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/MediaElement.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/MediaElement.java
@@ -3,16 +3,17 @@
  * 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.geckoview;
 
 import android.support.annotation.AnyThread;
 import android.support.annotation.IntDef;
+import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.support.annotation.UiThread;
 import android.util.Log;
 
 import org.mozilla.gecko.util.GeckoBundle;
 
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -286,92 +287,93 @@ public class MediaElement {
         /**
          * The media playback state has changed.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param mediaState The playback state of the media.
          *                   One of the {@link #MEDIA_STATE_PLAY MEDIA_STATE_*} flags.
          */
         @UiThread
-        void onPlaybackStateChange(MediaElement mediaElement, @MediaStateFlags int mediaState);
+        void onPlaybackStateChange(@NonNull MediaElement mediaElement, @MediaStateFlags int mediaState);
 
         /**
          * The readiness state of the media has changed.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param readyState The readiness state of the media.
          *                   One of the {@link #MEDIA_READY_STATE_HAVE_NOTHING MEDIA_READY_STATE_*} flags.
          */
         @UiThread
-        void onReadyStateChange(MediaElement mediaElement, @ReadyStateFlags int readyState);
+        void onReadyStateChange(@NonNull MediaElement mediaElement, @ReadyStateFlags int readyState);
 
         /**
          * The media metadata has loaded or changed.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param metaData The MetaData values of the media.
          */
         @UiThread
-        void onMetadataChange(MediaElement mediaElement, Metadata metaData);
+        void onMetadataChange(@NonNull MediaElement mediaElement, @NonNull Metadata metaData);
 
         /**
          * Indicates that a loading operation is in progress for the media.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param progressInfo Information about the load progress and buffered ranges.
          */
         @UiThread
-        void onLoadProgress(MediaElement mediaElement, LoadProgressInfo progressInfo);
+        void onLoadProgress(@NonNull MediaElement mediaElement,
+                            @NonNull LoadProgressInfo progressInfo);
 
         /**
          * The media audio volume has changed.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param volume The volume of the media.
          * @param muted True if the media is muted.
          */
         @UiThread
-        void onVolumeChange(MediaElement mediaElement, double volume, boolean muted);
+        void onVolumeChange(@NonNull MediaElement mediaElement, double volume, boolean muted);
 
         /**
          * The current playback time has changed. This event is usually dispatched every 250ms.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param time The current playback time in seconds.
          */
         @UiThread
-        void onTimeChange(MediaElement mediaElement, double time);
+        void onTimeChange(@NonNull MediaElement mediaElement, double time);
 
         /**
          * The media playback speed has changed.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param rate The current playback rate. A value of 1.0 indicates normal speed.
          */
         @UiThread
-        void onPlaybackRateChange(MediaElement mediaElement, double rate);
+        void onPlaybackRateChange(@NonNull MediaElement mediaElement, double rate);
 
         /**
          * A media element has entered or exited fullscreen mode.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param fullscreen True if the media has entered full screen mode.
          */
         @UiThread
-        void onFullscreenChange(MediaElement mediaElement, boolean fullscreen);
+        void onFullscreenChange(@NonNull MediaElement mediaElement, boolean fullscreen);
 
         /**
          * An error has occurred.
          *
          * @param mediaElement A reference to the MediaElement that dispatched the event.
          * @param errorCode The error code.
          *                  One of the {@link #MEDIA_ERROR_NETWORK_NO_SOURCE MEDIA_ERROR_*} flags.
          */
         @UiThread
-        void onError(MediaElement mediaElement, @MediaErrorFlags int errorCode);
+        void onError(@NonNull MediaElement mediaElement, @MediaErrorFlags int errorCode);
     }
 
     /* package */ long getVideoId() {
         return mVideoId;
     }
 
     /**
      * Gets the current the media callback handler.
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/OverscrollEdgeEffect.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/OverscrollEdgeEffect.java
@@ -9,16 +9,18 @@ import org.mozilla.gecko.util.ThreadUtil
 
 import android.content.Context;
 import android.graphics.Canvas;
 import android.graphics.Paint;
 import android.graphics.PorterDuff;
 import android.graphics.PorterDuffXfermode;
 import android.graphics.Rect;
 import android.os.Build;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
 import android.support.annotation.UiThread;
 import android.view.View;
 import android.widget.EdgeEffect;
 
 import java.lang.reflect.Field;
 
 @UiThread
 public final class OverscrollEdgeEffect {
@@ -43,17 +45,17 @@ public final class OverscrollEdgeEffect 
         mSession = session;
     }
 
     /**
      * Set the theme to use for overscroll from a given Context.
      *
      * @param context Context to use for the overscroll theme.
      */
-    public void setTheme(final Context context) {
+    public void setTheme(final @NonNull Context context) {
         ThreadUtils.assertOnUiThread();
 
         final PorterDuffXfermode mode = new PorterDuffXfermode(PorterDuff.Mode.SRC);
         Field paintField = null;
 
         if (Build.VERSION.SDK_INT >= 21) {
             try {
                 paintField = EdgeEffect.class.getDeclaredField("mPaint");
@@ -85,28 +87,28 @@ public final class OverscrollEdgeEffect 
     /**
      * Set a Runnable that acts as a callback to invalidate the overscroll effect (for
      * example, as a response to user fling for example). The Runnbale should schedule a
      * future call to {@link #draw(Canvas)} as a result of the invalidation.
      *
      * @param runnable Invalidation Runnable.
      * @see #getInvalidationCallback()
      */
-    public void setInvalidationCallback(final Runnable runnable) {
+    public void setInvalidationCallback(final @Nullable Runnable runnable) {
         ThreadUtils.assertOnUiThread();
         mInvalidationCallback = runnable;
     }
 
     /**
      * Get the current invalidatation Runnable.
      *
      * @return Invalidation Runnable.
      * @see #setInvalidationCallback(Runnable)
      */
-    public Runnable getInvalidationCallback() {
+    public @Nullable Runnable getInvalidationCallback() {
         ThreadUtils.assertOnUiThread();
         return mInvalidationCallback;
     }
 
     /* package */ void setSize(final int width, final int height) {
         mEdges[LEFT].setSize(height, width);
         mEdges[RIGHT].setSize(height, width);
         mEdges[TOP].setSize(width, height);
@@ -162,17 +164,17 @@ public final class OverscrollEdgeEffect 
         }
     }
 
     /**
      * Draw the overscroll effect on a Canvas.
      *
      * @param canvas Canvas to draw on.
      */
-    public void draw(final Canvas canvas) {
+    public void draw(final @NonNull Canvas canvas) {
         ThreadUtils.assertOnUiThread();
 
         final Rect pageRect = new Rect();
         mSession.getSurfaceBounds(pageRect);
 
         // If we're pulling an edge, or fading it out, draw!
         boolean invalidate = false;
         if (!mEdges[TOP].isFinished()) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/PanZoomController.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/PanZoomController.java
@@ -6,16 +6,17 @@
 package org.mozilla.geckoview;
 
 import org.mozilla.gecko.annotation.WrapForJNI;
 import org.mozilla.gecko.mozglue.JNIObject;
 import org.mozilla.gecko.util.ThreadUtils;
 
 import android.graphics.Rect;
 import android.os.SystemClock;
+import android.support.annotation.NonNull;
 import android.support.annotation.UiThread;
 import android.util.Log;
 import android.util.Pair;
 import android.view.MotionEvent;
 import android.view.InputDevice;
 
 import java.util.ArrayList;
 
@@ -180,30 +181,30 @@ public class PanZoomController extends J
     /**
      * Process a touch event through the pan-zoom controller. Treat any mouse events as
      * "touch" rather than as "mouse". Pointer coordinates should be relative to the
      * display surface.
      *
      * @param event MotionEvent to process.
      * @return True if the event was handled.
      */
-    public boolean onTouchEvent(final MotionEvent event) {
+    public boolean onTouchEvent(final @NonNull MotionEvent event) {
         ThreadUtils.assertOnUiThread();
         return handleMotionEvent(event);
     }
 
     /**
      * Process a touch event through the pan-zoom controller. Treat any mouse events as
      * "mouse" rather than as "touch". Pointer coordinates should be relative to the
      * display surface.
      *
      * @param event MotionEvent to process.
      * @return True if the event was handled.
      */
-    public boolean onMouseEvent(final MotionEvent event) {
+    public boolean onMouseEvent(final @NonNull MotionEvent event) {
         ThreadUtils.assertOnUiThread();
 
         if (event.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE) {
             return handleMouseEvent(event);
         }
         return handleMotionEvent(event);
     }
 
@@ -215,17 +216,17 @@ public class PanZoomController extends J
     /**
      * Process a non-touch motion event through the pan-zoom controller. Currently, hover
      * and scroll events are supported. Pointer coordinates should be relative to the
      * display surface.
      *
      * @param event MotionEvent to process.
      * @return True if the event was handled.
      */
-    public boolean onMotionEvent(MotionEvent event) {
+    public boolean onMotionEvent(@NonNull MotionEvent event) {
         ThreadUtils.assertOnUiThread();
 
         final int action = event.getActionMasked();
         if (action == MotionEvent.ACTION_SCROLL) {
             if (event.getDownTime() >= mLastDownTime) {
                 mLastDownTime = event.getDownTime();
             } else if ((InputDevice.getDevice(event.getDeviceId()).getSources() &
                         InputDevice.SOURCE_TOUCHPAD) == InputDevice.SOURCE_TOUCHPAD) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
@@ -14,16 +14,18 @@ import org.mozilla.gecko.util.GeckoBundl
 import org.mozilla.gecko.util.ThreadUtils;
 import org.mozilla.gecko.mozglue.JNIObject;
 
 import android.content.Context;
 import android.graphics.Matrix;
 import android.graphics.Rect;
 import android.os.Build;
 import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
 import android.support.annotation.UiThread;
 import android.util.Log;
 import android.util.SparseArray;
 import android.view.InputDevice;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewParent;
 import android.view.accessibility.AccessibilityEvent;
@@ -489,29 +491,29 @@ public class SessionAccessibility {
         Settings.updateAccessibilitySettings();
     }
 
     /**
       * Get the View instance that delegates accessibility to this session.
       *
       * @return View instance.
       */
-    public View getView() {
+    public @Nullable View getView() {
         ThreadUtils.assertOnUiThread();
 
         return mView;
     }
 
     /**
       * Set the View instance that should delegate accessibility to this session.
       *
       * @param view View instance.
       */
     @UiThread
-    public void setView(final View view) {
+    public void setView(final @Nullable View view) {
         ThreadUtils.assertOnUiThread();
 
         if (mView != null) {
             mView.setAccessibilityDelegate(null);
         }
 
         mView = view;
 
@@ -614,17 +616,17 @@ public class SessionAccessibility {
                         Settings.class, "toggleNativeAccessibility", isEnabled());
             }
         }
 
         @WrapForJNI(dispatchTo = "gecko")
         private static native void toggleNativeAccessibility(boolean enable);
     }
 
-    public boolean onMotionEvent(final MotionEvent event) {
+    public boolean onMotionEvent(final @NonNull MotionEvent event) {
         ThreadUtils.assertOnUiThread();
 
         if (!Settings.isTouchExplorationEnabled()) {
             return false;
         }
 
         if (event.getSource() != InputDevice.SOURCE_TOUCHSCREEN) {
             return false;
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionTextInput.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionTextInput.java
@@ -478,17 +478,17 @@ public final class SessionTextInput {
     }
 
     /**
      * Get the current text input delegate.
      *
      * @return TextInputDelegate instance or a default instance if no delegate has been set.
      */
     @UiThread
-    public GeckoSession.TextInputDelegate getDelegate() {
+    public @NonNull GeckoSession.TextInputDelegate getDelegate() {
         ThreadUtils.assertOnUiThread();
         if (mDelegate == null) {
             mDelegate = DefaultDelegate.INSTANCE;
         }
         return mDelegate;
     }
 
     /**
@@ -529,17 +529,17 @@ public final class SessionTextInput {
     }
 
     /**
      * Perform auto-fill using the specified values.
      *
      * @param values Map of auto-fill IDs to values.
      */
     @UiThread
-    public void autofill(final SparseArray<CharSequence> values) {
+    public void autofill(final @NonNull SparseArray<CharSequence> values) {
         if (mAutoFillRoots == null) {
             return;
         }
 
         GeckoBundle response = null;
         EventCallback callback = null;
 
         for (int i = 0; i < values.size(); i++) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md
@@ -1,14 +1,17 @@
 ---
 layout: geckoview
 ---
 
 <h1> GeckoView API Changelog. </h1>
 
+## v66
+- Added `@NonNull` or `@Nullable` to all APIs.
+
 ## v65
 - Moved `CompositorController`, `DynamicToolbarAnimator`,
   `OverscrollEdgeEffect`, `PanZoomController` from `org.mozilla.gecko.gfx` to
   `org.mozilla.geckoview`
 - Added `@UiThread`, `@AnyThread` annotations to all APIs
 - Changed `GeckoRuntime#getLocale` to `GeckoRuntime#getLocales` and related APIs.
 - Merged `org.mozilla.gecko.gfx.LayerSession` into `GeckoSession`
 - Added `GeckoSession.MediaDelegate` and `MediaElement`. This allow monitoring
@@ -31,9 +34,9 @@ layout: geckoview
   `ContentDelegate#onContextMenu`. Extended information includes the element's
   title and alt attributes.
 - Changed `ContentDelegate.ContextElement` TYPE_ constants to public access.
 - Changed `ContentDelegate.ContextElement`, `GeckoSession.FinderResult` to
   non-final class.
 - Update `CrashReporter.sendCrashReport()` to return the crash ID as a
   GeckoResult<String>.
 
-[api-version]: bb945ae930ebf055f11821c685a6691faa7e5a3a
+[api-version]: cdbaa3fa639126d2d45a0cd8e9508f95a9e98e33