resolve merge conflicts of af6b251 to master

Test: ./gradlew assemble
Change-Id: Ia446e8590bead2f5ffa3dd97e27c59885a5e4bbe
diff --git a/build.gradle b/build.gradle
index 2d5b6d9..23511d2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -105,6 +105,10 @@
 task(prepareRepo) << {
 }
 
+// lint every library
+task(lint) << {
+}
+
 
 import com.google.common.io.Files
 import com.google.common.base.Charsets
@@ -292,6 +296,7 @@
             // enable code coverage for debug builds only if we are not running inside the IDE
             // enabling coverage reports breaks the method parameter resolution in the IDE debugger
             project.android.buildTypes.debug.testCoverageEnabled = !hasProperty('android.injected.invoked.from.ide')
+
             // Copy the class files in a jar to be later used to generate code coverage report
             project.android.testVariants.all { v ->
                 // check if the variant has any source files
@@ -320,6 +325,11 @@
                     v.assemble.dependsOn jarifyTask, copyJacocoAnt
                 }
             }
+
+            // Ensure we run API lint checks.
+            project.android.lintOptions.check 'NewApi'
+            project.android.lintOptions.fatal 'NewApi'
+            project.parent.lint.dependsOn project.lint
         }
 
         // Create release and separate zip task for Android libraries (and android-annotations,
diff --git a/compat/build.gradle b/compat/build.gradle
index 2f43b54..5722998 100644
--- a/compat/build.gradle
+++ b/compat/build.gradle
@@ -54,11 +54,6 @@
         androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
     }
 
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
-
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
diff --git a/core-ui/build.gradle b/core-ui/build.gradle
index 56afd5e..89796ea 100644
--- a/core-ui/build.gradle
+++ b/core-ui/build.gradle
@@ -43,11 +43,6 @@
         androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
     }
 
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
-
     buildTypes.all {
         consumerProguardFiles 'proguard-rules.pro'
     }
diff --git a/core-ui/java/android/support/v4/widget/SwipeRefreshLayout.java b/core-ui/java/android/support/v4/widget/SwipeRefreshLayout.java
index 4ebdeed..107b9e0 100644
--- a/core-ui/java/android/support/v4/widget/SwipeRefreshLayout.java
+++ b/core-ui/java/android/support/v4/widget/SwipeRefreshLayout.java
@@ -16,8 +16,8 @@
 
 package android.support.v4.widget;
 
+import android.annotation.SuppressLint;
 import android.content.Context;
-import android.content.res.Resources;
 import android.content.res.TypedArray;
 import android.support.annotation.ColorInt;
 import android.support.annotation.ColorRes;
@@ -177,6 +177,7 @@
         public void onAnimationRepeat(Animation animation) {
         }
 
+        @SuppressLint("NewApi")
         @Override
         public void onAnimationEnd(Animation animation) {
             if (mRefreshing) {
@@ -224,6 +225,7 @@
         reset();
     }
 
+    @SuppressLint("NewApi")
     private void setColorViewAlpha(int targetAlpha) {
         mCircleView.getBackground().setAlpha(targetAlpha);
         mProgress.setAlpha(targetAlpha);
@@ -425,6 +427,7 @@
         }
     }
 
