Merge mozilla-central to autoland. a=merge CLOSED TREE
authorshindli <shindli@mozilla.com>
Wed, 02 May 2018 01:57:22 +0300
changeset 416632 c4e3dcdb87c6fa0340d9809ad20804e021a94c37
parent 416631 6340700abe0f9639891ed8498287b9c5b8bcf545 (current diff)
parent 416464 258fa1eb49c9a559f0f75bd0a597d14398b01430 (diff)
child 416633 efbdd0a0a0ba523d0ec3b47ed3ad6872832c8e80
push id102811
push usercsabou@mozilla.com
push dateWed, 02 May 2018 09:28:28 +0000
treeherdermozilla-inbound@5c7c23459026 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone61.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
Merge mozilla-central to autoland. a=merge CLOSED TREE
build.gradle
mobile/android/geckoview/build.gradle
--- a/build.gradle
+++ b/build.gradle
@@ -94,33 +94,17 @@ if ('multi' == System.env.AB_CD) {
             if (execResult.exitValue != 0) {
                 throw new GradleException("Process '${commandLine}' finished with non-zero exit value ${execResult.exitValue}:\n\n${standardOutput.toString()}")
             }
         }
     }
 }
 
 afterEvaluate {
-    subprojects { project ->
-        if (project.name != 'thirdparty') {
-            tasks.withType(JavaCompile) {
-                // Add compiler args for all code except third-party code.
-                options.compilerArgs += [
-                    // Turn on all warnings, except...
-                    "-Xlint:all",
-                    // Deprecation, because we do use deprecated API for compatibility.
-                    "-Xlint:-deprecation",
-                    // Serial, because we don't use Java serialization.
-                    "-Xlint:-serial",
-                    // Turn all remaining warnings into errors,
-                    // unless marked by @SuppressWarnings.
-                    "-Werror"]
-            }
-        }
-
+    subprojects {
         if (!hasProperty('android')) {
             return
         }
         android.applicationVariants.all {
             preBuild.dependsOn rootProject.generateCodeAndResources
         }
         android.libraryVariants.all {
             preBuild.dependsOn rootProject.generateCodeAndResources
--- a/mobile/android/app/src/test/java/org/mozilla/gecko/TestGeckoProfile.java
+++ b/mobile/android/app/src/test/java/org/mozilla/gecko/TestGeckoProfile.java
@@ -154,38 +154,38 @@ public class TestGeckoProfile {
     public void testIsClientIdValid() {
         final String[] validClientIds = new String[] {
                 "905de1c0-0ea6-4a43-95f9-6170035f5a82",
                 "905de1c0-0ea6-4a43-95f9-6170035f5a83",
                 "57472f82-453d-4c55-b59c-d3c0e97b76a1",
                 "895745d1-f31e-46c3-880e-b4dd72963d4f",
         };
         for (final String validClientId : validClientIds) {
-            assertTrue("Client ID, " + validClientId + ", is valid", GeckoProfile.isClientIdValid(validClientId));
+            assertTrue("Client ID, " + validClientId + ", is valid", profile.isClientIdValid(validClientId));
         }
 
         final String[] invalidClientIds = new String[] {
                 null,
                 "",
                 "a",
                 "anInvalidClientId",
                 "905de1c0-0ea6-4a43-95f9-6170035f5a820", // too long (last section)
                 "905de1c0-0ea6-4a43-95f9-6170035f5a8", // too short (last section)
                 "05de1c0-0ea6-4a43-95f9-6170035f5a82", // too short (first section)
                 "905de1c0-0ea6-4a43-95f9-6170035f5a8!", // contains a symbol
         };
         for (final String invalidClientId : invalidClientIds) {
-            assertFalse("Client ID, " + invalidClientId + ", is invalid", GeckoProfile.isClientIdValid(invalidClientId));
+            assertFalse("Client ID, " + invalidClientId + ", is invalid", profile.isClientIdValid(invalidClientId));
         }
 
         // We generate client IDs using UUID - better make sure they're valid.
         for (int i = 0; i < 30; ++i) {
             final String generatedClientId = UUID.randomUUID().toString();
             assertTrue("Generated client ID from UUID, " + generatedClientId + ", is valid",
-                    GeckoProfile.isClientIdValid(generatedClientId));
+                    profile.isClientIdValid(generatedClientId));
         }
     }
 
     @Test
     public void testGetProfileCreationDateFromTimesFile() throws Exception {
         final long expectedDate = System.currentTimeMillis();
         final JSONObject expectedObj = new JSONObject();
         expectedObj.put(PROFILE_CREATION_DATE_JSON_ATTR, expectedDate);
--- a/mobile/android/app/src/test/java/org/mozilla/gecko/icons/TestIconRequest.java
+++ b/mobile/android/app/src/test/java/org/mozilla/gecko/icons/TestIconRequest.java
@@ -64,19 +64,17 @@ public class TestIconRequest {
      * If removing an icon from the internal set failed then we want to throw an exception.
      */
     @Test(expected = IllegalStateException.class)
     public void testMoveToNextIconThrowsException() {
         final IconRequest request = Icons.with(RuntimeEnvironment.application)
                 .pageUrl(TEST_PAGE_URL)
                 .build();
 
-        @SuppressWarnings("unchecked")
         //noinspection unchecked - Creating a mock of a generic type
-        final TreeSet<IconDescriptor> icons = (TreeSet<IconDescriptor>) mock(TreeSet.class);
-        request.icons = icons;
+        request.icons = (TreeSet<IconDescriptor>) mock(TreeSet.class);
 
         //noinspection SuspiciousMethodCalls
         doReturn(false).when(request.icons).remove(anyObject());
 
         request.moveToNextIcon();
     }
 }
--- a/mobile/android/app/src/test/java/org/mozilla/gecko/push/autopush/test/TestLiveAutopushClient.java
+++ b/mobile/android/app/src/test/java/org/mozilla/gecko/push/autopush/test/TestLiveAutopushClient.java
@@ -67,115 +67,104 @@ public class TestLiveAutopushClient {
         final ArgumentCaptor<AutopushClientException> failure = ArgumentCaptor.forClass(AutopushClientException.class);
         verify(delegate).handleFailure(failure.capture());
 
         return failure.getValue();
     }
 
     @Test
     public void testUserAgent() throws Exception {
-        @SuppressWarnings("unchecked")
         final RequestDelegate<RegisterUserAgentResponse> registerDelegate = mock(RequestDelegate.class);
         client.registerUserAgent(Utils.generateGuid(), registerDelegate);
 
         final RegisterUserAgentResponse registerResponse = assertSuccess(registerDelegate, RegisterUserAgentResponse.class);
         Assert.assertNotNull(registerResponse);
         Assert.assertNotNull(registerResponse.uaid);
         Assert.assertNotNull(registerResponse.secret);
 
         // Reregistering with a new GUID should succeed.
-        @SuppressWarnings("unchecked")
         final RequestDelegate<Void> reregisterDelegate = mock(RequestDelegate.class);
         client.reregisterUserAgent(registerResponse.uaid, registerResponse.secret, Utils.generateGuid(), reregisterDelegate);
 
         Assert.assertNull(assertSuccess(reregisterDelegate, Void.class));
 
         // Unregistering should succeed.
-        @SuppressWarnings("unchecked")
         final RequestDelegate<Void> unregisterDelegate = mock(RequestDelegate.class);
         client.unregisterUserAgent(registerResponse.uaid, registerResponse.secret, unregisterDelegate);
 
         Assert.assertNull(assertSuccess(unregisterDelegate, Void.class));
 
         // Trying to unregister a second time should give a 404.
-        @SuppressWarnings("unchecked")
         final RequestDelegate<Void> reunregisterDelegate = mock(RequestDelegate.class);
         client.unregisterUserAgent(registerResponse.uaid, registerResponse.secret, reunregisterDelegate);
 
         final AutopushClientException failureException = assertFailure(reunregisterDelegate, Void.class);
         Assert.assertThat(failureException, instanceOf(AutopushClientException.AutopushClientRemoteException.class));
         Assert.assertTrue(((AutopushClientException.AutopushClientRemoteException) failureException).isGone());
     }
 
     @Test
     public void testChannel() throws Exception {
-        @SuppressWarnings("unchecked")
         final RequestDelegate<RegisterUserAgentResponse> registerDelegate = mock(RequestDelegate.class);
         client.registerUserAgent(Utils.generateGuid(), registerDelegate);
 
         final RegisterUserAgentResponse registerResponse = assertSuccess(registerDelegate, RegisterUserAgentResponse.class);
         Assert.assertNotNull(registerResponse);
         Assert.assertNotNull(registerResponse.uaid);
         Assert.assertNotNull(registerResponse.secret);
 
         // We should be able to subscribe to a channel.
-        @SuppressWarnings("unchecked")
         final RequestDelegate<SubscribeChannelResponse> subscribeDelegate = mock(RequestDelegate.class);
         client.subscribeChannel(registerResponse.uaid, registerResponse.secret, null, subscribeDelegate);
 
         final SubscribeChannelResponse subscribeResponse = assertSuccess(subscribeDelegate, SubscribeChannelResponse.class);
         Assert.assertNotNull(subscribeResponse);
         Assert.assertNotNull(subscribeResponse.channelID);
         Assert.assertNotNull(subscribeResponse.endpoint);
         Assert.assertThat(subscribeResponse.endpoint, startsWith(FxAccountUtils.getAudienceForURL(serverURL)));
         Assert.assertThat(subscribeResponse.endpoint, containsString("/v1/"));
 
         // And we should be able to unsubscribe.
-        @SuppressWarnings("unchecked")
         final RequestDelegate<Void> unsubscribeDelegate = mock(RequestDelegate.class);
         client.unsubscribeChannel(registerResponse.uaid, registerResponse.secret, subscribeResponse.channelID, unsubscribeDelegate);
 
         Assert.assertNull(assertSuccess(unsubscribeDelegate, Void.class));
 
         // We should be able to create a restricted subscription by specifying
         // an ECDSA public key using the P-256 curve.
-        @SuppressWarnings("unchecked")
         final RequestDelegate<SubscribeChannelResponse> subscribeWithKeyDelegate = mock(RequestDelegate.class);
         final KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("ECDSA");
         keyPairGenerator.initialize(256);
         final KeyPair keyPair = keyPairGenerator.generateKeyPair();
         final PublicKey publicKey = keyPair.getPublic();
         String appServerKey = Base64.encodeBase64URLSafeString(publicKey.getEncoded());
         client.subscribeChannel(registerResponse.uaid, registerResponse.secret, appServerKey, subscribeWithKeyDelegate);
 
         final SubscribeChannelResponse subscribeWithKeyResponse = assertSuccess(subscribeWithKeyDelegate, SubscribeChannelResponse.class);
         Assert.assertNotNull(subscribeWithKeyResponse);
         Assert.assertNotNull(subscribeWithKeyResponse.channelID);
         Assert.assertNotNull(subscribeWithKeyResponse.endpoint);
         Assert.assertThat(subscribeWithKeyResponse.endpoint, startsWith(FxAccountUtils.getAudienceForURL(serverURL)));
         Assert.assertThat(subscribeWithKeyResponse.endpoint, containsString("/v2/"));
 
         // And we should be able to drop the restricted subscription.
-        @SuppressWarnings("unchecked")
         final RequestDelegate<Void> unsubscribeWithKeyDelegate = mock(RequestDelegate.class);
         client.unsubscribeChannel(registerResponse.uaid, registerResponse.secret, subscribeWithKeyResponse.channelID, unsubscribeWithKeyDelegate);
 
         Assert.assertNull(assertSuccess(unsubscribeWithKeyDelegate, Void.class));
 
         // Trying to unsubscribe a second time should give a 410.
-        @SuppressWarnings("unchecked")
         final RequestDelegate<Void> reunsubscribeDelegate = mock(RequestDelegate.class);
         client.unsubscribeChannel(registerResponse.uaid, registerResponse.secret, subscribeResponse.channelID, reunsubscribeDelegate);
 
         final AutopushClientException reunsubscribeFailureException = assertFailure(reunsubscribeDelegate, Void.class);
         Assert.assertThat(reunsubscribeFailureException, instanceOf(AutopushClientException.AutopushClientRemoteException.class));
         Assert.assertTrue(((AutopushClientException.AutopushClientRemoteException) reunsubscribeFailureException).isGone());
 
         // Trying to unsubscribe from a non-existent channel should give a 404.  Right now it gives a 401!
-        @SuppressWarnings("unchecked")
         final RequestDelegate<Void> badUnsubscribeDelegate = mock(RequestDelegate.class);
         client.unsubscribeChannel(registerResponse.uaid + "BAD", registerResponse.secret, subscribeResponse.channelID, badUnsubscribeDelegate);
 
         final AutopushClientException badUnsubscribeFailureException = assertFailure(badUnsubscribeDelegate, Void.class);
         Assert.assertThat(badUnsubscribeFailureException, instanceOf(AutopushClientException.AutopushClientRemoteException.class));
         Assert.assertTrue(((AutopushClientException.AutopushClientRemoteException) badUnsubscribeFailureException).isInvalidAuthentication());
     }
 }
--- a/mobile/android/app/src/test/java/org/mozilla/gecko/telemetry/measurements/TestSearchCountMeasurements.java
+++ b/mobile/android/app/src/test/java/org/mozilla/gecko/telemetry/measurements/TestSearchCountMeasurements.java
@@ -140,22 +140,22 @@ public class TestSearchCountMeasurements
             editor.putInt(SearchCountMeasurements.getEngineSearchCountKey(key), expected.get(key));
         }
         editor.apply();
         assertFalse("Shared prefs is not empty after test data inserted", sharedPrefs.getAll().isEmpty());
 
         final ExtendedJSONObject actual = SearchCountMeasurements.getAndZeroSearch(sharedPrefs);
         assertEquals("Returned JSON contains number of items inserted", expected.size(), actual.size());
         for (final String key : expected.keySet()) {
-            assertEquals("Returned JSON contains inserted value", expected.get(key), actual.getIntegerSafely(key));
+            assertEquals("Returned JSON contains inserted value", expected.get(key), (Integer) actual.getIntegerSafely(key));
         }
     }
 
     @Test
     public void testGetAndZeroSearchNoData() throws Exception {
         final ExtendedJSONObject actual = SearchCountMeasurements.getAndZeroSearch(sharedPrefs);
         assertEquals("Returned json is empty", 0, actual.size());
     }
 
     private String getEngineSearchCountKey(final String engineWhereStr) {
         return SearchCountMeasurements.getEngineSearchCountKey(engineWhereStr);
     }
-}
+}
\ No newline at end of file
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -443,17 +443,16 @@ public class BrowserApp extends GeckoApp
             view = TabsPanel.createTabsLayout(context, attrs);
         } else {
             view = super.onCreateView(name, context, attrs);
         }
         return view;
     }
 
     @Override
