mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 16:22:00 +00:00
Backed out changeset b195f27085be (bug 1637351) for causing perma Raptor failures on Android. CLOSED TREE
This commit is contained in:
parent
a1bb0c4f87
commit
dfd9c0f72f
@ -30,7 +30,6 @@ import org.mozilla.geckoview.WebResponse;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
@ -896,7 +895,7 @@ public class GeckoViewActivity
|
||||
@Override
|
||||
public void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||
super.onRestoreInstanceState(savedInstanceState);
|
||||
if (savedInstanceState != null) {
|
||||
if(savedInstanceState != null) {
|
||||
mTabSessionManager.setCurrentSession((TabSession) mGeckoView.getSession());
|
||||
sGeckoRuntime.getWebExtensionController().setTabActive(mGeckoView.getSession(), true);
|
||||
} else {
|
||||
@ -1105,11 +1104,6 @@ public class GeckoViewActivity
|
||||
if (previousSession != null) {
|
||||
controller.setTabActive(previousSession, false);
|
||||
}
|
||||
if (!session.isOpen()) {
|
||||
// Session's process was previously killed; reopen
|
||||
session.open(sGeckoRuntime);
|
||||
session.loadUri(session.getUri());
|
||||
}
|
||||
mGeckoView.setSession(session);
|
||||
if (activateTab) {
|
||||
controller.setTabActive(session, true);
|
||||
@ -1254,13 +1248,6 @@ public class GeckoViewActivity
|
||||
return filename;
|
||||
}
|
||||
|
||||
private static boolean isForeground() {
|
||||
final ActivityManager.RunningAppProcessInfo appProcessInfo = new ActivityManager.RunningAppProcessInfo();
|
||||
ActivityManager.getMyMemoryState(appProcessInfo);
|
||||
return appProcessInfo.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND ||
|
||||
appProcessInfo.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_VISIBLE;
|
||||
}
|
||||
|
||||
private String mErrorTemplate;
|
||||
private String createErrorPage(final String error) {
|
||||
if (mErrorTemplate == null) {
|
||||
@ -1393,28 +1380,6 @@ public class GeckoViewActivity
|
||||
session.open(sGeckoRuntime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKill(GeckoSession session) {
|
||||
TabSession tabSession = mTabSessionManager.getSession(session);
|
||||
if (tabSession == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (tabSession != mTabSessionManager.getCurrentSession()) {
|
||||
Log.e(LOGTAG, "Background session killed");
|
||||
return;
|
||||
}
|
||||
|
||||
if (isForeground()) {
|
||||
throw new IllegalStateException("Foreground content process unexpectedly killed by OS!");
|
||||
}
|
||||
|
||||
Log.e(LOGTAG, "Current session killed, reopening");
|
||||
|
||||
tabSession.open(sGeckoRuntime);
|
||||
tabSession.loadUri(tabSession.getUri());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFirstComposite(final GeckoSession session) {
|
||||
Log.d(LOGTAG, "onFirstComposite");
|
||||
|
Loading…
Reference in New Issue
Block a user