Bug 746630 - Clean up SetupScreen class now that we no longer use the timers. r=blassey a=blocking-fennec
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Thu, 19 Apr 2012 22:07:39 +0200
changeset 91998 47c706c98a825fb776152b3c76fc5513e79b8bda
parent 91997 41aa31e62e7b0a02dbf033dc228e1ac454d3d236
child 91999 df8d8d06a7bd19decb85ea3a166b332cf449fff4
push id22497
push usereakhgari@mozilla.com
push dateFri, 20 Apr 2012 17:10:37 +0000
treeherdermozilla-central@17af008937e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey, blocking-fennec
bugs746630
milestone14.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 746630 - Clean up SetupScreen class now that we no longer use the timers. r=blassey a=blocking-fennec
mobile/android/base/SetupScreen.java
--- a/mobile/android/base/SetupScreen.java
+++ b/mobile/android/base/SetupScreen.java
@@ -37,70 +37,28 @@
 
 package org.mozilla.gecko;
 
 import android.app.Dialog;
 import android.content.Context;
 import android.graphics.drawable.AnimationDrawable;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
-import android.os.Handler;
 import android.util.Log;
 import android.widget.ImageView;
-import java.util.Timer;
-import java.util.TimerTask;
 
 import org.mozilla.gecko.R;
 
 public class SetupScreen extends Dialog
 {
     private static final String LOGTAG = "SetupScreen";
-    // Default delay before showing dialog, in milliseconds
-    private static final int DEFAULT_DELAY = 100;
     private AnimationDrawable mProgressSpinner;
-    private Context mContext;
-    private Timer mTimer;
-    private TimerTask mShowTask;
-
-    public class ShowTask extends TimerTask {
-        private Handler mHandler;
-
-        public ShowTask(Handler aHandler) {
-            mHandler = aHandler;
-        }
-
-        @Override
-        public void run() {
-            mHandler.post(new Runnable() {
-                    public void run() {
-                        SetupScreen.this.show();
-                    }
-            });
-
-        }
-
-        @Override
-        public boolean cancel() {
-            boolean stillInQueue = super.cancel();
-            if (!stillInQueue) {
-                mHandler.post(new Runnable() {
-                        public void run() {
-                            // SetupScreen.dismiss calls us,
-                            // we need to call the real Dialog.dismiss.
-                            SetupScreen.super.dismiss();
-                        }
-                });
-            }
-            return stillInQueue;
-        }
-    }
 
     public SetupScreen(Context aContext) {
         super(aContext, android.R.style.Theme_NoTitleBar_Fullscreen);
-        mContext = aContext;
     }
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.setup_screen);
         setCancelable(false);
 
@@ -110,39 +68,9 @@ public class SetupScreen extends Dialog
         mProgressSpinner = (AnimationDrawable)spinnerImage.getBackground();
         spinnerImage.setImageDrawable(mProgressSpinner);
     }
 
     @Override
     public void onWindowFocusChanged (boolean hasFocus) {
         mProgressSpinner.start();
     }
-
-    public void showDelayed(Handler aHandler) {
-        showDelayed(aHandler, DEFAULT_DELAY);
-    }
-
-    // Delay showing the dialog until at least aDelay ms have
-    // passed. We need to know the handler to (eventually) post the UI
-    // actions on.
-    public void showDelayed(Handler aHandler, int aDelay) {
-        mTimer = new Timer("SetupScreen");
-        mShowTask = new ShowTask(aHandler);
-        mTimer.schedule(mShowTask, aDelay);
-    }
-
-    @Override
-    public void dismiss() {
-        // Cancel the timers/tasks if we were using showDelayed,
-        // and post to the correct handler.
-        if (mShowTask != null) {
-            mShowTask.cancel();
-            mShowTask = null;
-        } else {
-            // If not using showDelayed, just dismiss here.
-            super.dismiss();
-        }
-        if (mTimer != null) {
-            mTimer.cancel();
-            mTimer = null;
-        }
-    }
 }