+    @SuppressLint("NewApi")
     private void startScaleUpAnimation(AnimationListener listener) {
         mCircleView.setVisibility(View.VISIBLE);
         if (android.os.Build.VERSION.SDK_INT >= 11) {
@@ -486,14 +489,17 @@
         mCircleView.startAnimation(mScaleDownAnimation);
     }
 
+    @SuppressLint("NewApi")
     private void startProgressAlphaStartAnimation() {
         mAlphaStartAnimation = startAlphaAnimation(mProgress.getAlpha(), STARTING_PROGRESS_ALPHA);
     }
 
+    @SuppressLint("NewApi")
     private void startProgressAlphaMaxAnimation() {
         mAlphaMaxAnimation = startAlphaAnimation(mProgress.getAlpha(), MAX_ALPHA);
     }
 
+    @SuppressLint("NewApi")
     private Animation startAlphaAnimation(final int startingAlpha, final int endingAlpha) {
         // Pre API 11, alpha is used in place of scale. Don't also use it to
         // show the trigger point.
@@ -925,6 +931,7 @@
         return animation != null && animation.hasStarted() && !animation.hasEnded();
     }
 
+    @SuppressLint("NewApi")
     private void moveSpinner(float overscrollTop) {
         mProgress.showArrow(true);
         float originalDragPercent = overscrollTop / mTotalDragDistance;
@@ -1086,6 +1093,7 @@
         return true;
     }
 
+    @SuppressLint("NewApi")
     private void startDragging(float y) {
         final float yDiff = y - mInitialDownY;
         if (yDiff > mTouchSlop && !mIsBeingDragged) {
@@ -1155,6 +1163,7 @@
         }
     };
 
+    @SuppressLint("NewApi")
     private void startScaleDownReturnToStartAnimation(int from,
             Animation.AnimationListener listener) {
         mFrom = from;
diff --git a/core-utils/build.gradle b/core-utils/build.gradle
index 97325a1..750cf49 100644
--- a/core-utils/build.gradle
+++ b/core-utils/build.gradle
@@ -44,11 +44,6 @@
         androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
     }
 
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
-
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
diff --git a/customtabs/build.gradle b/customtabs/build.gradle
index 98f3076..a409dba 100644
--- a/customtabs/build.gradle
+++ b/customtabs/build.gradle
@@ -34,10 +34,6 @@
         androidTest.java.srcDir('tests/src/')
     }
 
-    lintOptions {
-        abortOnError false
-    }
-
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
diff --git a/design/build.gradle b/design/build.gradle
index 1f35a60..b848203 100644
--- a/design/build.gradle
+++ b/design/build.gradle
@@ -63,11 +63,6 @@
         targetCompatibility JavaVersion.VERSION_1_7
     }
 
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
-
     buildTypes.all {
         consumerProguardFiles 'proguard-rules.pro'
     }
diff --git a/design/res/values/styles.xml b/design/res/values/styles.xml
index 1e13d47..a8d0981 100644
--- a/design/res/values/styles.xml
+++ b/design/res/values/styles.xml
@@ -14,7 +14,7 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
 -->
-<resources>
+<resources xmlns:tools="http://schemas.android.com/tools">
 
     <style name="Widget.Design.FloatingActionButton" parent="android:Widget">
         <item name="android:background">@drawable/design_fab_background</item>
@@ -129,7 +129,7 @@
 
     <style name="Widget.Design.BottomSheet.Modal" parent="android:Widget">
         <item name="android:background">?android:attr/colorBackground</item>
-        <item name="android:elevation">@dimen/design_bottom_sheet_modal_elevation</item>
+        <item tools:ignore="NewApi" name="android:elevation">@dimen/design_bottom_sheet_modal_elevation</item>
         <item name="behavior_peekHeight">auto</item>
         <item name="behavior_hideable">true</item>
         <item name="behavior_skipCollapsed">false</item>
diff --git a/fragment/build.gradle b/fragment/build.gradle
index 0a862d4..26e9f1c 100644
--- a/fragment/build.gradle
+++ b/fragment/build.gradle
@@ -46,11 +46,6 @@
         androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
     }
 
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
-
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
diff --git a/fragment/java/android/support/v4/app/FragmentActivity.java b/fragment/java/android/support/v4/app/FragmentActivity.java
index 50fa584..b1dec03 100644
--- a/fragment/java/android/support/v4/app/FragmentActivity.java
+++ b/fragment/java/android/support/v4/app/FragmentActivity.java
@@ -18,6 +18,7 @@
 
 import static android.support.annotation.RestrictTo.Scope.GROUP_ID;
 
