X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Factivities%2FMainWebViewActivity.java;h=1635e5df8bcd5e772862d7733f8c4b65a572c2ab;hp=f9f1780f61c8575eec3a8671a2ac88d5be000073;hb=5917df154b320eadd4c2d935baf30f98fd6055c4;hpb=d277b46fdd35b734dcace8c20ee9db431d2aa1da diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index f9f1780f..1635e5df 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -363,7 +363,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook // Get the screenshot preference. String appTheme = sharedPreferences.getString("app_theme", getString(R.string.app_theme_default_value)); - boolean allowScreenshots = sharedPreferences.getBoolean("allow_screenshots", false); + boolean allowScreenshots = sharedPreferences.getBoolean(getString(R.string.allow_screenshots_key), false); // Get the theme entry values string array. String[] appThemeEntryValuesStringArray = getResources().getStringArray(R.array.app_theme_entry_values); @@ -4963,6 +4963,19 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook } } + // Clear the logcat. + if (clearEverything || sharedPreferences.getBoolean(getString(R.string.clear_logcat_key), true)) { + try { + // Clear the logcat. `-c` clears the logcat. `-b all` clears all the buffers (instead of just crash, main, and system). + Process process = Runtime.getRuntime().exec("logcat -b all -c"); + + // Wait for the process to finish. + process.waitFor(); + } catch (IOException|InterruptedException exception) { + // Do nothing. + } + } + // Clear the cache. if (clearEverything || sharedPreferences.getBoolean("clear_cache", true)) { // Clear the cache from each WebView.