-    @SuppressWarnings("fallthrough")
     public void onTabChanged(Tab tab, TabEvents msg, String data) {
         if (!mInitialized) {
             super.onTabChanged(tab, msg, data);
             return;
         }
 
         if (tab == null) {
             // Only RESTORED is allowed a null tab: it's the only event that
--- a/mobile/android/base/java/org/mozilla/gecko/Tabs.java
+++ b/mobile/android/base/java/org/mozilla/gecko/Tabs.java
@@ -824,18 +824,16 @@ public class Tabs implements BundleEvent
             // for ADDED/CLOSED events.
             case SELECTED:
                 if (mGeckoView != null) {
                     final int color = getTabColor(tab);
                     mGeckoView.getSession().getCompositorController().setClearColor(color);
                     mGeckoView.coverUntilFirstPaint(color);
                 }
                 queuePersistAllTabs();
-                tab.onChange();
-                break;
             case UNSELECTED:
                 tab.onChange();
                 break;
             default:
                 break;
         }
     }
 
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/ActivityStreamTelemetry.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/ActivityStreamTelemetry.java
@@ -212,17 +212,17 @@ public class ActivityStreamTelemetry {
                     case BrowserContract.TopSites.TYPE_SUGGESTED:
                         this.set(Contract.SOURCE_SUBTYPE, Contract.SUBTYPE_SUGGESTED);
                         break;
                     case BrowserContract.TopSites.TYPE_TOP:
                         this.set(Contract.SOURCE_SUBTYPE, Contract.SUBTYPE_TOP);
                         break;
                     // While we also have a "blank" type, it is not used by Activity Stream.
                     case BrowserContract.TopSites.TYPE_BLANK:
-                        throw new IllegalStateException("Unknown top site type :" + String.valueOf(topSite.getType()));
+                        throw new IllegalStateException("Unknown top site type :" + (int) topSite.getType());
                 }
 
                 return this;
             }
 
             public String build() {
                 return data.toString();
             }