+import android.annotation.SuppressLint;
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
@@ -1008,6 +1009,7 @@
             super(FragmentActivity.this /*fragmentActivity*/);
         }
 
+        @SuppressLint("NewApi")
         @Override
         public void onDump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
             FragmentActivity.this.dump(prefix, fd, writer, args);
diff --git a/gradlew b/gradlew
index 9d82f78..f942e0b 100755
--- a/gradlew
+++ b/gradlew
@@ -6,8 +6,15 @@
 ##
 ##############################################################################
 
+# Pick the correct fullsdk for this OS.
+if [ $os = "Darwin" ]; then
+    plat="darwin"
+else
+    plat="linux"
+fi
+DEFAULT_JVM_OPTS="-DLINT_API_DATABASE=../../prebuilts/fullsdk-$plat/platform-tools/api/api-versions.xml"
+
 # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
 
 APP_NAME="Gradle"
 APP_BASE_NAME=`basename "$0"`
diff --git a/graphics/drawable/animated/build.gradle b/graphics/drawable/animated/build.gradle
index 13c590f..bb110a1 100644
--- a/graphics/drawable/animated/build.gradle
+++ b/graphics/drawable/animated/build.gradle
@@ -37,10 +37,6 @@
         targetCompatibility JavaVersion.VERSION_1_7
     }
 
-    lintOptions {
-        abortOnError false
-    }
-
     aaptOptions {
         additionalParameters "--no-version-vectors"
     }
diff --git a/graphics/drawable/animated/src/android/support/graphics/drawable/AnimatedVectorDrawableCompat.java b/graphics/drawable/animated/src/android/support/graphics/drawable/AnimatedVectorDrawableCompat.java
index 8800036..8c0a7be 100644
--- a/graphics/drawable/animated/src/android/support/graphics/drawable/AnimatedVectorDrawableCompat.java
+++ b/graphics/drawable/animated/src/android/support/graphics/drawable/AnimatedVectorDrawableCompat.java
@@ -19,6 +19,7 @@
 import android.animation.AnimatorSet;
 import android.animation.ArgbEvaluator;
 import android.animation.ObjectAnimator;
+import android.annotation.SuppressLint;
 import android.content.Context;
 import android.content.res.ColorStateList;
 import android.content.res.Resources;
@@ -61,6 +62,7 @@
  * API. In order to refer to AnimatedVectorDrawableCompat inside a XML file, you can use
  * app:srcCompat attribute in AppCompat library's ImageButton or ImageView.
  */
+@SuppressLint("NewApi")
 public class AnimatedVectorDrawableCompat extends VectorDrawableCommon implements Animatable {
     private static final String LOGTAG = "AnimatedVDCompat";
 
diff --git a/graphics/drawable/static/build.gradle b/graphics/drawable/static/build.gradle
index 24d0d50..2c72f9f 100644
--- a/graphics/drawable/static/build.gradle
+++ b/graphics/drawable/static/build.gradle
@@ -39,10 +39,6 @@
         targetCompatibility JavaVersion.VERSION_1_7
     }
 
-    lintOptions {
-        abortOnError false
-    }
-
     aaptOptions {
         additionalParameters "--no-version-vectors"
     }
diff --git a/graphics/drawable/static/src/android/support/graphics/drawable/VectorDrawableCompat.java b/graphics/drawable/static/src/android/support/graphics/drawable/VectorDrawableCompat.java
index 8c93919..58cce37 100644
--- a/graphics/drawable/static/src/android/support/graphics/drawable/VectorDrawableCompat.java
+++ b/graphics/drawable/static/src/android/support/graphics/drawable/VectorDrawableCompat.java
@@ -16,6 +16,7 @@
 
 import static android.support.annotation.RestrictTo.Scope.GROUP_ID;
 
+import android.annotation.SuppressLint;
 import android.content.res.ColorStateList;
 import android.content.res.Resources;
 import android.content.res.Resources.Theme;
