Silence some deprecation linter warnings

This commit is contained in:
Darryl Pogue 2018-09-26 00:30:42 -07:00 committed by Darryl Pogue
parent f1f1ac3cbd
commit 47bb5184a0
No known key found for this signature in database
GPG Key ID: CB824715C3E6FD41
4 changed files with 13 additions and 3 deletions

View File

@ -144,7 +144,7 @@ public class CoreAndroid extends CordovaPlugin {
public void clearCache() {
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
webView.clearCache(true);
webView.clearCache();
}
});
}

View File

@ -58,7 +58,11 @@ class SystemCookieManager implements ICordovaCookieManager {
}
public void clearCookies() {
cookieManager.removeAllCookie();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
cookieManager.removeAllCookies(null);
} else {
cookieManager.removeAllCookie();
}
}
public void flush() {

View File

@ -142,6 +142,7 @@ public class SystemWebChromeClient extends WebChromeClient {
* Handle database quota exceeded notification.
*/
@Override
@SuppressWarnings("deprecation")
public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
{
@ -180,11 +181,13 @@ public class SystemWebChromeClient extends WebChromeClient {
// API level 7 is required for this, see if we could lower this using something else
@Override
@SuppressWarnings("deprecation")
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
parentEngine.getCordovaWebView().showCustomView(view, callback);
}
@Override
@SuppressWarnings("deprecation")
public void onHideCustomView() {
parentEngine.getCordovaWebView().hideCustomView();
}

View File

@ -74,7 +74,8 @@ public class SystemWebViewClient extends WebViewClient {
* @param url The url to be loaded.
* @return true to override, false for default behavior
*/
@Override
@Override
@SuppressWarnings("deprecation")
public boolean shouldOverrideUrlLoading(WebView view, String url) {
return parentEngine.client.onNavigationAttempt(url);
}
@ -186,6 +187,7 @@ public class SystemWebViewClient extends WebViewClient {
* @param failingUrl The url that failed to load.
*/
@Override
@SuppressWarnings("deprecation")
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
// Ignore error due to stopLoading().
if (!isCurrentlyLoading) {
@ -316,6 +318,7 @@ public class SystemWebViewClient extends WebViewClient {
}
@Override
@SuppressWarnings("deprecation")
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
try {
// Check the against the whitelist and lock out access to the WebView directory