mirror of
https://github.com/apache/cordova-android.git
synced 2025-03-04 00:13:20 +08:00
Silence some deprecation linter warnings
This commit is contained in:
parent
f1f1ac3cbd
commit
47bb5184a0
@ -144,7 +144,7 @@ public class CoreAndroid extends CordovaPlugin {
|
|||||||
public void clearCache() {
|
public void clearCache() {
|
||||||
cordova.getActivity().runOnUiThread(new Runnable() {
|
cordova.getActivity().runOnUiThread(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
webView.clearCache(true);
|
webView.clearCache();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -58,8 +58,12 @@ class SystemCookieManager implements ICordovaCookieManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void clearCookies() {
|
public void clearCookies() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
cookieManager.removeAllCookies(null);
|
||||||
|
} else {
|
||||||
cookieManager.removeAllCookie();
|
cookieManager.removeAllCookie();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void flush() {
|
public void flush() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
|
@ -142,6 +142,7 @@ public class SystemWebChromeClient extends WebChromeClient {
|
|||||||
* Handle database quota exceeded notification.
|
* Handle database quota exceeded notification.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
|
public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
|
||||||
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
|
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
|
// API level 7 is required for this, see if we could lower this using something else
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
|
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
|
||||||
parentEngine.getCordovaWebView().showCustomView(view, callback);
|
parentEngine.getCordovaWebView().showCustomView(view, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void onHideCustomView() {
|
public void onHideCustomView() {
|
||||||
parentEngine.getCordovaWebView().hideCustomView();
|
parentEngine.getCordovaWebView().hideCustomView();
|
||||||
}
|
}
|
||||||
|
@ -75,6 +75,7 @@ public class SystemWebViewClient extends WebViewClient {
|
|||||||
* @return true to override, false for default behavior
|
* @return true to override, false for default behavior
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
return parentEngine.client.onNavigationAttempt(url);
|
return parentEngine.client.onNavigationAttempt(url);
|
||||||
}
|
}
|
||||||
@ -186,6 +187,7 @@ public class SystemWebViewClient extends WebViewClient {
|
|||||||
* @param failingUrl The url that failed to load.
|
* @param failingUrl The url that failed to load.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
|
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
|
||||||
// Ignore error due to stopLoading().
|
// Ignore error due to stopLoading().
|
||||||
if (!isCurrentlyLoading) {
|
if (!isCurrentlyLoading) {
|
||||||
@ -316,6 +318,7 @@ public class SystemWebViewClient extends WebViewClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
|
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
|
||||||
try {
|
try {
|
||||||
// Check the against the whitelist and lock out access to the WebView directory
|
// Check the against the whitelist and lock out access to the WebView directory
|
||||||
|
Loading…
Reference in New Issue
Block a user