Backed out changeset 0aed878e34d4 (bug 888482) for intermittent Android 2.2 reftest failures.

This commit is contained in:
Ryan VanderMeulen 2013-08-27 18:03:38 -04:00
parent 63a1031be7
commit 97c35bb14d
2 changed files with 33 additions and 38 deletions

View File

@ -413,10 +413,6 @@ abstract public class BrowserApp extends GeckoApp
super.onCreate(savedInstanceState);
mBrowserToolbar = (BrowserToolbar) findViewById(R.id.browser_toolbar);
mBrowserToolbar.updateBackButton(false);
mBrowserToolbar.updateForwardButton(false);
mDoorHangerPopup.setAnchor(mBrowserToolbar.mFavicon);
((GeckoApp.MainLayout) mMainLayout).setTouchEventInterceptor(new HideTabsTouchListener());
((GeckoApp.MainLayout) mMainLayout).setMotionEventInterceptor(new MotionEventInterceptor() {
@ -798,6 +794,11 @@ abstract public class BrowserApp extends GeckoApp
protected void initializeChrome() {
super.initializeChrome();
mBrowserToolbar.updateBackButton(false);
mBrowserToolbar.updateForwardButton(false);
mDoorHangerPopup.setAnchor(mBrowserToolbar.mFavicon);
// Listen to margin changes to position the toolbar correctly
if (isDynamicToolbarEnabled()) {
refreshToolbarHeight();

View File

@ -1218,6 +1218,13 @@ abstract public class GeckoApp
return;
}
if (GeckoThread.isCreated()) {
// This happens when the GeckoApp activity is destroyed by Android
// without killing the entire application (see Bug 769269).
mIsRestoringActivity = true;
Telemetry.HistogramAdd("FENNEC_RESTORING_ACTIVITY", 1);
}
// Fix for Bug 830557 on Tegra boards running Froyo.
// This fix must be done before doing layout.
// Assume the bug is fixed in Gingerbread and up.
@ -1243,40 +1250,6 @@ abstract public class GeckoApp
mGeckoLayout = (RelativeLayout) findViewById(R.id.gecko_layout);
mMainLayout = (RelativeLayout) findViewById(R.id.main_layout);
initializeChrome();
if (GeckoThread.isCreated()) {
// This happens when the GeckoApp activity is destroyed by Android
// without killing the entire application (see Bug 769269).
mIsRestoringActivity = true;
Telemetry.HistogramAdd("FENNEC_RESTORING_ACTIVITY", 1);
} else {
String passedUri = null;
String uri = getURIFromIntent(intent);
if (uri != null && uri.length() > 0) {
passedUri = uri;
}
String action = intent.getAction();
GeckoThread.setArgs(intent.getStringExtra("args"));
GeckoThread.setAction(intent.getAction());
GeckoThread.setUri(passedUri);
if (!ACTION_DEBUG.equals(action) &&
GeckoThread.checkAndSetLaunchState(GeckoThread.LaunchState.Launching, GeckoThread.LaunchState.Launched)) {
GeckoThread.createAndStart();
} else if (ACTION_DEBUG.equals(action) &&
GeckoThread.checkAndSetLaunchState(GeckoThread.LaunchState.Launching, GeckoThread.LaunchState.WaitForDebugger)) {
ThreadUtils.getUiHandler().postDelayed(new Runnable() {
@Override
public void run() {
GeckoThread.setLaunchState(GeckoThread.LaunchState.Launching);
GeckoThread.createAndStart();
}
}, 1000 * 5 /* 5 seconds */);
}
}
// Set up tabs panel.
mTabsPanel = (TabsPanel) findViewById(R.id.tabs_panel);
mNotificationHelper = new NotificationHelper(this);
@ -1423,6 +1396,8 @@ abstract public class GeckoApp
Tabs.registerOnTabsChangedListener(this);
initializeChrome();
// If we are doing a restore, read the session data and send it to Gecko
String restoreMessage = null;
if (mRestoreMode != RESTORE_NONE && !mIsRestoringActivity) {
@ -1466,6 +1441,25 @@ abstract public class GeckoApp
Telemetry.HistogramAdd("FENNEC_STARTUP_GECKOAPP_ACTION", startupAction.ordinal());
if (!mIsRestoringActivity) {
GeckoThread.setArgs(intent.getStringExtra("args"));
GeckoThread.setAction(intent.getAction());
GeckoThread.setUri(passedUri);
}
if (!ACTION_DEBUG.equals(action) &&
GeckoThread.checkAndSetLaunchState(GeckoThread.LaunchState.Launching, GeckoThread.LaunchState.Launched)) {
GeckoThread.createAndStart();
} else if (ACTION_DEBUG.equals(action) &&
GeckoThread.checkAndSetLaunchState(GeckoThread.LaunchState.Launching, GeckoThread.LaunchState.WaitForDebugger)) {
ThreadUtils.getUiHandler().postDelayed(new Runnable() {
@Override
public void run() {
GeckoThread.setLaunchState(GeckoThread.LaunchState.Launching);
GeckoThread.createAndStart();
}
}, 1000 * 5 /* 5 seconds */);
}
// Check if launched from data reporting notification.
if (ACTION_LAUNCH_SETTINGS.equals(action)) {
Intent settingsIntent = new Intent(GeckoApp.this, GeckoPreferences.class);