@@ -418,6 +419,7 @@
         return new PorterDuffColorFilter(color, tintMode);
     }
 
+    @SuppressLint("NewApi")
     @Override
     public void setTint(int tint) {
         if (mDelegateDrawable != null) {
@@ -568,6 +570,7 @@
      * @param theme the theme of this vector drawable, it can be null.
      * @return a new VectorDrawableCompat or null if parsing error is found.
      */
+    @SuppressLint("NewApi")
     @Nullable
     public static VectorDrawableCompat create(@NonNull Resources res, @DrawableRes int resId,
                                               @Nullable Theme theme) {
@@ -605,6 +608,7 @@
      * document, tries to create a Drawable from that tag. Returns {@code null}
      * if the tag is not a valid drawable.
      */
+    @SuppressLint("NewApi")
     public static VectorDrawableCompat createFromXmlInner(Resources r, XmlPullParser parser,
             AttributeSet attrs, Theme theme) throws XmlPullParserException, IOException {
         final VectorDrawableCompat drawable = new VectorDrawableCompat();
@@ -619,6 +623,7 @@
         return color;
     }
 
+    @SuppressLint("NewApi")
     @Override
     public void inflate(Resources res, XmlPullParser parser, AttributeSet attrs)
             throws XmlPullParserException, IOException {
@@ -842,6 +847,7 @@
     }
 
     // We don't support RTL auto mirroring since the getLayoutDirection() is for API 17+.
+    @SuppressLint("NewApi")
     private boolean needMirroring() {
         if (Build.VERSION.SDK_INT < 17) {
             return false;
diff --git a/media-compat/build.gradle b/media-compat/build.gradle
index e210aa4..bddff30 100644
--- a/media-compat/build.gradle
+++ b/media-compat/build.gradle
@@ -41,11 +41,6 @@
         main.aidl.srcDirs = ['java']
     }
 
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
-
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
diff --git a/percent/build.gradle b/percent/build.gradle
index 4fe4630..c3f386e 100644
--- a/percent/build.gradle
+++ b/percent/build.gradle
@@ -39,10 +39,6 @@
         androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
     }
 
-    lintOptions {
-        abortOnError false
-    }
-
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
diff --git a/recommendation/build.gradle b/recommendation/build.gradle
index e356402..75d68d1 100644
--- a/recommendation/build.gradle
+++ b/recommendation/build.gradle
@@ -27,10 +27,6 @@
         androidTest.java.srcDir 'tests/src'
     }
 
-    lintOptions {
-        abortOnError false
-    }
-
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
diff --git a/samples/Support13Demos/build.gradle b/samples/Support13Demos/build.gradle
index 3f78d64..1b58043 100644
--- a/samples/Support13Demos/build.gradle
+++ b/samples/Support13Demos/build.gradle
@@ -19,7 +19,6 @@
     }
 
     lintOptions {
-        // TODO: fix errors and reenable.
         abortOnError false
     }
 
diff --git a/samples/Support4Demos/build.gradle b/samples/Support4Demos/build.gradle
index 26d8113..959968a 100644
--- a/samples/Support4Demos/build.gradle
+++ b/samples/Support4Demos/build.gradle
@@ -19,7 +19,6 @@
     }
 
     lintOptions {
-        // TODO: fix errors and reenable.
         abortOnError false
     }
 
diff --git a/samples/Support7Demos/build.gradle b/samples/Support7Demos/build.gradle
index ac8dc3c..d87479a 100644
--- a/samples/Support7Demos/build.gradle
+++ b/samples/Support7Demos/build.gradle
@@ -24,7 +24,6 @@
     }
 
     lintOptions {
-        // TODO: fix errors and reenable.
         abortOnError false
     }
 