--- a/mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
@@ -1257,17 +1257,16 @@ public class BrowserProvider extends Sha
         if (cursor != null && context != null) {
             cursor.setNotificationUri(context.getContentResolver(), BrowserContract.AUTHORITY_URI);
         }
 
         return cursor;
     }
 
     @Override
-    @SuppressWarnings("fallthrough")
     public Cursor query(Uri uri, String[] projection, String selection,
             String[] selectionArgs, String sortOrder) {
         final int match = URI_MATCHER.match(uri);
 
         // Handle only queries requiring a writable DB connection here: most queries need only a readable
         // connection, hence we can get a readable DB once, and then handle most queries within a switch.
         // TopSites requires a writable connection (because of the temporary tables it uses), hence
         // we handle that separately, i.e. before retrieving a readable connection.
--- a/mobile/android/base/java/org/mozilla/gecko/db/TabsProvider.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/TabsProvider.java
@@ -219,17 +219,16 @@ public class TabsProvider extends Shared
 
         if (id >= 0)
             return ContentUris.withAppendedId(uri, id);
 
         return null;
     }
 
     @Override
-    @SuppressWarnings("fallthrough")
     public int updateInTransaction(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
         trace("Calling update in transaction on URI: " + uri);
 
         int match = URI_MATCHER.match(uri);
         int updated = 0;
 
         switch (match) {
             case CLIENTS_ID:
--- a/mobile/android/base/java/org/mozilla/gecko/dlc/BaseAction.java
+++ b/mobile/android/base/java/org/mozilla/gecko/dlc/BaseAction.java
@@ -96,17 +96,17 @@ public abstract class BaseAction {
     protected File getDestinationFile(Context context, DownloadContent content)
             throws UnrecoverableDownloadContentException, RecoverableDownloadContentException {
         File destinationDirectory;
         if (content.isFont()) {
             destinationDirectory = new File(context.getApplicationInfo().dataDir, "fonts");
         } else if (content.isHyphenationDictionary()) {
             destinationDirectory = new File(context.getApplicationInfo().dataDir, "hyphenation");
         } else {
-            throw new UnrecoverableDownloadContentException("Can't determine destination for kind: " + content.getKind().toString());
+            throw new UnrecoverableDownloadContentException("Can't determine destination for kind: " + (String) content.getKind());
         }
 
         if (!destinationDirectory.exists() && !destinationDirectory.mkdirs()) {
             throw new RecoverableDownloadContentException(RecoverableDownloadContentException.DISK_IO,
                     "Destination directory does not exist and cannot be created");
         }
 
         return new File(destinationDirectory, content.getFilename());
--- a/mobile/android/base/java/org/mozilla/gecko/dlc/DownloadAction.java
+++ b/mobile/android/base/java/org/mozilla/gecko/dlc/DownloadAction.java
@@ -102,17 +102,17 @@ public class DownloadAction extends Base
                 if (!verify(temporaryFile, content.getDownloadChecksum())) {
                     Log.w(LOGTAG, "Wrong checksum after download, content=" + content.getId());
                     temporaryFile.delete();
                     DownloadContentTelemetry.eventDownloadFailure(content, DownloadContentTelemetry.ERROR_CHECKSUM);
                     continue;
                 }
 
                 if (!content.isAssetArchive()) {
-                    Log.e(LOGTAG, "Downloaded content is not of type 'asset-archive': " + content.getType().toString());
+                    Log.e(LOGTAG, "Downloaded content is not of type 'asset-archive': " + (String) content.getType());
                     temporaryFile.delete();
                     DownloadContentTelemetry.eventDownloadFailure(content, DownloadContentTelemetry.ERROR_LOGIC);
                     continue;
                 }
 
                 extract(temporaryFile, destinationFile, content.getChecksum());
 
                 catalog.markAsDownloaded(content);
--- a/mobile/android/base/java/org/mozilla/gecko/tabs/TabStrip.java
+++ b/mobile/android/base/java/org/mozilla/gecko/tabs/TabStrip.java
@@ -134,22 +134,19 @@ public class TabStrip extends ThemedLine
                 case CLOSED:
                     tabStripView.removeTab(tab);
                     if (tabChangedListener != null) {
                         tabChangedListener.onTabChanged();
                     }
                     break;
 
                 case SELECTED:
-                    // Update the selected position.
+                    // Update the selected position, then fall through...
                     tabStripView.selectTab(tab);
                     setPrivateMode(tab.isPrivate());
-                    tabStripView.updateTab(tab);
-                    break;
-
                 case UNSELECTED:
                     // We just need to update the style for the unselected tab...
                 case TITLE:
                 case FAVICON:
                 case RECORDING_CHANGE:
                 case AUDIO_PLAYING_CHANGE:
                     tabStripView.updateTab(tab);
                     break;
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
@@ -430,17 +430,16 @@ public abstract class BrowserToolbar ext
         if (!isEditing()) {
             throw new IllegalStateException("Expected to be editing");
         }
 
         urlEditLayout.restoreTabEditingState(editingState);
     }
 
     @Override
-    @SuppressWarnings("fallthrough")
     public void onTabChanged(@Nullable Tab tab, Tabs.TabEvents msg, String data) {
         Log.d(LOGTAG, "onTabChanged: " + msg);
         final Tabs tabs = Tabs.getInstance();
 
         // These conditions are split into three phases:
         // * Always do first
         // * Handling specific to the selected tab
         // * Always do afterwards.
--- a/mobile/android/geckoview/build.gradle
+++ b/mobile/android/geckoview/build.gradle
@@ -143,46 +143,16 @@ android {
             }
 
             assets {
             }
         }
     }
 }
 
-tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
-    // Translate Kotlin messages like "w: ..." and "e: ..." into
-    // "...: warning: ..." and "...: error: ...", to make Treeherder understand.
-    def listener = {
-        if (it.startsWith('w: ') || it.startsWith('e: ')) {
-            def matches = (it =~ /([ew]): (.+): \((\d+), (\d+)\): (.*)/)
-            if (!matches) {
-                logger.quiet "kotlinc message format has changed!"
-                if (it.startsWith('w: ')) {
-                    // For warnings, don't continue because we don't want to throw an
-                    // exception. For errors, we want the exception so that the new error
-                    // message format gets translated properly.
-                    return
-                }
-            }
-            def (_, type, file, line, column, message) = matches[0]
-            type = (type == 'w') ? 'warning' : 'error'
-            // Use logger.lifecycle, which does not go through stderr again.
-            logger.lifecycle "$file:$line:$column: $type: $message"
-        }
-    } as StandardOutputListener
-
-    doFirst {
-        logging.addStandardErrorListener(listener)
-    }
-    doLast {
-        logging.removeStandardErrorListener(listener)
-    }
-}
-
 dependencies {
     implementation "com.android.support:support-v4:$support_library_version"
     implementation "com.android.support:palette-v7:$support_library_version"
 
     testImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
     testImplementation 'junit:junit:4.12'
     testImplementation 'org.robolectric:robolectric:3.8'
     testImplementation 'org.mockito:mockito-core:1.10.19'
--- a/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/rule/GeckoSessionTestRule.java
+++ b/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/rule/GeckoSessionTestRule.java
@@ -357,21 +357,16 @@ public class GeckoSessionTestRule extend
                         session == otherCall.session) &&
                         methodsEqual(method, ((MethodCall) other).method);
             } else if (other instanceof Method) {
                 return methodsEqual(method, (Method) other);
             }
             return false;
         }
 
