Skip to content

Commit

Permalink
Silence some deprecation linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dpogue committed Nov 6, 2018
1 parent 004ba3f commit 58f46de
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion framework/src/org/apache/cordova/CoreAndroid.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ else if (action.equals("messageChannel")) {
public void clearCache() {
cordova.getActivity().runOnUiThread(new Runnable() {
public void run() {
webView.clearCache(true);
webView.clearCache();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ public String getCookie(final String url) {
}

public void clearCookies() {
cookieManager.removeAllCookie();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
cookieManager.removeAllCookies(null);
} else {
cookieManager.removeAllCookie();
}
}

public void flush() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public void gotResult(boolean success, String value) {
* Handle database quota exceeded notification.
*/
@Override
@SuppressWarnings("deprecation")
public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
{
Expand Down Expand Up @@ -180,11 +181,13 @@ public void onGeolocationPermissionsShowPrompt(String origin, Callback callback)

// 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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public SystemWebViewClient(SystemWebViewEngine parentEngine) {
* @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);
}
Expand Down Expand Up @@ -186,6 +187,7 @@ public void onPageFinished(WebView view, String url) {
* @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) {
Expand Down Expand Up @@ -316,6 +318,7 @@ public void clearAuthenticationTokens() {
}

@Override
@SuppressWarnings("deprecation")
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
try {
// Check the against the whitelist and lock out access to the WebView directory
Expand Down

0 comments on commit 58f46de

Please sign in to comment.