diff --git a/samples/SupportDesignDemos/build.gradle b/samples/SupportDesignDemos/build.gradle
index 163bb61..b03e63e 100644
--- a/samples/SupportDesignDemos/build.gradle
+++ b/samples/SupportDesignDemos/build.gradle
@@ -19,7 +19,6 @@
     }
 
     lintOptions {
-        // TODO: fix errors and reenable.
         abortOnError false
     }
 
diff --git a/samples/SupportLeanbackDemos/build.gradle b/samples/SupportLeanbackDemos/build.gradle
index 67cfe4d..e0cc44b 100644
--- a/samples/SupportLeanbackDemos/build.gradle
+++ b/samples/SupportLeanbackDemos/build.gradle
@@ -20,7 +20,6 @@
     }
 
     lintOptions {
-        // TODO: fix errors and reenable.
         abortOnError false
     }
 
diff --git a/samples/SupportPercentDemos/build.gradle b/samples/SupportPercentDemos/build.gradle
index a31b343..e3caf1d 100644
--- a/samples/SupportPercentDemos/build.gradle
+++ b/samples/SupportPercentDemos/build.gradle
@@ -19,7 +19,6 @@
     }
 
     lintOptions {
-        // TODO: fix errors and reenable.
         abortOnError false
     }
 
diff --git a/samples/SupportPreferenceDemos/build.gradle b/samples/SupportPreferenceDemos/build.gradle
index 717532a..e59a348 100644
--- a/samples/SupportPreferenceDemos/build.gradle
+++ b/samples/SupportPreferenceDemos/build.gradle
@@ -24,7 +24,6 @@
     }
 
     lintOptions {
-        // TODO: fix errors and reenable.
         abortOnError false
     }
 
diff --git a/samples/SupportTransitionDemos/build.gradle b/samples/SupportTransitionDemos/build.gradle
index c3131ff..5ebdc1b 100644
--- a/samples/SupportTransitionDemos/build.gradle
+++ b/samples/SupportTransitionDemos/build.gradle
@@ -20,7 +20,6 @@
     }
 
     lintOptions {
-        // TODO: fix errors and reenable.
         abortOnError false
     }
 
diff --git a/transition/build.gradle b/transition/build.gradle
index 4d4e96f..05675f9 100644
--- a/transition/build.gradle
+++ b/transition/build.gradle
@@ -51,11 +51,6 @@
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
     }
-
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
 }
 
 android.libraryVariants.all { variant ->
diff --git a/v13/build.gradle b/v13/build.gradle
index 694d767..85aa8a8 100644
--- a/v13/build.gradle
+++ b/v13/build.gradle
@@ -41,11 +41,6 @@
         androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
     }
 
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
-
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
diff --git a/v14/preference/build.gradle b/v14/preference/build.gradle
index 33d616e..a7e63d5 100644
--- a/v14/preference/build.gradle
+++ b/v14/preference/build.gradle
@@ -52,11 +52,6 @@
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
     }