-        @Override
-        public int hashCode() {
-            return method.hashCode();
-        }
-
         /* package */ int getOrder() {
             if (requirement == null || currentCount == 0) {
                 return 0;
             }
 
             final int[] order = requirement.order;
             if (order == null || order.length == 0) {
                 return 0;
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
@@ -650,17 +650,16 @@ public class GeckoAppShell
     public static HapticFeedbackDelegate getHapticFeedbackDelegate() {
         return sHapticFeedbackDelegate;
     }
 
     public static void setHapticFeedbackDelegate(final HapticFeedbackDelegate delegate) {
         sHapticFeedbackDelegate = (delegate != null) ? delegate : DEFAULT_LISTENERS;
     }
 
-    @SuppressWarnings("fallthrough")
     @WrapForJNI(calledFrom = "gecko")
     private static void enableSensor(int aSensortype) {
         final SensorManager sm = (SensorManager)
             getApplicationContext().getSystemService(Context.SENSOR_SERVICE);
 
         switch (aSensortype) {
         case GeckoHalDefines.SENSOR_GAME_ROTATION_VECTOR:
             if (gGameRotationVectorSensor == null) {
@@ -762,17 +761,16 @@ public class GeckoAppShell
             break;
 
         default:
             Log.w(LOGTAG, "Error! Can't enable unknown SENSOR type " +
                   aSensortype);
         }
     }
 
-    @SuppressWarnings("fallthrough")
     @WrapForJNI(calledFrom = "gecko")
     private static void disableSensor(int aSensortype) {
         final SensorManager sm = (SensorManager)
             getApplicationContext().getSystemService(Context.SENSOR_SERVICE);
 
         switch (aSensortype) {
         case GeckoHalDefines.SENSOR_GAME_ROTATION_VECTOR:
             if (gGameRotationVectorSensor != null) {
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/PanZoomController.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/PanZoomController.java
@@ -48,17 +48,17 @@ public final class PanZoomController ext
 
     @WrapForJNI(calledFrom = "ui")
     private native boolean handleMouseEvent(
             int action, long time, int metaState,
             float x, float y, int buttons);
 
     private boolean handleMotionEvent(MotionEvent event) {
         if (!mAttached) {
-            mQueuedEvents.add(new Pair<>(EVENT_SOURCE_MOTION, event));
+            mQueuedEvents.add(new Pair(EVENT_SOURCE_MOTION, event));
             return false;
         }
 
         final int action = event.getActionMasked();
         final int count = event.getPointerCount();
 
         if (action == MotionEvent.ACTION_DOWN) {
             mLastDownTime = event.getDownTime();
@@ -93,17 +93,17 @@ public final class PanZoomController ext
 
         return handleMotionEvent(action, event.getActionIndex(), event.getEventTime(),
                 event.getMetaState(), pointerId, x, y, orientation, pressure,
                 toolMajor, toolMinor);
     }
 
     private boolean handleScrollEvent(MotionEvent event) {
         if (!mAttached) {
-            mQueuedEvents.add(new Pair<>(EVENT_SOURCE_SCROLL, event));
+            mQueuedEvents.add(new Pair(EVENT_SOURCE_SCROLL, event));
             return false;
         }
 
         final int count = event.getPointerCount();
 
         if (count <= 0) {
             return false;
         }
@@ -122,17 +122,17 @@ public final class PanZoomController ext
                               mPointerScrollFactor;
 
         return handleScrollEvent(event.getEventTime(), event.getMetaState(), x, y,
                                  hScroll, vScroll);
     }
 
     private boolean handleMouseEvent(MotionEvent event) {
         if (!mAttached) {
-            mQueuedEvents.add(new Pair<>(EVENT_SOURCE_MOUSE, event));
+            mQueuedEvents.add(new Pair(EVENT_SOURCE_MOUSE, event));
             return false;
         }
 
         final int count = event.getPointerCount();
 
         if (count <= 0) {
             return false;
         }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java
@@ -175,21 +175,16 @@ public final class GeckoSessionSettings 
     }
 
     @Override
     public boolean equals(final Object other) {
         return other instanceof GeckoSessionSettings &&
                 mBundle.equals(((GeckoSessionSettings) other).mBundle);
     }
 
-    @Override
-    public int hashCode() {
-        return mBundle.hashCode();
-    }
-
     private <T> boolean valueChangedLocked(final Key<T> key, T value) {
         if (key.initOnly && mSession != null && mSession.isOpen()) {
             throw new IllegalStateException("Read-only property");
         } else if (key.values != null && !key.values.contains(value)) {
             throw new IllegalArgumentException("Invalid value");
         }
 
         final Object old = mBundle.get(key.name);
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
@@ -164,17 +164,16 @@ public class SessionAccessibility {
                             data.putBoolean("gainFocus", action == AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS);
                             mSession.getEventDispatcher().dispatch("GeckoView:AccessibilityViewFocused", data);
                             return true;
                         }
 
                         return mView.performAccessibilityAction(action, arguments);
                     }
 
-                    @SuppressWarnings("fallthrough")
                     private boolean performContentAction(int action, Bundle arguments) {
                         final GeckoBundle data;
                         switch (action) {
                         case AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS:
                             final AccessibilityEvent event = obtainEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED, VIRTUAL_CONTENT_ID);
                             ((ViewParent) mView).requestSendAccessibilityEvent(mView, event);
                             return true;
                         case AccessibilityNodeInfo.ACTION_CLICK:
@@ -188,17 +187,16 @@ public class SessionAccessibility {
                             return true;
                         case AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD:
                             mSession.getEventDispatcher().dispatch("GeckoView:AccessibilityScrollBackward", null);
                             return true;
                         case AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT:
                             if (mLastItem) {
                                 return false;
                             }
-                            // fall-through
                         case AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT:
                             if (arguments != null) {
                                 data = new GeckoBundle(1);
                                 data.putString("rule", arguments.getString(AccessibilityNodeInfo.ACTION_ARGUMENT_HTML_ELEMENT_STRING));
                             } else {
                                 data = null;
                             }
                             mSession.getEventDispatcher().dispatch(action == AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT ?
--- a/mobile/android/geckoview/src/thirdparty/java/com/google/android/exoplayer2/extractor/ogg/DefaultOggSeeker.java
+++ b/mobile/android/geckoview/src/thirdparty/java/com/google/android/exoplayer2/extractor/ogg/DefaultOggSeeker.java
@@ -71,17 +71,16 @@ import java.io.IOException;
       totalGranules = firstPayloadPageGranulePosition;
       state = STATE_IDLE;
     } else {
       state = STATE_SEEK_TO_END;
     }
   }
 
   @Override
-  @SuppressWarnings("fallthrough")
   public long read(ExtractorInput input) throws IOException, InterruptedException {
     switch (state) {
       case STATE_IDLE:
         return -1;
       case STATE_SEEK_TO_END:
         positionBeforeSeekToEnd = input.getPosition();
         state = STATE_READ_LAST_PAGE;
         // Seek to the end just before the last page of stream to get the duration.
--- a/mobile/android/geckoview_example/src/androidTest/java/org/mozilla/geckoview_example/GeckoViewActivityTest.java
+++ b/mobile/android/geckoview_example/src/androidTest/java/org/mozilla/geckoview_example/GeckoViewActivityTest.java
@@ -17,16 +17,16 @@ import static android.support.test.espre
 import static android.support.test.espresso.assertion.ViewAssertions.matches;
 import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
 import static android.support.test.espresso.matcher.ViewMatchers.withId;
 
 @RunWith(AndroidJUnit4.class)
 public class GeckoViewActivityTest {
 
     @Rule
-    public ActivityTestRule<GeckoViewActivity> mActivityRule = new ActivityTestRule<>(GeckoViewActivity.class);
+    public ActivityTestRule<GeckoViewActivity> mActivityRule = new ActivityTestRule(GeckoViewActivity.class);
 
     @Test
     public void testA() throws InterruptedException {
         onView(withId(R.id.gecko_view))
                 .check(matches(isDisplayed()));
     }
 }
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/ExtendedJSONObject.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/sync/ExtendedJSONObject.java
@@ -266,17 +266,18 @@ public class ExtendedJSONObject implemen
   }
 
   @Override
   public String toString() {
     return this.object.toString();
   }
 
   protected void putRaw(String key, Object value) {
-    Map<String, Object> map = this.object;
+    @SuppressWarnings("unchecked")
+    Map<Object, Object> map = this.object;
     map.put(key, value);
   }
 
   public void put(String key, String value) {
     this.putRaw(key, value);
   }
 
   public void put(String key, boolean value) {
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/MetaGlobal.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/sync/MetaGlobal.java
@@ -255,17 +255,17 @@ public class MetaGlobal {
     return new HashSet<String>(engines.keySet());
   }
 
   @SuppressWarnings("unchecked")
   public Set<String> getDeclinedEngineNames() {
     if (declined == null) {
       return null;
     }
-    return new HashSet<String>((Collection<String>) (Collection) declined);
+    return new HashSet<String>(declined);
   }
 
   /**
    * Returns if the server settings and local settings match.
    * Throws a specific MetaGlobalException if that's not the case.
    */
   public void verifyEngineSettings(String engineName, EngineSettings engineSettings)
   throws MetaGlobalException {
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/android/BookmarksSessionHelper.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/android/BookmarksSessionHelper.java
@@ -662,18 +662,17 @@ import java.util.concurrent.ConcurrentHa
                     Logger.debug(LOG_TAG, "Untracking and bumping " + guid + "(" + folderID + ")");
                     dbAccessor.bumpModified(folderID, RepositorySession.now());
                     session.untrackGUID(guid);
                 }
 
                 // If the arrays are different, or they're the same but not flushed to disk,
                 // write them out now.
                 if (!sameArrays || !clean) {
-                    final ArrayList<String> list = (ArrayList<String>) (ArrayList) onServer;
-                    dbAccessor.updatePositions(new ArrayList<>(list));
+                    dbAccessor.updatePositions(new ArrayList<>(onServer));
                 }
             } catch (Exception e) {
                 Logger.warn(LOG_TAG, "Error repositioning children for " + guid, e);
             }
         }
     }
 
     private void flushQueues(RepositorySessionStoreDelegate delegate) {
@@ -1098,18 +1097,17 @@ import java.util.concurrent.ConcurrentHa
 
             if (!persist) {
                 Logger.debug(LOG_TAG, "Returned array does not match database, and not persisting.");
                 return false;
             }
 
             Logger.debug(LOG_TAG, "Generating child array required moving records. Updating DB.");
             final long time = RepositorySession.now();
-            final ArrayList<String> cArray = (ArrayList<String>) (ArrayList) childArray;
-            if (0 < dbAccessor.updatePositions(cArray)) {
+            if (0 < dbAccessor.updatePositions(childArray)) {
                 Logger.debug(LOG_TAG, "Bumping parent time to " + time + ".");
                 dbAccessor.bumpModified(folderID, time);
             }
             return true;
         } finally {
             children.close();
         }
     }
--- a/mobile/android/services/src/test/java/org/mozilla/gecko/sync/repositories/android/VisitsHelperTest.java
+++ b/mobile/android/services/src/test/java/org/mozilla/gecko/sync/repositories/android/VisitsHelperTest.java
@@ -133,9 +133,9 @@ public class VisitsHelperTest {
             VisitsHelper.getVisitContentValues("testGUID", visit4, false);
             assertTrue("Must check that visit type and date keys are present", false);
         } catch (IllegalArgumentException e) {}
     }
 
     private Uri testUri(Uri baseUri) {
         return baseUri.buildUpon().appendQueryParameter(BrowserContract.PARAM_IS_TEST, "1").build();
     }
-}
+}
\ No newline at end of file
--- a/mobile/android/services/src/test/java/org/mozilla/gecko/sync/stage/test/TestFetchMetaGlobalStage.java
+++ b/mobile/android/services/src/test/java/org/mozilla/gecko/sync/stage/test/TestFetchMetaGlobalStage.java
@@ -35,17 +35,16 @@ import org.mozilla.gecko.sync.net.AuthHe
 import org.mozilla.gecko.sync.stage.FetchMetaGlobalStage;
 import org.mozilla.gecko.sync.stage.GlobalSyncStage.Stage;
 import org.robolectric.RobolectricTestRunner;
 import org.simpleframework.http.Request;
 import org.simpleframework.http.Response;
 
 import java.io.IOException;
 import java.net.URI;
-import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -296,17 +295,17 @@ public class TestFetchMetaGlobalStage {
     // Set declined engines in the server object.
     final JSONArray testingDeclinedEngines = makeTestDeclinedArray();
     mg.setDeclinedEngineNames(testingDeclinedEngines);
 
     MockServer server = new MockServer(200, mg.asCryptoRecord().toJSONString());
     doSession(server);
 
     // Declined engines propagate from the server meta/global, and are NOT merged.
-    final Set<String> expected = new HashSet<String>((ArrayList) testingDeclinedEngines);
+    final Set<String> expected = new HashSet<String>(testingDeclinedEngines);
     // expected.add("baznoo");   // Not until we merge. Local is lost.
 
     final Set<String> newDeclined = session.config.metaGlobal.getDeclinedEngineNames();
     assertEquals(expected, newDeclined);
   }
 
   @Test
   public void testFetchMissing() throws Exception {
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/BaseRobocopTest.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/BaseRobocopTest.java
@@ -244,17 +244,17 @@ public abstract class BaseRobocopTest ex
     public void throwIfHttpGetFails() {
         if (getTestType() == Type.TALOS) {
             return;
         }
 
         // rawURL to test fetching from. This should be a raw (IP) URL, not an alias
         // (like mochi.test). We can't (easily) test fetching from the aliases, since
         // those are managed by Fennec's proxy settings.
-        final String rawUrl = mConfig.get("rawhost").replaceAll("(/$)", "");
+        final String rawUrl = ((String) mConfig.get("rawhost")).replaceAll("(/$)", "");
 
         HttpURLConnection urlConnection = null;
 
         try {
             urlConnection = (HttpURLConnection) new URL(rawUrl).openConnection();
 
             final int statusCode = urlConnection.getResponseCode();
             if (200 != statusCode) {
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/MediaPlaybackTest.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/MediaPlaybackTest.java
@@ -270,26 +270,26 @@ abstract class MediaPlaybackTest extends
         }
     }
 
     protected final AudioFocusAgent getAudioFocusAgent() {
         return AudioFocusAgent.getInstance();
     }
 
     protected final void requestAudioFocus() {
-        AudioFocusAgent.notifyStartedPlaying();
+        getAudioFocusAgent().notifyStartedPlaying();
         if (getAudioFocusAgent().getAudioFocusState() == State.OWN_FOCUS) {
             return;
         }
 
         // Request audio focus might fail, depend on the andriod's audio mode.
         waitForCondition(new Condition() {
             @Override
             public boolean isSatisfied() {
-                AudioFocusAgent.notifyStartedPlaying();
+                getAudioFocusAgent().notifyStartedPlaying();
                 return getAudioFocusAgent().getAudioFocusState() == State.OWN_FOCUS;
             }
         }, MAX_WAIT_MS);
     }
 
     /**
      * The method NotificationManager.getActiveNotifications() is only avaiable
      * after version 23, so we need to check version ensure running the test on
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/SessionTest.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/SessionTest.java
@@ -34,17 +34,16 @@ public abstract class SessionTest extend
     /**
      * A generic session object representing a collection of items that has a
      * selected index.
      */
     protected abstract class SessionObject<T> {
         private final int mIndex;
         private final T[] mItems;
 
-        @SuppressWarnings({"unchecked", "varargs"})
         public SessionObject(int index, T... items) {
             mIndex = index;
             mItems = items;
         }
 
         public int getIndex() {
             return mIndex;
         }
@@ -133,17 +132,17 @@ public abstract class SessionTest extend
 
         /**
          * Callback executed for each forward step of the walk.
          */
         public void goForward() {}
     }
 
     protected Session createTestSession(int selectedTabIndex) {
-        PageInfo home = new PageInfo(mStringHelper.STATIC_ABOUT_HOME_URL);
+        PageInfo home = new PageInfo(StringHelper.STATIC_ABOUT_HOME_URL);
         PageInfo page1 = new PageInfo("page1");
         PageInfo page2 = new PageInfo("page2");
         PageInfo page3 = new PageInfo("page3");
         PageInfo page4 = new PageInfo("page4");
         PageInfo page5 = new PageInfo("page5");
         PageInfo page6 = new PageInfo("page6");
 
         SessionTab tab1 = new SessionTab(0, home, page1, page2);
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/StringHelper.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/StringHelper.java
@@ -8,51 +8,51 @@ package org.mozilla.gecko.tests;
 import android.content.res.Resources;
 
 import org.mozilla.gecko.R;
 
 public class StringHelper {
     private static StringHelper instance;
 
     // This needs to be accessed statically, before an instance of StringHelper can be created.
-    public final String STATIC_ABOUT_HOME_URL = "about:home";
+    public static final String STATIC_ABOUT_HOME_URL = "about:home";
 
     public final String OK;
     public final String CANCEL;
     public final String CLEAR;
 
     // Note: DEFAULT_BOOKMARKS_TITLES.length == DEFAULT_BOOKMARKS_URLS.length
     public final String[] DEFAULT_BOOKMARKS_TITLES;
     public final String[] DEFAULT_BOOKMARKS_URLS;
     public final int DEFAULT_BOOKMARKS_COUNT;
 
     // About pages
-    public final String ABOUT_BLANK_URL = "about:blank";
+    public static final String ABOUT_BLANK_URL = "about:blank";
     public final String ABOUT_FIREFOX_URL;
-    public final String ABOUT_HOME_URL = "about:home";
-    public final String ABOUT_ADDONS_URL = "about:addons";
-    public final String ABOUT_SCHEME = "about:";
+    public static final String ABOUT_HOME_URL = "about:home";
+    public static final String ABOUT_ADDONS_URL = "about:addons";
+    public static final String ABOUT_SCHEME = "about:";
 
     // About pages' titles
-    public final String ABOUT_HOME_TITLE = "";
+    public static final String ABOUT_HOME_TITLE = "";
 
     // Context Menu item strings
-    public final String CONTEXT_MENU_BOOKMARK_LINK = "Bookmark Link";
-    public final String CONTEXT_MENU_OPEN_LINK_IN_NEW_TAB = "Open Link in New Tab";
+    public static final String CONTEXT_MENU_BOOKMARK_LINK = "Bookmark Link";
+    public static final String CONTEXT_MENU_OPEN_LINK_IN_NEW_TAB = "Open Link in New Tab";
     public final String CONTEXT_MENU_OPEN_IN_NEW_TAB;
-    public final String CONTEXT_MENU_OPEN_LINK_IN_PRIVATE_TAB = "Open Link in Private Tab";
+    public static final String CONTEXT_MENU_OPEN_LINK_IN_PRIVATE_TAB = "Open Link in Private Tab";
     public final String CONTEXT_MENU_OPEN_IN_PRIVATE_TAB;
-    public final String CONTEXT_MENU_COPY_LINK = "Copy Link";
-    public final String CONTEXT_MENU_SHARE_LINK = "Share Link";
+    public static final String CONTEXT_MENU_COPY_LINK = "Copy Link";
+    public static final String CONTEXT_MENU_SHARE_LINK = "Share Link";
     public final String CONTEXT_MENU_EDIT;
     public final String CONTEXT_MENU_SHARE;
     public final String CONTEXT_MENU_REMOVE;
     public final String CONTEXT_MENU_COPY_ADDRESS;
     public final String CONTEXT_MENU_EDIT_SITE_SETTINGS;
-    public final String CONTEXT_MENU_SITE_SETTINGS_SAVE_PASSWORD = "Save Password";
+    public static final String CONTEXT_MENU_SITE_SETTINGS_SAVE_PASSWORD = "Save Password";
     public final String CONTEXT_MENU_ADD_TO_HOME_SCREEN;
     public final String CONTEXT_MENU_PIN_SITE;
     public final String CONTEXT_MENU_UNPIN_SITE;
 
     // Context Menu menu items
     public final String[] CONTEXT_MENU_ITEMS_IN_PRIVATE_TAB;
 
     public final String[] CONTEXT_MENU_ITEMS_IN_NORMAL_TAB;
@@ -60,71 +60,71 @@ public class StringHelper {
     public final String[] BOOKMARK_CONTEXT_MENU_ITEMS;
 
     public final String[] CONTEXT_MENU_ITEMS_IN_URL_BAR;
 
     public final String TITLE_PLACE_HOLDER;
 
     // Robocop page urls
     // Note: please use getAbsoluteUrl(String url) on each robocop url to get the correct url
-    public final String ROBOCOP_BIG_LINK_URL = "/robocop/robocop_big_link.html";
-    public final String ROBOCOP_BIG_MAILTO_URL = "/robocop/robocop_big_mailto.html";
-    public final String ROBOCOP_BLANK_PAGE_01_URL = "/robocop/robocop_blank_01.html";
-    public final String ROBOCOP_BLANK_PAGE_02_URL = "/robocop/robocop_blank_02.html";
-    public final String ROBOCOP_BLANK_PAGE_03_URL = "/robocop/robocop_blank_03.html";
-    public final String ROBOCOP_BLANK_PAGE_04_URL = "/robocop/robocop_blank_04.html";
-    public final String ROBOCOP_BLANK_PAGE_05_URL = "/robocop/robocop_blank_05.html";
-    public final String ROBOCOP_BOXES_URL = "/robocop/robocop_boxes.html";
-    public final String ROBOCOP_GEOLOCATION_URL = "/robocop/robocop_geolocation.html";
-    public final String ROBOCOP_LOGIN_01_URL= "/robocop/robocop_login_01.html";
-    public final String ROBOCOP_LOGIN_02_URL= "/robocop/robocop_login_02.html";
-    public final String ROBOCOP_POPUP_URL = "/robocop/robocop_popup.html";
-    public final String ROBOCOP_OFFLINE_STORAGE_URL = "/robocop/robocop_offline_storage.html";
-    public final String ROBOCOP_PICTURE_LINK_URL = "/robocop/robocop_picture_link.html";
-    public final String ROBOCOP_SEARCH_URL = "/robocop/robocop_search.html";
-    public final String ROBOCOP_TEXT_PAGE_URL = "/robocop/robocop_text_page.html";
-    public final String ROBOCOP_INPUT_URL = "/robocop/robocop_input.html";
-    public final String ROBOCOP_READER_MODE_BASIC_ARTICLE = "/robocop/reader_mode_pages/basic_article.html";
-    public final String ROBOCOP_LINK_TO_SLOW_LOADING = "/robocop/robocop_link_to_slow_loading.html";
-    public final String ROBOCOP_MEDIA_PLAYBACK_JS_URL = "/robocop/robocop_media_playback_js.html";
-    public final String ROBOCOP_MEDIA_PLAYBACK_LOOP_URL = "/robocop/robocop_media_playback_loop.html";
+    public static final String ROBOCOP_BIG_LINK_URL = "/robocop/robocop_big_link.html";
+    public static final String ROBOCOP_BIG_MAILTO_URL = "/robocop/robocop_big_mailto.html";
+    public static final String ROBOCOP_BLANK_PAGE_01_URL = "/robocop/robocop_blank_01.html";
+    public static final String ROBOCOP_BLANK_PAGE_02_URL = "/robocop/robocop_blank_02.html";
+    public static final String ROBOCOP_BLANK_PAGE_03_URL = "/robocop/robocop_blank_03.html";
+    public static final String ROBOCOP_BLANK_PAGE_04_URL = "/robocop/robocop_blank_04.html";
+    public static final String ROBOCOP_BLANK_PAGE_05_URL = "/robocop/robocop_blank_05.html";
+    public static final String ROBOCOP_BOXES_URL = "/robocop/robocop_boxes.html";
+    public static final String ROBOCOP_GEOLOCATION_URL = "/robocop/robocop_geolocation.html";
+    public static final String ROBOCOP_LOGIN_01_URL= "/robocop/robocop_login_01.html";
+    public static final String ROBOCOP_LOGIN_02_URL= "/robocop/robocop_login_02.html";
+    public static final String ROBOCOP_POPUP_URL = "/robocop/robocop_popup.html";
+    public static final String ROBOCOP_OFFLINE_STORAGE_URL = "/robocop/robocop_offline_storage.html";
+    public static final String ROBOCOP_PICTURE_LINK_URL = "/robocop/robocop_picture_link.html";
+    public static final String ROBOCOP_SEARCH_URL = "/robocop/robocop_search.html";
+    public static final String ROBOCOP_TEXT_PAGE_URL = "/robocop/robocop_text_page.html";
+    public static final String ROBOCOP_INPUT_URL = "/robocop/robocop_input.html";
+    public static final String ROBOCOP_READER_MODE_BASIC_ARTICLE = "/robocop/reader_mode_pages/basic_article.html";
+    public static final String ROBOCOP_LINK_TO_SLOW_LOADING = "/robocop/robocop_link_to_slow_loading.html";
+    public static final String ROBOCOP_MEDIA_PLAYBACK_JS_URL = "/robocop/robocop_media_playback_js.html";
+    public static final String ROBOCOP_MEDIA_PLAYBACK_LOOP_URL = "/robocop/robocop_media_playback_loop.html";
 
-    private final String ROBOCOP_JS_HARNESS_URL = "/robocop/robocop_javascript.html";
+    private static final String ROBOCOP_JS_HARNESS_URL = "/robocop/robocop_javascript.html";
 
     // Robocop page images
-    public final String ROBOCOP_PICTURE_URL = "/robocop/Firefox.jpg";
+    public static final String ROBOCOP_PICTURE_URL = "/robocop/Firefox.jpg";
 
     // Robocop page titles
-    public final String ROBOCOP_BIG_LINK_TITLE = "Big Link";
-    public final String ROBOCOP_BIG_MAILTO_TITLE = "Big Mailto";
-    public final String ROBOCOP_BLANK_PAGE_01_TITLE = "Browser Blank Page 01";
-    public final String ROBOCOP_BLANK_PAGE_02_TITLE = "Browser Blank Page 02";
-    public final String ROBOCOP_GEOLOCATION_TITLE = "Geolocation Test Page";
-    public final String ROBOCOP_PICTURE_LINK_TITLE = "Picture Link";
-    public final String ROBOCOP_SEARCH_TITLE = "Robocop Search Engine";
+    public static final String ROBOCOP_BIG_LINK_TITLE = "Big Link";
+    public static final String ROBOCOP_BIG_MAILTO_TITLE = "Big Mailto";
+    public static final String ROBOCOP_BLANK_PAGE_01_TITLE = "Browser Blank Page 01";
+    public static final String ROBOCOP_BLANK_PAGE_02_TITLE = "Browser Blank Page 02";
+    public static final String ROBOCOP_GEOLOCATION_TITLE = "Geolocation Test Page";
+    public static final String ROBOCOP_PICTURE_LINK_TITLE = "Picture Link";
+    public static final String ROBOCOP_SEARCH_TITLE = "Robocop Search Engine";
 
     // Distribution tile labels
-    public final String DISTRIBUTION1_LABEL = "Distribution 1";
-    public final String DISTRIBUTION2_LABEL = "Distribution 2";
+    public static final String DISTRIBUTION1_LABEL = "Distribution 1";
+    public static final String DISTRIBUTION2_LABEL = "Distribution 2";
 
     // Settings menu strings
     public final String GENERAL_SECTION_LABEL;
     public final String SEARCH_SECTION_LABEL;
     public final String PRIVACY_SECTION_LABEL;
     public final String ACCESSIBILITY_SECTION_LABEL;
     public final String NOTIFICATIONS_SECTION_LABEL;
     public final String ADVANCED_SECTION_LABEL;
     public final String CLEAR_PRIVATE_DATA_SECTION_LABEL;
     public final String DEFAULT_BROWSER_SECTION_LABEL;
     public final String MOZILLA_SECTION_LABEL;
 
     // Mozilla
-    public final String BRAND_NAME = "(Fennec|Nightly|Firefox Aurora|Firefox Beta|Firefox)";
-    public final String ABOUT_LABEL = "About " + BRAND_NAME ;
-    public final String LOCATION_SERVICES_LABEL = "Mozilla Location Service";
+    public static final String BRAND_NAME = "(Fennec|Nightly|Firefox Aurora|Firefox Beta|Firefox)";
+    public static final String ABOUT_LABEL = "About " + BRAND_NAME ;
+    public static final String LOCATION_SERVICES_LABEL = "Mozilla Location Service";
 
     // Labels for the about:home tabs
     public final String HISTORY_LABEL;
     public final String TOP_SITES_LABEL;
     public final String BOOKMARKS_LABEL;
     public final String TODAY_LABEL;
 
     // Desktop default bookmarks folders
@@ -150,49 +150,49 @@ public class StringHelper {
     public final String TAB_QUEUE_LABEL;
     public final String TAB_QUEUE_SUMMARY;
 
     // Android 3.0+
     public final String TOOLS_LABEL;
     public final String PAGE_LABEL;
 
     // Android 2.3 and lower only
-    public final String MORE_LABEL = "More";
+    public static final String MORE_LABEL = "More";
     public final String RELOAD_LABEL;
     public final String FORWARD_LABEL;
     public final String BOOKMARK_LABEL;
 
     // Bookmark Toast Notification
     public final String BOOKMARK_ADDED_LABEL;
     public final String BOOKMARK_REMOVED_LABEL;
     public final String BOOKMARK_UPDATED_LABEL;
     public final String BOOKMARK_OPTIONS_LABEL;
 
     // Edit Bookmark screen
     public final String EDIT_BOOKMARK;
 
     // Strings used in doorhanger messages and buttons
-    public final String GEO_MESSAGE = "Share your location with";
+    public static final String GEO_MESSAGE = "Share your location with";
     public final String GEO_ALLOW;
-    public final String GEO_DENY = "Don't share";
+    public static final String GEO_DENY = "Don't share";
 
-    public final String OFFLINE_MESSAGE = "to store data on your device for offline use";
-    public final String OFFLINE_ALLOW = "Allow";
-    public final String OFFLINE_DENY = "Don't allow";
+    public static final String OFFLINE_MESSAGE = "to store data on your device for offline use";
+    public static final String OFFLINE_ALLOW = "Allow";
+    public static final String OFFLINE_DENY = "Don't allow";
 
-    public final String LOGIN_MESSAGE = "Would you like " + BRAND_NAME + " to remember this login?";
-    public final String LOGIN_ALLOW = "Remember";
-    public final String LOGIN_DENY = "Never";
+    public static final String LOGIN_MESSAGE = "Would you like " + BRAND_NAME + " to remember this login?";
+    public static final String LOGIN_ALLOW = "Remember";
+    public static final String LOGIN_DENY = "Never";
 
-    public final String POPUP_MESSAGE = "prevented this site from opening";
+    public static final String POPUP_MESSAGE = "prevented this site from opening";
     public final String POPUP_ALLOW;
-    public final String POPUP_DENY = "Don't show";
+    public static final String POPUP_DENY = "Don't show";
 
     // Strings used as content description, e.g. for ImageButtons
-    public final String CONTENT_DESCRIPTION_READER_MODE_BUTTON = "Enter Reader View";
+    public static final String CONTENT_DESCRIPTION_READER_MODE_BUTTON = "Enter Reader View";
 
     // Home Panel Settings
     public final String CUSTOMIZE_HOME;
     public final String ENABLED;
     public final String HISTORY;
     public final String PANELS;
 
     // General Settings
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/helpers/WaitHelper.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/helpers/WaitHelper.java
@@ -77,35 +77,34 @@ public final class WaitHelper {
      * duration; will throw an AssertionError if the duration is elapsed and the callable has not
      * returned a non-null object.
      *
      * @return the value returned by the Callable. Or null if the duration has elapsed.
      */
     public static <V> V waitFor(String message, final Callable<V> callable, int waitMillis) {
         sContext.dumpLog("WaitHelper", "Waiting for " + message + " with timeout " + waitMillis + ".");
 
-        @SuppressWarnings("unchecked")
-        final V[] value = (V[]) new Object[1];
+        final Object[] value = new Object[1];
 
         Condition condition = new Condition() {
             @Override
             public boolean isSatisfied() {
                 try {
                     V result = callable.call();
                     value[0] = result;
                     return result != null;
                 } catch (Exception e) {
                     return false;
                 }
             }
         };
 
         sSolo.waitForCondition(condition, waitMillis);
 
-        return value[0];
+        return (V) value[0];
     }
 
     /**
      * Waits for the Gecko event declaring the page has loaded. Takes in and runs a Runnable
      * that will perform the action that will cause the page to load.
      */
     public static void waitForPageLoad(final Runnable initiatingAction) {
         fAssertNotNull("initiatingAction is not null", initiatingAction);
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testAudioFocus.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testAudioFocus.java
@@ -1,17 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.tests;
 
 import org.mozilla.gecko.Tab;
 import org.mozilla.gecko.Tabs;
-import org.mozilla.gecko.media.AudioFocusAgent;
 import org.mozilla.gecko.media.AudioFocusAgent.State;
 
 import android.media.AudioManager;
 
 public class testAudioFocus extends MediaPlaybackTest {
     public void testAudioFocus() {
         info("- wait for gecko ready -");
         blockForGeckoReady();
@@ -79,17 +78,17 @@ public class testAudioFocus extends Medi
 
         info("- request audio focus -");
         requestAudioFocus();
         mAsserter.is(getAudioFocusAgent().getAudioFocusState(),
                      State.OWN_FOCUS,
                      "Should own audio focus.");
 
         info("- abandon audio focus -");
-        AudioFocusAgent.notifyStoppedPlaying();
+        getAudioFocusAgent().notifyStoppedPlaying();
         mAsserter.is(getAudioFocusAgent().getAudioFocusState(),
                      State.LOST_FOCUS,
                      "Should lose audio focus.");
     }
 
     private void testAudioFocusChanged() {
         info("- check audio focus in the beginning -");
         mAsserter.is(getAudioFocusAgent().getAudioFocusState(),
--- a/mobile/android/thirdparty/org/json/simple/JSONArray.java
+++ b/mobile/android/thirdparty/org/json/simple/JSONArray.java
@@ -11,17 +11,17 @@ import java.util.Iterator;
 import java.util.List;
 
 
 /**
  * A JSON array. JSONObject supports java.util.List interface.
  * 
  * @author FangYidong<fangyidong@yahoo.com.cn>
  */
-public class JSONArray extends ArrayList<Object> implements List<Object>, JSONAware, JSONStreamAware {
+public class JSONArray extends ArrayList implements List, JSONAware, JSONStreamAware {
 	private static final long serialVersionUID = 3957988303675231981L;
 
     /**
      * Encode a list into JSON text and write it to out. 
      * If this list is also a JSONStreamAware or a JSONAware, JSONStreamAware and JSONAware specific behaviours will be ignored at this top level.
      * 
      * @see org.json.simple.JSONValue#writeJSONString(Object, Writer)
      * 
--- a/mobile/android/thirdparty/org/json/simple/JSONObject.java
+++ b/mobile/android/thirdparty/org/json/simple/JSONObject.java
@@ -10,17 +10,17 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
 /**
  * A JSON object. Key value pairs are unordered. JSONObject supports java.util.Map interface.
  * 
  * @author FangYidong<fangyidong@yahoo.com.cn>
  */
-public class JSONObject extends HashMap<String, Object> implements Map<String, Object>, JSONAware, JSONStreamAware{
+public class JSONObject extends HashMap implements Map, JSONAware, JSONStreamAware{
 	private static final long serialVersionUID = -503443796854799292L;
 
     /**
      * Encode a map into JSON text and write it to out.
      * If this map is also a JSONAware or JSONStreamAware, JSONAware or JSONStreamAware specific behaviours will be ignored at this top level.
      * 
      * @see org.json.simple.JSONValue#writeJSONString(Object, Writer)
      *