Backed out 3 changesets (bug 1457255) for bustage on Android builds on a CLOSED TREE
authorGurzau Raul <rgurzau@mozilla.com>
Mon, 30 Apr 2018 16:30:18 +0300
changeset 416336 076e2b91083973a1fb8c8a79bc36b7c5f3cc4bca
parent 416335 d486c0db4626d70c909bbc57a9dc013b222a7163
child 416337 59f4e493272fbd3d4029bb8e58f641e7d4cb8e27
push id102755
push useraiakab@mozilla.com
push dateMon, 30 Apr 2018 22:22:53 +0000
treeherdermozilla-inbound@184a937c196e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1457255
milestone61.0a1
backs outd486c0db4626d70c909bbc57a9dc013b222a7163
ed06c8833608c41c9962e11af663f852c4f20833
f179720d3440eec20ab72e35bb7c4fc479fe4b51
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
Backed out 3 changesets (bug 1457255) for bustage on Android builds on a CLOSED TREE Backed out changeset d486c0db4626 (bug 1457255) Backed out changeset ed06c8833608 (bug 1457255) Backed out changeset f179720d3440 (bug 1457255)
build.gradle
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
mobile/android/base/java/org/mozilla/gecko/Tabs.java
mobile/android/base/java/org/mozilla/gecko/activitystream/ActivityStreamTelemetry.java
mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
mobile/android/base/java/org/mozilla/gecko/db/TabsProvider.java
mobile/android/base/java/org/mozilla/gecko/dlc/BaseAction.java
mobile/android/base/java/org/mozilla/gecko/dlc/DownloadAction.java
mobile/android/base/java/org/mozilla/gecko/tabs/TabStrip.java
mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
mobile/android/geckoview/build.gradle
mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/rule/GeckoSessionTestRule.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/PanZoomController.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/SessionAccessibility.java
mobile/android/geckoview/src/thirdparty/java/com/google/android/exoplayer2/extractor/ogg/DefaultOggSeeker.java
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/BaseRobocopTest.java
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/MediaPlaybackTest.java
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/SessionTest.java
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/StringHelper.java
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/helpers/WaitHelper.java
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testAudioFocus.java
--- 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/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 :" + 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());
+            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());
+                    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/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(),