mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
Make Cordova pass the Lint step
This commit is contained in:
parent
892b875867
commit
9e400911f5
@ -23,23 +23,10 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
// Switch the Android Gradle plugin version requirement depending on the
|
||||
// installed version of Gradle. This dependency is documented at
|
||||
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
|
||||
// and https://issues.apache.org/jira/browse/CB-8143
|
||||
if (gradle.gradleVersion >= "2.2") {
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.0.0+'
|
||||
}
|
||||
} else if (gradle.gradleVersion >= "2.1") {
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:0.14.0+'
|
||||
}
|
||||
} else {
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:0.12.0+'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
apply plugin: 'android-library'
|
||||
|
@ -26,6 +26,7 @@ import org.json.JSONObject;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
@ -330,6 +331,7 @@ public class CordovaActivity extends Activity {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@Override
|
||||
public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
|
||||
// Capture requestCode here so that it is captured in the setActivityResultCallback() case.
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.apache.cordova.engine;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.os.Build;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.WebView;
|
||||
@ -30,6 +31,8 @@ class SystemCookieManager implements ICordovaCookieManager {
|
||||
protected final WebView webView;
|
||||
private final CookieManager cookieManager;
|
||||
|
||||
//Added because lint can't see the conditional RIGHT ABOVE this
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public SystemCookieManager(WebView webview) {
|
||||
webView = webview;
|
||||
cookieManager = CookieManager.getInstance();
|
||||
|
@ -135,7 +135,7 @@ public class SystemWebViewEngine implements CordovaWebViewEngine {
|
||||
return webView;
|
||||
}
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
@SuppressLint({"NewApi", "SetJavaScriptEnabled"})
|
||||
@SuppressWarnings("deprecation")
|
||||
private void initWebViewSettings() {
|
||||
webView.setInitialScale(0);
|
||||
|
Loading…
Reference in New Issue
Block a user