Skip to content

Commit baf09c0

Browse files
committed
Silence some deprecation linter warnings
1 parent 514e120 commit baf09c0

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

framework/src/org/apache/cordova/CoreAndroid.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ else if (action.equals("messageChannel")) {
144144
public void clearCache() {
145145
cordova.getActivity().runOnUiThread(new Runnable() {
146146
public void run() {
147-
webView.clearCache(true);
147+
webView.clearCache();
148148
}
149149
});
150150
}

framework/src/org/apache/cordova/engine/SystemCookieManager.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ public String getCookie(final String url) {
5858
}
5959

6060
public void clearCookies() {
61-
cookieManager.removeAllCookie();
61+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
62+
cookieManager.removeAllCookies(null);
63+
} else {
64+
cookieManager.removeAllCookie();
65+
}
6266
}
6367

6468
public void flush() {

framework/src/org/apache/cordova/engine/SystemWebChromeClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public void gotResult(boolean success, String value) {
142142
* Handle database quota exceeded notification.
143143
*/
144144
@Override
145+
@SuppressWarnings("deprecation")
145146
public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
146147
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
147148
{
@@ -180,11 +181,13 @@ public void onGeolocationPermissionsShowPrompt(String origin, Callback callback)
180181

181182
// API level 7 is required for this, see if we could lower this using something else
182183
@Override
184+
@SuppressWarnings("deprecation")
183185
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
184186
parentEngine.getCordovaWebView().showCustomView(view, callback);
185187
}
186188

187189
@Override
190+
@SuppressWarnings("deprecation")
188191
public void onHideCustomView() {
189192
parentEngine.getCordovaWebView().hideCustomView();
190193
}

framework/src/org/apache/cordova/engine/SystemWebViewClient.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public SystemWebViewClient(SystemWebViewEngine parentEngine) {
7474
* @param url The url to be loaded.
7575
* @return true to override, false for default behavior
7676
*/
77-
@Override
77+
@Override
78+
@SuppressWarnings("deprecation")
7879
public boolean shouldOverrideUrlLoading(WebView view, String url) {
7980
return parentEngine.client.onNavigationAttempt(url);
8081
}
@@ -186,6 +187,7 @@ public void onPageFinished(WebView view, String url) {
186187
* @param failingUrl The url that failed to load.
187188
*/
188189
@Override
190+
@SuppressWarnings("deprecation")
189191
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
190192
// Ignore error due to stopLoading().
191193
if (!isCurrentlyLoading) {
@@ -316,6 +318,7 @@ public void clearAuthenticationTokens() {
316318
}
317319

318320
@Override
321+
@SuppressWarnings("deprecation")
319322
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
320323
try {
321324
// Check the against the whitelist and lock out access to the WebView directory

0 commit comments

Comments
 (0)