-
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
 }
 
 android.libraryVariants.all { variant ->
diff --git a/v14/preference/res/layout/preference_widget_switch.xml b/v14/preference/res/layout/preference_widget_switch.xml
index afc4351..47e9397 100644
--- a/v14/preference/res/layout/preference_widget_switch.xml
+++ b/v14/preference/res/layout/preference_widget_switch.xml
@@ -18,9 +18,11 @@
 <!-- Layout used by SwitchPreference for the switch widget style. This is inflated
      inside android.R.layout.preference. -->
 <Switch xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@android:id/switch_widget"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:focusable="false"
-    android:clickable="false"
-    android:background="@null" />
+        xmlns:tools="http://schemas.android.com/tools"
+        tools:ignore="NewApi"
+        android:id="@android:id/switch_widget"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:focusable="false"
+        android:clickable="false"
+        android:background="@null" />
diff --git a/v14/preference/res/values/styles.xml b/v14/preference/res/values/styles.xml
index a83417a..baef67f 100644
--- a/v14/preference/res/values/styles.xml
+++ b/v14/preference/res/values/styles.xml
@@ -15,7 +15,7 @@
   ~ limitations under the License
   -->
 
-<resources>
+<resources xmlns:tools="http://schemas.android.com/tools">
     <style name="Preference.SwitchPreference">
         <item name="android:widgetLayout">@layout/preference_widget_switch</item>
         <item name="android:switchTextOn">@string/v7_preference_on</item>
@@ -66,14 +66,14 @@
 
     <style name="Preference_TextAppearanceMaterialBody2">
         <item name="android:textSize">14sp</item>
-        <item name="android:fontFamily">sans-serif</item>
+        <item tools:ignore="NewApi" name="android:fontFamily">sans-serif</item>
         <item name="android:textColor">?android:attr/textColorPrimary</item>
         <item name="android:textStyle">normal</item>
     </style>
 
     <style name="Preference_TextAppearanceMaterialSubhead">
         <item name="android:textSize">16sp</item>
-        <item name="android:fontFamily">sans-serif</item>
+        <item tools:ignore="NewApi" name="android:fontFamily">sans-serif</item>
         <item name="android:textColor">?android:attr/textColorPrimary</item>
         <item name="android:textStyle">normal</item>
     </style>
diff --git a/v17/leanback/build.gradle b/v17/leanback/build.gradle
index 270f552..f5befa7 100644
--- a/v17/leanback/build.gradle
+++ b/v17/leanback/build.gradle
@@ -45,15 +45,15 @@
         androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
     }
 
+    lintOptions {
+        // Remove this once all NewApi breakages have been fixed.
+        disable "NewApi"
+    }
+
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
     }
-
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
 }
 
 android.libraryVariants.all { variant ->
diff --git a/v17/preference-leanback/build.gradle b/v17/preference-leanback/build.gradle
index 2f4ec5b..9bfd0f3 100644
--- a/v17/preference-leanback/build.gradle
+++ b/v17/preference-leanback/build.gradle
@@ -22,18 +22,10 @@
         main.res.srcDir 'res'
     }
 
-    lintOptions {
-    }
-
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
     }
-
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
 }
 
 android.libraryVariants.all { variant ->
diff --git a/v4/build.gradle b/v4/build.gradle
index a55aed5..f0226e3 100644
--- a/v4/build.gradle
+++ b/v4/build.gradle
@@ -23,10 +23,6 @@
         main.manifest.srcFile 'AndroidManifest.xml'
     }
 
-    lintOptions {
-        abortOnError false
-    }
-
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
diff --git a/v7/appcompat/build.gradle b/v7/appcompat/build.gradle
index e6bb42b..aa62632 100644
--- a/v7/appcompat/build.gradle
+++ b/v7/appcompat/build.gradle
@@ -51,11 +51,6 @@
     aaptOptions {
         additionalParameters "--no-version-vectors"
     }
-
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
 }
 
 android.libraryVariants.all { variant ->
diff --git a/v7/appcompat/src/android/support/v7/widget/AppCompatDrawableManager.java b/v7/appcompat/src/android/support/v7/widget/AppCompatDrawableManager.java
index 1e943e9..6e916bc 100644
--- a/v7/appcompat/src/android/support/v7/widget/AppCompatDrawableManager.java
+++ b/v7/appcompat/src/android/support/v7/widget/AppCompatDrawableManager.java
@@ -23,6 +23,7 @@
 import static android.support.v7.widget.ThemeUtils.getThemeAttrColor;
 import static android.support.v7.widget.ThemeUtils.getThemeAttrColorStateList;
 
+import android.annotation.SuppressLint;
 import android.annotation.TargetApi;
 import android.content.Context;
 import android.content.res.ColorStateList;
@@ -738,6 +739,7 @@
         VdcInflateDelegate() {
         }
 
+        @SuppressLint("NewApi")
         @Override
         public Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser,
                 @NonNull AttributeSet attrs, @Nullable Resources.Theme theme) {
@@ -757,6 +759,7 @@
         AvdcInflateDelegate() {
         }
 
+        @SuppressLint("NewApi")
         @Override
         public Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser,
                 @NonNull AttributeSet attrs, @Nullable Resources.Theme theme) {
diff --git a/v7/cardview/build.gradle b/v7/cardview/build.gradle
index 12f9e39..b88aad7 100644
--- a/v7/cardview/build.gradle
+++ b/v7/cardview/build.gradle
@@ -22,20 +22,12 @@
                 'src'
         ]
         main.res.srcDir 'res'
