Bug 1362191 - 4. Remove GeckoInterface.doRestart; r=me
authorJim Chen <nchen@mozilla.com>
Thu, 11 May 2017 16:39:30 -0400
changeset 357982 01cf56720e84ac0a35d1e207e85ca4b92167d7fc
parent 357981 632e8d8dd0774748b3ad40776f73d309dbded9aa
child 357983 cab30987328afd255f2b9bd08b6c420e7fabdaa0
push id31808
push usercbook@mozilla.com
push dateFri, 12 May 2017 12:37:49 +0000
treeherdermozilla-central@030c0a7c8781 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1362191
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1362191 - 4. Remove GeckoInterface.doRestart; r=me Remove GeckoInterface.doRestart now that it's no longer used.
mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/BaseGeckoInterface.java
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -2712,56 +2712,16 @@ public abstract class GeckoApp
         mRestartOnShutdown = restart;
 
         // Shut down the activity and then Gecko.
         if (!isFinishing() && (Versions.preJBMR1 || !isDestroyed())) {
             finish();
         }
     }
 
-    @Override
-    public void doRestart() {
-        doRestart(null, null);
-    }
-
-    public void doRestart(String args) {
-        doRestart(args, null);
-    }
-
-    public void doRestart(Intent intent) {
-        doRestart(null, intent);
-    }
-
-    public void doRestart(String args, Intent restartIntent) {
-        if (restartIntent == null) {
-            restartIntent = new Intent(Intent.ACTION_MAIN);
-        }
-
-        if (args != null) {
-            restartIntent.putExtra("args", args);
-        }
-
-        mRestartIntent = restartIntent;
-        Log.d(LOGTAG, "doRestart(\"" + restartIntent + "\")");
-
-        doShutdown();
-    }
-
-    private void doShutdown() {
-        // Shut down GeckoApp activity.
-        runOnUiThread(new Runnable() {
-            @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
-            @Override public void run() {
-                if (!isFinishing() && (Versions.preJBMR1 || !isDestroyed())) {
-                    finish();
-                }
-            }
-        });
-    }
-
     private void checkMigrateProfile() {
         final File profileDir = getProfile().getDir();
 
         if (profileDir != null) {
             ThreadUtils.postToBackgroundThread(new Runnable() {
                 @Override
                 public void run() {
                     Handler handler = new Handler();
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/BaseGeckoInterface.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/BaseGeckoInterface.java
@@ -44,20 +44,16 @@ public class BaseGeckoInterface implemen
     }
 
     @Override
     public String getDefaultUAString() {
         return HardwareUtils.isTablet() ? BuildConfig.USER_AGENT_GECKOVIEW_TABLET :
                                           BuildConfig.USER_AGENT_GECKOVIEW_MOBILE;
     }
 
-    // Bug 908775: Implement this
-    @Override
-    public void doRestart() {}
-
     @Override
     public void setFullScreen(final boolean fullscreen) {
         // This API doesn't make sense for GeckoView, so we do nothing for now.
     }
 
     // Bug 908779: Implement this
     @Override
     public void addPluginView(final View view) {}
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
@@ -1665,17 +1665,16 @@ public class GeckoAppShell
         public void onOrientationChanged();
     }
 
     public interface GeckoInterface {
         public @NonNull EventDispatcher getAppEventDispatcher();
         public GeckoProfile getProfile();
         public Activity getActivity();
         public String getDefaultUAString();
-        public void doRestart();
 
         /**
          * This API doesn't make sense for arbitrary GeckoView consumers. In future, consider an
          * API like Android WebView's, which provides a View to the consumer to display fullscreen.
          * See <a href="https://developer.android.com/reference/android/webkit/WebChromeClient.html#onShowCustomView(android.view.View,%20android.webkit.WebChromeClient.CustomViewCallback)">https://developer.android.com/reference/android/webkit/WebChromeClient.html#onShowCustomView(android.view.View,%20android.webkit.WebChromeClient.CustomViewCallback)</a>.
          */
         public void setFullScreen(boolean fullscreen);
         public void addPluginView(View view);