Skip to content

Commit

Permalink
[webview] backport compileSdkVersion 33 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Kudo committed Oct 6, 2022
1 parent e26529f commit 9e3fdf5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,10 @@ public void setCacheEnabled(WebView view, boolean enabled) {
if (enabled) {
Context ctx = view.getContext();
if (ctx != null) {
view.getSettings().setAppCachePath(ctx.getCacheDir().getAbsolutePath());
view.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
view.getSettings().setAppCacheEnabled(true);
}
} else {
view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
view.getSettings().setAppCacheEnabled(false);
}
}

Expand Down Expand Up @@ -497,7 +494,6 @@ public void setIncognito(WebView view, boolean enabled) {

// Disable caching
view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
view.getSettings().setAppCacheEnabled(false);
view.clearHistory();
view.clearCache(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,10 @@ public void setCacheEnabled(WebView view, boolean enabled) {
if (enabled) {
Context ctx = view.getContext();
if (ctx != null) {
view.getSettings().setAppCachePath(ctx.getCacheDir().getAbsolutePath());
view.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
view.getSettings().setAppCacheEnabled(true);
}
} else {
view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
view.getSettings().setAppCacheEnabled(false);
}
}

Expand Down Expand Up @@ -521,7 +518,6 @@ public void setIncognito(WebView view, boolean enabled) {

// Disable caching
view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
view.getSettings().setAppCacheEnabled(false);
view.clearHistory();
view.clearCache(true);

Expand Down

0 comments on commit 9e3fdf5

Please sign in to comment.