-
-        androidTest.setRoot('tests')
-        androidTest.java.srcDir 'tests/java'
     }
 
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
     }
-
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
 }
 
 android.libraryVariants.all { variant ->
diff --git a/v7/gridlayout/build.gradle b/v7/gridlayout/build.gradle
index a2c3d36..542d5a7 100644
--- a/v7/gridlayout/build.gradle
+++ b/v7/gridlayout/build.gradle
@@ -42,11 +42,6 @@
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
     }
-
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
 }
 
 
diff --git a/v7/mediarouter/build.gradle b/v7/mediarouter/build.gradle
index 61a5985..6b63089 100644
--- a/v7/mediarouter/build.gradle
+++ b/v7/mediarouter/build.gradle
@@ -29,11 +29,6 @@
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
     }
-
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
 }
 
 android.libraryVariants.all { variant ->
diff --git a/v7/palette/build.gradle b/v7/palette/build.gradle
index c89953b..2494370 100644
--- a/v7/palette/build.gradle
+++ b/v7/palette/build.gradle
@@ -20,11 +20,6 @@
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
     }
 
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
-
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_7
         targetCompatibility JavaVersion.VERSION_1_7
diff --git a/v7/preference/build.gradle b/v7/preference/build.gradle
index 55fe020..a63cc9e 100644
--- a/v7/preference/build.gradle
+++ b/v7/preference/build.gradle
@@ -63,8 +63,8 @@
     }
 
     lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
+        // Remove this once all NewApi breakages have been fixed.
+        disable "NewApi"
     }
 
     buildTypes.all {
diff --git a/v7/recyclerview/build.gradle b/v7/recyclerview/build.gradle
index 4f8ca35..11a098e 100644
--- a/v7/recyclerview/build.gradle
+++ b/v7/recyclerview/build.gradle
@@ -47,11 +47,6 @@
         targetCompatibility JavaVersion.VERSION_1_7
     }
 
-    lintOptions {
-        // TODO: fix errors and reenable.
-        abortOnError false
-    }
-
     packagingOptions {
         exclude 'LICENSE.txt'
     }
diff --git a/v7/recyclerview/src/android/support/v7/widget/DividerItemDecoration.java b/v7/recyclerview/src/android/support/v7/widget/DividerItemDecoration.java
index 6229b20..b3b7cd1 100644
--- a/v7/recyclerview/src/android/support/v7/widget/DividerItemDecoration.java
+++ b/v7/recyclerview/src/android/support/v7/widget/DividerItemDecoration.java
@@ -17,6 +17,7 @@
 
 package android.support.v7.widget;
 
+import android.annotation.SuppressLint;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.Canvas;
@@ -105,6 +106,7 @@
         }
     }
 
+    @SuppressLint("NewApi")
     private void drawVertical(Canvas canvas, RecyclerView parent) {
         canvas.save();
         final int left;
@@ -131,6 +133,7 @@
         canvas.restore();
     }
 
+    @SuppressLint("NewApi")
     private void drawHorizontal(Canvas canvas, RecyclerView parent) {
         canvas.save();
         final int top;
diff --git a/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java b/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java
index 4a9fab0..06b4465 100644
--- a/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java
+++ b/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java
@@ -901,6 +901,7 @@
      *
      * @attr name android:clipToPadding
      */
+    @Override
     public boolean getClipToPadding() {
         return mClipToPadding;
     }