From 0a4d81f7e23c86db6ffbd44c8dae237dd7796ceb Mon Sep 17 00:00:00 2001 From: Anthony Restaino Date: Sun, 22 Nov 2015 22:17:36 -0500 Subject: [PATCH] perform exit cleanup when browser is closed regardless of whether last tab is deleted or not --- .../java/acr/browser/lightning/activity/BrowserActivity.java | 2 +- .../java/acr/browser/lightning/activity/IncognitoActivity.java | 1 + .../main/java/acr/browser/lightning/activity/MainActivity.java | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java b/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java index 6795c49..9996aa3 100644 --- a/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java +++ b/app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java @@ -1068,7 +1068,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements Log.d(Constants.TAG, "deleted tab"); } - private void performExitCleanUp() { + public void performExitCleanUp() { final LightningView currentTab = mTabsManager.getCurrentTab(); if (mPreferences.getClearCacheExit() && currentTab != null && !isIncognito()) { WebUtils.clearCache(currentTab.getWebView()); diff --git a/app/src/main/java/acr/browser/lightning/activity/IncognitoActivity.java b/app/src/main/java/acr/browser/lightning/activity/IncognitoActivity.java index f9e44b9..185dff5 100644 --- a/app/src/main/java/acr/browser/lightning/activity/IncognitoActivity.java +++ b/app/src/main/java/acr/browser/lightning/activity/IncognitoActivity.java @@ -58,6 +58,7 @@ public class IncognitoActivity extends BrowserActivity { @Override public void closeActivity() { closeDrawers(); + performExitCleanUp(); finish(); } } diff --git a/app/src/main/java/acr/browser/lightning/activity/MainActivity.java b/app/src/main/java/acr/browser/lightning/activity/MainActivity.java index 4d45d15..87a3573 100644 --- a/app/src/main/java/acr/browser/lightning/activity/MainActivity.java +++ b/app/src/main/java/acr/browser/lightning/activity/MainActivity.java @@ -59,6 +59,7 @@ public class MainActivity extends BrowserActivity { @Override public void closeActivity() { closeDrawers(); + performExitCleanUp(); moveTaskToBack(true); }