From 75c069fff97856ba6b6f1da3b8fb695958d345c2 Mon Sep 17 00:00:00 2001 From: owlishDeveloper Date: Mon, 8 Mar 2021 17:24:11 +0000 Subject: [PATCH] Bug 1658988 - Close tab in ContentDelegate#onCloseRequest instead of finishing the activity to keep GVE from going into background r=geckoview-reviewers,agi Differential Revision: https://phabricator.services.mozilla.com/D107484 --- .../org/mozilla/geckoview_example/GeckoViewActivity.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java b/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java index 1490de2a2b42..6b8db3e00aad 100644 --- a/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java +++ b/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java @@ -1538,8 +1538,9 @@ public class GeckoViewActivity @Override public void onCloseRequest(final GeckoSession session) { - if (session == mTabSessionManager.getCurrentSession()) { - finish(); + final TabSession currentSession = mTabSessionManager.getCurrentSession(); + if (session == currentSession) { + closeTab(currentSession); } }