[go: nahoru, domu]

Suppresses / fixes all unchecked javac errors and enables error tracking

Removes 'failOnUncheckedWarnings' config, preventing libraries
from opting out of unchecked warning tracking. These must either be
fixed or suppressed in the future.

Removes ./gradlew checkNoWarnings - all java compilation builds now fail
on unchecked warnings, and also deprecation warnings if the library hasn't
explicitly set failOnDeprecationWarnings = false in build.gradle.

Disables deprecation warnings for some libraries that have unsuppressed
errors.

Bumps savedstate annotation dependency to 1.1.0 to contain
LIBRARY_GROUP_PREFIX to remove warnings that were failing the build.

This should also help clean up build logs.

Bug: b/132352238
Test: ./gradlew compileDebugJavaWithJavac
Change-Id: I8444ecc5620779ddbcac19f2727039a8c7ac0c6e
diff --git a/appcompat/build.gradle b/appcompat/build.gradle
index 0895051..2ebf3afd 100644
--- a/appcompat/build.gradle
+++ b/appcompat/build.gradle
@@ -65,7 +65,6 @@
     mavenGroup = LibraryGroups.APPCOMPAT
     inceptionYear = "2011"
     description = "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren\'t a part of the framework APIs. Compatible on devices running API 14 or later."
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
     trackRestrictedAPIs = false
 }
diff --git a/appcompat/resources/build.gradle b/appcompat/resources/build.gradle
index e856cb9..b68e5bf 100644
--- a/appcompat/resources/build.gradle
+++ b/appcompat/resources/build.gradle
@@ -67,7 +67,6 @@
     mavenGroup = LibraryGroups.APPCOMPAT
     inceptionYear = "2019"
     description = "The Resources Library is a static library that you can add to your Android application in order to use resource APIs that backport the latest APIs to older versions of the platform. Compatible on devices running API 14 or later."
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
     trackRestrictedAPIs = false
 }
diff --git a/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegateImpl.java b/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegateImpl.java
index ec681f1..468d51d 100644
--- a/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegateImpl.java
+++ b/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegateImpl.java
@@ -459,7 +459,7 @@
         return mMenuInflater;
     }
 
-    @SuppressWarnings("TypeParameterUnusedInFormals")
+    @SuppressWarnings({"TypeParameterUnusedInFormals", "unchecked"})
     @Nullable
     @Override
     public <T extends View> T findViewById(@IdRes int id) {
@@ -1365,7 +1365,7 @@
                 mAppCompatViewInflater = new AppCompatViewInflater();
             } else {
                 try {
-                    Class viewInflaterClass = Class.forName(viewInflaterClassName);
+                    Class<?> viewInflaterClass = Class.forName(viewInflaterClassName);
                     mAppCompatViewInflater =
                             (AppCompatViewInflater) viewInflaterClass.getDeclaredConstructor()
                                     .newInstance();
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextViewAutoSizeHelper.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextViewAutoSizeHelper.java
index 0f730ba..f5a6c11a 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextViewAutoSizeHelper.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextViewAutoSizeHelper.java
@@ -782,6 +782,7 @@
                 includePad);
     }
 
+    @SuppressWarnings("unchecked")
     private static <T> T invokeAndReturnWithDefault(@NonNull Object object,
             @NonNull final String methodName, @NonNull final T defaultValue) {
         T result = null;
@@ -803,6 +804,7 @@
         return result;
     }
 
+    @SuppressWarnings("unchecked")
     private static <T> T accessAndReturnWithDefault(@NonNull Object object,
             @NonNull final String fieldName, @NonNull final T defaultValue) {
         try {
diff --git a/autofill/build.gradle b/autofill/build.gradle
index 95126ea..a1917e9 100644
--- a/autofill/build.gradle
+++ b/autofill/build.gradle
@@ -34,6 +34,4 @@
     mavenGroup = LibraryGroups.AUTOFILL
     inceptionYear = "2019"
     description = "AndroidX Autofill"
-    failOnUncheckedWarnings = true
-    failOnDeprecationWarnings = true
 }
diff --git a/benchmark/build.gradle b/benchmark/build.gradle
index e041454..ee540cf 100644
--- a/benchmark/build.gradle
+++ b/benchmark/build.gradle
@@ -42,6 +42,4 @@
     mavenGroup = LibraryGroups.BENCHMARK
     inceptionYear = "2018"
     description = "Android Benchmark"
-    failOnUncheckedWarnings = true
-    failOnDeprecationWarnings = true
 }
diff --git a/browser/build.gradle b/browser/build.gradle
index 6add4fe..7640383 100644
--- a/browser/build.gradle
+++ b/browser/build.gradle
@@ -46,4 +46,5 @@
     mavenGroup = LibraryGroups.BROWSER
     inceptionYear = "2015"
     description = "Android Support Custom Tabs"
+    failOnDeprecationWarnings = false
 }
diff --git a/buildSrc/src/main/kotlin/androidx/build/AndroidXExtension.kt b/buildSrc/src/main/kotlin/androidx/build/AndroidXExtension.kt
index 3bd99f7..c647816 100644
--- a/buildSrc/src/main/kotlin/androidx/build/AndroidXExtension.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/AndroidXExtension.kt
@@ -36,7 +36,6 @@
     var url = SUPPORT_URL
     private var licenses: MutableCollection<License> = ArrayList()
     var publish: Publish = Publish.NONE
-    var failOnUncheckedWarnings = true
     var failOnDeprecationWarnings = true
 
     var compilationTarget: CompilationTarget = CompilationTarget.DEVICE
diff --git a/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt b/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt
index e65b15b..5b982bb 100644
--- a/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt
@@ -154,31 +154,20 @@
                     project.configureResourceApiChecks(extension)
                     project.addCreateLibraryBuildInfoFileTask(androidXExtension)
                     val verifyDependencyVersionsTask = project.createVerifyDependencyVersionsTask()
-                    val checkNoWarningsTask = project.tasks.register(CHECK_NO_WARNINGS_TASK) {
-                        extension.libraryVariants.all { libraryVariant ->
-                            it.dependsOn(libraryVariant.javaCompileProvider)
-                        }
-                    }
                     val checkReleaseReadyTasks = mutableListOf<TaskProvider<out Task>>()
-                    if (!project.hasProperty(USE_MAX_DEP_VERSIONS)) {
-                        checkReleaseReadyTasks.add(checkNoWarningsTask)
-                    }
                     if (verifyDependencyVersionsTask != null) {
                         checkReleaseReadyTasks.add(verifyDependencyVersionsTask)
                     }
-                    if (!checkReleaseReadyTasks.isEmpty()) {
+                    if (checkReleaseReadyTasks.isNotEmpty()) {
                         project.createCheckReleaseReadyTask(checkReleaseReadyTasks)
                     }
                     extension.libraryVariants.all { libraryVariant ->
                         verifyDependencyVersionsTask?.configure { task ->
                             task.dependsOn(libraryVariant.javaCompileProvider)
                         }
-                        project.gradle.taskGraph.whenReady { executionGraph ->
-                            if (executionGraph.hasTask(checkNoWarningsTask.get())) {
-                                libraryVariant.javaCompileProvider.configure { task ->
-                                    task.options.compilerArgs.add("-Werror")
-                                }
-                            }
+                        libraryVariant.javaCompileProvider.configure { task ->
+                            task.options.compilerArgs.add("-Werror")
+                            task.options.compilerArgs.add("-Xlint:unchecked")
                         }
                     }
                     project.configureLint(extension.lintOptions, androidXExtension)
@@ -536,9 +525,6 @@
             libraryVariants.all { libraryVariant ->
                 if (libraryVariant.buildType.name == "debug") {
                     libraryVariant.javaCompileProvider.configure { javaCompile ->
-                        if (androidXExtension.failOnUncheckedWarnings) {
-                            javaCompile.options.compilerArgs.add("-Xlint:unchecked")
-                        }
                         if (androidXExtension.failOnDeprecationWarnings) {
                             javaCompile.options.compilerArgs.add("-Xlint:deprecation")
                         }
@@ -625,7 +611,6 @@
         const val BUILD_ON_SERVER_TASK = "buildOnServer"
         const val BUILD_TEST_APKS = "buildTestApks"
         const val CHECK_RELEASE_READY_TASK = "checkReleaseReady"
-        const val CHECK_NO_WARNINGS_TASK = "checkNoWarnings"
         const val CHECK_SAME_VERSION_LIBRARY_GROUPS = "checkSameVersionLibraryGroups"
         const val CREATE_LIBRARY_BUILD_INFO_FILES_TASK = "createLibraryBuildInfoFiles"
     }
diff --git a/buildSrc/src/main/kotlin/androidx/build/AndroidXUiPlugin.kt b/buildSrc/src/main/kotlin/androidx/build/AndroidXUiPlugin.kt
index 7f8b405..e835ad3 100644
--- a/buildSrc/src/main/kotlin/androidx/build/AndroidXUiPlugin.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/AndroidXUiPlugin.kt
@@ -55,9 +55,6 @@
                                     "-Xplugin=${conf.files.first()}"
                             }
                         }
-
-                        // Switch on warnings as errors for all Kotlin tasks
-                        compile.kotlinOptions.freeCompilerArgs += "-Werror"
                     }
                 }
             }
diff --git a/camera/camera2/src/main/java/androidx/camera/camera2/impl/compat/params/OutputConfigurationCompatApi26Impl.java b/camera/camera2/src/main/java/androidx/camera/camera2/impl/compat/params/OutputConfigurationCompatApi26Impl.java
index 2b4ed45..22bf550 100644
--- a/camera/camera2/src/main/java/androidx/camera/camera2/impl/compat/params/OutputConfigurationCompatApi26Impl.java
+++ b/camera/camera2/src/main/java/androidx/camera/camera2/impl/compat/params/OutputConfigurationCompatApi26Impl.java
@@ -65,6 +65,7 @@
         return maxSurfacesCountField.getInt(null);
     }
 
+    @SuppressWarnings("unchecked")
     private static List<Surface> getMutableSurfaceListApi26(OutputConfiguration outputConfiguration)
             throws NoSuchFieldException, IllegalAccessException {
         Field surfacesField = OutputConfiguration.class.getDeclaredField(SURFACES_FIELD);
diff --git a/camera/core/build.gradle b/camera/core/build.gradle
index 1de075b..6ca2ddd 100644
--- a/camera/core/build.gradle
+++ b/camera/core/build.gradle
@@ -81,4 +81,5 @@
     description = "Core components for the Jetpack Camera Library, a library providing a " +
             "consistent and reliable camera foundation that enables great camera driven " +
             "experiences across all of Android."
+    failOnDeprecationWarnings = false
 }
diff --git a/camera/core/src/main/java/androidx/camera/core/CaptureConfig.java b/camera/core/src/main/java/androidx/camera/core/CaptureConfig.java
index a24698d..154e763 100644
--- a/camera/core/src/main/java/androidx/camera/core/CaptureConfig.java
+++ b/camera/core/src/main/java/androidx/camera/core/CaptureConfig.java
@@ -300,6 +300,7 @@
         }
 
         /** Add a set of implementation specific options to the request. */
+        @SuppressWarnings("unchecked")
         public void addImplementationOptions(Config config) {
             for (Option<?> option : config.listOptions()) {
                 @SuppressWarnings("unchecked") // Options/values are being copied directly
diff --git a/camera/core/src/main/java/androidx/camera/core/impl/utils/futures/AggregateFutureState.java b/camera/core/src/main/java/androidx/camera/core/impl/utils/futures/AggregateFutureState.java
index 61b092c..d220605c 100644
--- a/camera/core/src/main/java/androidx/camera/core/impl/utils/futures/AggregateFutureState.java
+++ b/camera/core/src/main/java/androidx/camera/core/impl/utils/futures/AggregateFutureState.java
@@ -38,6 +38,7 @@
  *
  * <p>Copied and adapted from Guava.
  */
+@SuppressWarnings("unchecked") // Casts verified
 abstract class AggregateFutureState {
     // Lazily initialized the first time we see an exception; not released until all the input
     // futures & this future completes. Released when the future releases the reference to the
@@ -53,7 +54,6 @@
     private static final Logger sLogger = Logger.getLogger(AggregateFutureState.class.getName());
 
     static {
-        @SuppressWarnings("unchecked") // Casts verified
         AtomicHelper helper;
         Throwable thrownReflectionFailure = null;
         try {
diff --git a/camera/extensions/src/main/java/androidx/camera/extensions/AdaptingCaptureStage.java b/camera/extensions/src/main/java/androidx/camera/extensions/AdaptingCaptureStage.java
index f44caa3..f3c728a 100644
--- a/camera/extensions/src/main/java/androidx/camera/extensions/AdaptingCaptureStage.java
+++ b/camera/extensions/src/main/java/androidx/camera/extensions/AdaptingCaptureStage.java
@@ -30,6 +30,7 @@
     private final CaptureConfig mCaptureRequestConfiguration;
     private final int mId;
 
+    @SuppressWarnings("unchecked")
     AdaptingCaptureStage(CaptureStageImpl impl) {
         mId = impl.getId();
 
diff --git a/camera/extensions/src/main/java/androidx/camera/extensions/ImageCaptureExtender.java b/camera/extensions/src/main/java/androidx/camera/extensions/ImageCaptureExtender.java
index aed7a5c..f12fb46 100644
--- a/camera/extensions/src/main/java/androidx/camera/extensions/ImageCaptureExtender.java
+++ b/camera/extensions/src/main/java/androidx/camera/extensions/ImageCaptureExtender.java
@@ -176,7 +176,7 @@
             if (mActive.get()) {
                 List<CaptureStageImpl> captureStages = mImpl.getCaptureStages();
                 if (captureStages != null && !captureStages.isEmpty()) {
-                    ArrayList<CaptureStage> ret = new ArrayList();
+                    ArrayList<CaptureStage> ret = new ArrayList<>();
                     for (CaptureStageImpl s : captureStages) {
                         ret.add(new AdaptingCaptureStage(s));
                     }
diff --git a/camera/extensions/src/main/java/androidx/camera/extensions/PreviewExtender.java b/camera/extensions/src/main/java/androidx/camera/extensions/PreviewExtender.java
index 709cfdc..64abf21 100644
--- a/camera/extensions/src/main/java/androidx/camera/extensions/PreviewExtender.java
+++ b/camera/extensions/src/main/java/androidx/camera/extensions/PreviewExtender.java
@@ -68,6 +68,9 @@
         return mImpl.isExtensionAvailable(cameraId, cameraCharacteristics);
     }
 
+    /**
+     */
+    @SuppressWarnings("unchecked")
     public void enableExtension() {
         CameraX.LensFacing lensFacing = mBuilder.build().getLensFacing();
         String cameraId = CameraUtil.getCameraId(lensFacing);
diff --git a/camera/testing/build.gradle b/camera/testing/build.gradle
index ec11848..1a7a941 100644
--- a/camera/testing/build.gradle
+++ b/camera/testing/build.gradle
@@ -45,4 +45,5 @@
     description = "Testing components for the Jetpack Camera Library, a library providing a " +
             "consistent and reliable camera foundation that enables great camera driven " +"" +
             "experiences across all of Android."
+    failOnDeprecationWarnings = false
 }
diff --git a/car/core/build.gradle b/car/core/build.gradle
index 1f60ba9..97baa61 100644
--- a/car/core/build.gradle
+++ b/car/core/build.gradle
@@ -53,5 +53,4 @@
     mavenGroup = LibraryGroups.CAR
     inceptionYear = "2017"
     description = "Android Car Support UI"
-    failOnUncheckedWarnings = false
-}
+    }
diff --git a/car/core/src/main/java/androidx/car/app/CarListDialog.java b/car/core/src/main/java/androidx/car/app/CarListDialog.java
index fa8a1cc..9aa2607 100644
--- a/car/core/src/main/java/androidx/car/app/CarListDialog.java
+++ b/car/core/src/main/java/androidx/car/app/CarListDialog.java
@@ -177,6 +177,7 @@
      * Initializes {@link #mAdapter} to display the items in the given array. It utilizes the
      * {@link TextListItem} but only populates the title field with the the values in the array.
      */
+    @SuppressWarnings("unchecked")
     private void initializeWithItems(CharSequence[] items) {
         Context context = getContext();
         List<ListItem> listItems = new ArrayList<>();
@@ -194,6 +195,7 @@
      * the {@link SubheaderListItem} to display the section title and {@link TextListItem} to
      * display the individual items of a section.
      */
+    @SuppressWarnings("unchecked")
     private void initializeWithSections(DialogSubSection[] sections) {
         Context context = getContext();
         List<ListItem> listItems = new ArrayList<>();
diff --git a/car/core/src/main/java/androidx/car/app/CarMultipleChoiceDialog.java b/car/core/src/main/java/androidx/car/app/CarMultipleChoiceDialog.java
index 3c3fc5a..c8b9d9a 100644
--- a/car/core/src/main/java/androidx/car/app/CarMultipleChoiceDialog.java
+++ b/car/core/src/main/java/androidx/car/app/CarMultipleChoiceDialog.java
@@ -205,6 +205,7 @@
      * Initializes {@link #mAdapter} to display the items in the given array by utilizing
      * {@link CheckBoxListItem}.
      */
+    @SuppressWarnings("unchecked")
     private void initializeWithItems(List<Item> items) {
         List<ListItem> listItems = new ArrayList<>();
 
diff --git a/car/core/src/main/java/androidx/car/app/CarSingleChoiceDialog.java b/car/core/src/main/java/androidx/car/app/CarSingleChoiceDialog.java
index 7d1783b..320aace 100644
--- a/car/core/src/main/java/androidx/car/app/CarSingleChoiceDialog.java
+++ b/car/core/src/main/java/androidx/car/app/CarSingleChoiceDialog.java
@@ -206,6 +206,7 @@
      * Initializes {@link #mAdapter} to display the items in the given array by utilizing
      * {@link RadioButtonListItem}.
      */
+    @SuppressWarnings("unchecked")
     private void initializeWithItems(List<Item> items) {
         List<ListItem> listItems = new ArrayList<>();
 
diff --git a/car/core/src/main/java/androidx/car/widget/CompoundButtonListItem.java b/car/core/src/main/java/androidx/car/widget/CompoundButtonListItem.java
index 205666c..c84537c 100644
--- a/car/core/src/main/java/androidx/car/widget/CompoundButtonListItem.java
+++ b/car/core/src/main/java/androidx/car/widget/CompoundButtonListItem.java
@@ -166,6 +166,7 @@
      * Hides all views in {@link ViewHolder} then applies ViewBinders to adjust view layout params.
      */
     @Override
+    @SuppressWarnings("unchecked")
     public void onBind(@NonNull VH viewHolder) {
         hideSubViews(viewHolder);
         for (ViewBinder binder : mBinders) {
diff --git a/car/core/src/main/java/androidx/car/widget/ListItem.java b/car/core/src/main/java/androidx/car/widget/ListItem.java
index 96cfc1e..69c24fd 100644
--- a/car/core/src/main/java/androidx/car/widget/ListItem.java
+++ b/car/core/src/main/java/androidx/car/widget/ListItem.java
@@ -56,6 +56,7 @@
     /**
      * Called when ListItem is bound to its ViewHolder.
      */
+    @SuppressWarnings("unchecked")
     final void bind(VH viewHolder) {
         // Attempt to clean up custom view binder from previous item (if any).
         // Then save the clean up binders for next item.
@@ -230,6 +231,7 @@
          * Removes customization from previous ListItem. Intended to be used when this ViewHolder is
          * bound to a ListItem.
          */
+        @SuppressWarnings("unchecked")
         public final void cleanUp() {
             for (ViewBinder binder : mCleanUps) {
                 binder.bind(this);
diff --git a/car/core/src/main/java/androidx/car/widget/ListItemAdapter.java b/car/core/src/main/java/androidx/car/widget/ListItemAdapter.java
index 7e63904..a2c209f 100644
--- a/car/core/src/main/java/androidx/car/widget/ListItemAdapter.java
+++ b/car/core/src/main/java/androidx/car/widget/ListItemAdapter.java
@@ -356,6 +356,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void onBindViewHolder(ListItem.ViewHolder holder, int position) {
         if (mBackgroundStyle == BACKGROUND_STYLE_PANEL) {
             ListItemBackgroundResolver.setBackground(
diff --git a/car/core/src/main/java/androidx/car/widget/SeekbarListItem.java b/car/core/src/main/java/androidx/car/widget/SeekbarListItem.java
index 8787ba7..1fec2fa 100644
--- a/car/core/src/main/java/androidx/car/widget/SeekbarListItem.java
+++ b/car/core/src/main/java/androidx/car/widget/SeekbarListItem.java
@@ -212,6 +212,7 @@
      * Hides all views in {@link ViewHolder} then applies ViewBinders to adjust view layout params.
      */
     @Override
+    @SuppressWarnings("unchecked")
     protected void onBind(ViewHolder viewHolder) {
         // Hide all subviews then apply view binders to adjust subviews.
         hideSubViews(viewHolder);
diff --git a/car/core/src/main/java/androidx/car/widget/SubheaderListItem.java b/car/core/src/main/java/androidx/car/widget/SubheaderListItem.java
index a289d5f..102c77b 100644
--- a/car/core/src/main/java/androidx/car/widget/SubheaderListItem.java
+++ b/car/core/src/main/java/androidx/car/widget/SubheaderListItem.java
@@ -132,6 +132,7 @@
      * Applies ViewBinders to adjust view layout params.
      */
     @Override
+    @SuppressWarnings("unchecked")
     protected void onBind(ViewHolder viewHolder) {
         for (ViewBinder binder : mBinders) {
             binder.bind(viewHolder);
diff --git a/car/core/src/main/java/androidx/car/widget/TextListItem.java b/car/core/src/main/java/androidx/car/widget/TextListItem.java
index 8090bf8..3071903 100644
--- a/car/core/src/main/java/androidx/car/widget/TextListItem.java
+++ b/car/core/src/main/java/androidx/car/widget/TextListItem.java
@@ -191,6 +191,7 @@
      * Hides all views in {@link ViewHolder} then applies ViewBinders to adjust view layout params.
      */
     @Override
+    @SuppressWarnings("unchecked")
     public void onBind(ViewHolder viewHolder) {
         hideSubViews(viewHolder);
         for (ViewBinder binder : mBinders) {
diff --git a/coordinatorlayout/build.gradle b/coordinatorlayout/build.gradle
index 4086311..ae2a733 100644
--- a/coordinatorlayout/build.gradle
+++ b/coordinatorlayout/build.gradle
@@ -51,6 +51,5 @@
     mavenGroup = LibraryGroups.COORDINATORLAYOUT
     inceptionYear = "2011"
     description = "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later."
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/coordinatorlayout/src/main/java/androidx/coordinatorlayout/widget/CoordinatorLayout.java b/coordinatorlayout/src/main/java/androidx/coordinatorlayout/widget/CoordinatorLayout.java
index ff25749..2eb7405 100644
--- a/coordinatorlayout/src/main/java/androidx/coordinatorlayout/widget/CoordinatorLayout.java
+++ b/coordinatorlayout/src/main/java/androidx/coordinatorlayout/widget/CoordinatorLayout.java
@@ -401,6 +401,7 @@
      * in response to an UP or CANCEL event, when intercept is request-disallowed
      * and similar cases where an event stream in progress will be aborted.
      */
+    @SuppressWarnings("unchecked")
     private void resetTouchBehaviors(boolean notifyOnInterceptTouchEvent) {
         final int childCount = getChildCount();
         for (int i = 0; i < childCount; i++) {
@@ -449,6 +450,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     private boolean performIntercept(MotionEvent ev, final int type) {
         boolean intercepted = false;
         boolean newBlock = false;
@@ -538,6 +540,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public boolean onTouchEvent(MotionEvent ev) {
         boolean handled = false;
         boolean cancelSuper = false;
@@ -567,10 +570,6 @@
             super.onTouchEvent(cancelEvent);
         }
 
-        if (!handled && action == MotionEvent.ACTION_DOWN) {
-
-        }
-
         if (cancelEvent != null) {
             cancelEvent.recycle();
         }
@@ -605,6 +604,7 @@
         return mKeylines[index];
     }
 
+    @SuppressWarnings("unchecked")
     static Behavior parseBehavior(Context context, AttributeSet attrs, String name) {
         if (TextUtils.isEmpty(name)) {
             return null;
@@ -756,6 +756,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
         prepareChildren();
         ensurePreDrawListener();
@@ -842,6 +843,7 @@
         setMeasuredDimension(width, height);
     }
 
+    @SuppressWarnings("unchecked")
     private WindowInsetsCompat dispatchApplyWindowInsetsToBehaviors(WindowInsetsCompat insets) {
         if (insets.isConsumed()) {
             return insets;
@@ -893,6 +895,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     protected void onLayout(boolean changed, int l, int t, int r, int b) {
         final int layoutDirection = ViewCompat.getLayoutDirection(this);
         final int childCount = mDependencySortedChildren.size();
@@ -1239,6 +1242,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
         final LayoutParams lp = (LayoutParams) child.getLayoutParams();
         if (lp.mBehavior != null) {
@@ -1292,6 +1296,7 @@
      *
      * @param type the type of event which has caused this call
      */
+    @SuppressWarnings("unchecked")
     final void onChildViewsChanged(@DispatchChangeEvent final int type) {
         final int layoutDirection = ViewCompat.getLayoutDirection(this);
         final int childCount = mDependencySortedChildren.size();
@@ -1397,6 +1402,7 @@
         releaseTempRect(lastDrawRect);
     }
 
+    @SuppressWarnings("unchecked")
     private void offsetChildByInset(final View child, final Rect inset, final int layoutDirection) {
         if (!ViewCompat.isLaidOut(child)) {
             // The view has not been laid out yet, so we can't obtain its bounds.
@@ -1506,6 +1512,7 @@
      *
      * @param view the View to find dependents of to dispatch the call.
      */
+    @SuppressWarnings("unchecked")
     public void dispatchDependentViewsChanged(@NonNull View view) {
         final List<View> dependents = mChildDag.getIncomingEdges(view);
         if (dependents != null && !dependents.isEmpty()) {
@@ -1548,6 +1555,7 @@
      * @return the list of views which depend on {@code child}.
      */
     @NonNull
+    @SuppressWarnings("unchecked")
     public List<View> getDependents(@NonNull View child) {
         final List<View> edges = mChildDag.getIncomingEdges(child);
         mTempDependenciesList.clear();
@@ -1634,6 +1642,7 @@
      * to be animated away from their anchor. However, if the anchor view is animated,
      * the child will be offset to match the anchor's translated position.
      */
+    @SuppressWarnings("unchecked")
     void offsetChildToAnchor(View child, int layoutDirection) {
         final LayoutParams lp = (LayoutParams) child.getLayoutParams();
         if (lp.mAnchorView != null) {
@@ -1751,6 +1760,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public boolean onStartNestedScroll(View child, View target, int axes, int type) {
         boolean handled = false;
 
@@ -1781,6 +1791,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void onNestedScrollAccepted(View child, View target, int nestedScrollAxes, int type) {
         mNestedScrollingParentHelper.onNestedScrollAccepted(child, target, nestedScrollAxes, type);
         mNestedScrollingTarget = target;
@@ -1807,6 +1818,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void onStopNestedScroll(View target, int type) {
         mNestedScrollingParentHelper.onStopNestedScroll(target, type);
 
@@ -1843,6 +1855,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void onNestedScroll(@NonNull View target, int dxConsumed, int dyConsumed,
             int dxUnconsumed, int dyUnconsumed, @ViewCompat.NestedScrollType int type,
             @NonNull int[] consumed) {
@@ -1895,6 +1908,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void onNestedPreScroll(View target, int dx, int dy, int[] consumed, int  type) {
         int xConsumed = 0;
         int yConsumed = 0;
@@ -1937,6 +1951,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public boolean onNestedFling(View target, float velocityX, float velocityY, boolean consumed) {
         boolean handled = false;
 
@@ -1966,6 +1981,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public boolean onNestedPreFling(View target, float velocityX, float velocityY) {
         boolean handled = false;
 
@@ -3006,6 +3022,7 @@
          * @param child the child view this LayoutParams is associated with
          * @return true to block interaction below the given child
          */
+        @SuppressWarnings("unchecked")
         boolean isBlockingInteractionBelow(CoordinatorLayout parent, View child) {
             if (mDidBlockInteraction) {
                 return true;
@@ -3072,6 +3089,7 @@
          * @param dependency the proposed dependency to check
          * @return true if child depends on dependency
          */
+        @SuppressWarnings("unchecked")
         boolean dependsOn(CoordinatorLayout parent, View child, View dependency) {
             return dependency == mAnchorDirectChild
                     || shouldDodge(dependency, ViewCompat.getLayoutDirection(parent))
@@ -3212,6 +3230,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     protected void onRestoreInstanceState(Parcelable state) {
         if (!(state instanceof SavedState)) {
             super.onRestoreInstanceState(state);
@@ -3239,6 +3258,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     protected Parcelable onSaveInstanceState() {
         final SavedState ss = new SavedState(super.onSaveInstanceState());
 
@@ -3262,6 +3282,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) {
         final LayoutParams lp = (LayoutParams) child.getLayoutParams();
         final Behavior behavior = lp.getBehavior();
diff --git a/core/core/build.gradle b/core/core/build.gradle
index 7b4eec5..00a7fbe 100644
--- a/core/core/build.gradle
+++ b/core/core/build.gradle
@@ -47,6 +47,5 @@
     mavenGroup = LibraryGroups.CORE
     inceptionYear = "2015"
     description = "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren\'t a part of the framework APIs. Compatible on devices running API 14 or later."
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/core/core/src/main/java/androidx/core/app/ComponentActivity.java b/core/core/src/main/java/androidx/core/app/ComponentActivity.java
index 864c4d8..9672a78 100644
--- a/core/core/src/main/java/androidx/core/app/ComponentActivity.java
+++ b/core/core/src/main/java/androidx/core/app/ComponentActivity.java
@@ -67,6 +67,7 @@
      * @hide
      */
     @RestrictTo(LIBRARY_GROUP_PREFIX)
+    @SuppressWarnings("unchecked")
     public <T extends ExtraData> T getExtraData(Class<T> extraDataClass) {
         return (T) mExtraDataMap.get(extraDataClass);
     }
diff --git a/core/core/src/main/java/androidx/core/app/CoreComponentFactory.java b/core/core/src/main/java/androidx/core/app/CoreComponentFactory.java
index a9db98b..9db5e7f 100644
--- a/core/core/src/main/java/androidx/core/app/CoreComponentFactory.java
+++ b/core/core/src/main/java/androidx/core/app/CoreComponentFactory.java
@@ -75,6 +75,7 @@
         return checkCompatWrapper(super.instantiateService(cl, className, intent));
     }
 
+    @SuppressWarnings("unchecked")
     static <T> T checkCompatWrapper(T obj) {
         if (obj instanceof CompatWrapped) {
             T wrapper = (T) ((CompatWrapped) obj).getWrapper();
diff --git a/core/core/src/main/java/androidx/core/content/pm/ShortcutManagerCompat.java b/core/core/src/main/java/androidx/core/content/pm/ShortcutManagerCompat.java
index 509eb17..dddb137 100644
--- a/core/core/src/main/java/androidx/core/content/pm/ShortcutManagerCompat.java
+++ b/core/core/src/main/java/androidx/core/content/pm/ShortcutManagerCompat.java
@@ -283,12 +283,12 @@
         getShortcutInfoSaverInstance(context).removeAllShortcuts();
     }
 
-    private static ShortcutInfoCompatSaver getShortcutInfoSaverInstance(Context context) {
+    private static ShortcutInfoCompatSaver<?> getShortcutInfoSaverInstance(Context context) {
         if (sShortcutInfoCompatSaver == null) {
             if (Build.VERSION.SDK_INT >= 23) {
                 try {
                     ClassLoader loader = ShortcutManagerCompat.class.getClassLoader();
-                    Class saver = Class.forName(
+                    Class<?> saver = Class.forName(
                             "androidx.sharetarget.ShortcutInfoCompatSaverImpl", false, loader);
                     Method getInstanceMethod = saver.getMethod("getInstance", Context.class);
                     sShortcutInfoCompatSaver = (ShortcutInfoCompatSaver) getInstanceMethod.invoke(
diff --git a/core/core/src/main/java/androidx/core/content/res/GrowingArrayUtils.java b/core/core/src/main/java/androidx/core/content/res/GrowingArrayUtils.java
index 4bddadc..b841fc7 100644
--- a/core/core/src/main/java/androidx/core/content/res/GrowingArrayUtils.java
+++ b/core/core/src/main/java/androidx/core/content/res/GrowingArrayUtils.java
@@ -37,6 +37,7 @@
      * @return the array to which the element was appended. This may be different than the given
      *         array.
      */
+    @SuppressWarnings("unchecked")
     public static <T> T[] append(T[] array, int currentSize, T element) {
         assert currentSize <= array.length;
 
@@ -106,6 +107,7 @@
      * @return the array to which the element was appended. This may be different than the given
      *         array.
      */
+    @SuppressWarnings("unchecked")
     public static <T> T[] insert(T[] array, int currentSize, int index, T element) {
         assert currentSize <= array.length;
 
diff --git a/core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi21Impl.java b/core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi21Impl.java
index b544dcf..463a85a 100644
--- a/core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi21Impl.java
+++ b/core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi21Impl.java
@@ -70,7 +70,7 @@
         }
         sHasInitBeenCalled = true;
 
-        Class fontFamilyClass;
+        Class<?> fontFamilyClass;
         Constructor fontFamilyCtor;
         Method addFontMethod;
         Method createFromFamiliesWithDefaultMethod;
diff --git a/core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi24Impl.java b/core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi24Impl.java
index 59bc562..67a9011 100644
--- a/core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi24Impl.java
+++ b/core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi24Impl.java
@@ -61,7 +61,7 @@
     private static final Method sCreateFromFamiliesWithDefault;
 
     static {
-        Class fontFamilyClass;
+        Class<?> fontFamilyClass;
         Constructor fontFamilyCtor;
         Method addFontMethod;
         Method createFromFamiliesWithDefaultMethod;
diff --git a/core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi26Impl.java b/core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi26Impl.java
index 84ca5ae..e2eb9b1 100644
--- a/core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi26Impl.java
+++ b/core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi26Impl.java
@@ -192,8 +192,7 @@
     private void abortCreation(Object family) {
         try {
             mAbortCreation.invoke(family);
-        } catch (IllegalAccessException | InvocationTargetException e) {
-        }
+        } catch (IllegalAccessException | InvocationTargetException ignored) { }
     }
 
     @Override
@@ -317,10 +316,12 @@
         return Class.forName(FONT_FAMILY_CLASS);
     }
 
+    @SuppressWarnings("unchecked")
     protected Constructor obtainFontFamilyCtor(Class fontFamily) throws NoSuchMethodException {
         return fontFamily.getConstructor();
     }
 
+    @SuppressWarnings("unchecked")
     protected Method obtainAddFontFromAssetManagerMethod(Class fontFamily)
             throws NoSuchMethodException {
         return fontFamily.getMethod(ADD_FONT_FROM_ASSET_MANAGER_METHOD,
@@ -328,16 +329,19 @@
                 Integer.TYPE, Integer.TYPE, FontVariationAxis[].class);
     }
 
+    @SuppressWarnings("unchecked")
     protected Method obtainAddFontFromBufferMethod(Class fontFamily) throws NoSuchMethodException {
         return fontFamily.getMethod(ADD_FONT_FROM_BUFFER_METHOD,
                 ByteBuffer.class, Integer.TYPE, FontVariationAxis[].class, Integer.TYPE,
                 Integer.TYPE);
     }
 
+    @SuppressWarnings("unchecked")
     protected Method obtainFreezeMethod(Class fontFamily) throws NoSuchMethodException {
         return fontFamily.getMethod(FREEZE_METHOD);
     }
 
+    @SuppressWarnings("unchecked")
     protected Method obtainAbortCreationMethod(Class fontFamily) throws NoSuchMethodException {
         return fontFamily.getMethod(ABORT_CREATION_METHOD);
     }
diff --git a/core/core/src/main/java/androidx/core/graphics/drawable/DrawableCompat.java b/core/core/src/main/java/androidx/core/graphics/drawable/DrawableCompat.java
index ceee4c5..d81ba22 100644
--- a/core/core/src/main/java/androidx/core/graphics/drawable/DrawableCompat.java
+++ b/core/core/src/main/java/androidx/core/graphics/drawable/DrawableCompat.java
@@ -329,7 +329,7 @@
      *
      * @see #wrap(Drawable)
      */
-    @SuppressWarnings("TypeParameterUnusedInFormals")
+    @SuppressWarnings({"TypeParameterUnusedInFormals", "unchecked"})
     public static <T extends Drawable> T unwrap(@NonNull Drawable drawable) {
         if (drawable instanceof WrappedDrawable) {
             return (T) ((WrappedDrawable) drawable).getWrappedDrawable();
diff --git a/core/core/src/main/java/androidx/core/provider/SelfDestructiveThread.java b/core/core/src/main/java/androidx/core/provider/SelfDestructiveThread.java
index 5575676..760ca92 100644
--- a/core/core/src/main/java/androidx/core/provider/SelfDestructiveThread.java
+++ b/core/core/src/main/java/androidx/core/provider/SelfDestructiveThread.java
@@ -166,7 +166,7 @@
         final ReentrantLock lock = new ReentrantLock();
         final Condition cond = lock.newCondition();
 
-        final AtomicReference<T> holder = new AtomicReference();
+        final AtomicReference<T> holder = new AtomicReference<>();
         final AtomicBoolean running = new AtomicBoolean(true);
         post(new Runnable() {
             @Override
diff --git a/core/core/src/main/java/androidx/core/view/AccessibilityDelegateCompat.java b/core/core/src/main/java/androidx/core/view/AccessibilityDelegateCompat.java
index 640c588..a1f6081 100644
--- a/core/core/src/main/java/androidx/core/view/AccessibilityDelegateCompat.java
+++ b/core/core/src/main/java/androidx/core/view/AccessibilityDelegateCompat.java
@@ -360,6 +360,7 @@
         return success;
     }
 
+    @SuppressWarnings("unchecked")
     private boolean performClickableSpanAction(int clickableSpanId, View host) {
         SparseArray<WeakReference<ClickableSpan>> spans =
                 (SparseArray<WeakReference<ClickableSpan>>)
@@ -390,6 +391,7 @@
         return false;
     }
 
+    @SuppressWarnings("unchecked")
     static List<AccessibilityActionCompat> getActionList(View view) {
         List<AccessibilityActionCompat> actions = (List<AccessibilityActionCompat>)
                 view.getTag(R.id.tag_accessibility_actions);
diff --git a/core/core/src/main/java/androidx/core/view/ViewCompat.java b/core/core/src/main/java/androidx/core/view/ViewCompat.java
index 526fd12..575f4cd 100644
--- a/core/core/src/main/java/androidx/core/view/ViewCompat.java
+++ b/core/core/src/main/java/androidx/core/view/ViewCompat.java
@@ -1304,11 +1304,12 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     private static List<AccessibilityActionCompat> getActionList(View view) {
         ArrayList<AccessibilityActionCompat> actions =
                 (ArrayList<AccessibilityActionCompat>) view.getTag(R.id.tag_accessibility_actions);
         if (actions == null) {
-            actions = new ArrayList<AccessibilityActionCompat>();
+            actions = new ArrayList<>();
             view.setTag(R.id.tag_accessibility_actions, actions);
         }
         return actions;
@@ -3699,6 +3700,7 @@
      * @param listener a receiver of unhandled {@link KeyEvent}s.
      * @see #removeOnUnhandledKeyEventListener
      */
+    @SuppressWarnings("unchecked")
     public static void addOnUnhandledKeyEventListener(@NonNull View v,
             final @NonNull OnUnhandledKeyEventListenerCompat listener) {
         if (Build.VERSION.SDK_INT >= 28) {
@@ -3742,6 +3744,7 @@
      * @param listener a receiver of unhandled {@link KeyEvent}s.
      * @see #addOnUnhandledKeyEventListener
      */
+    @SuppressWarnings("unchecked")
     public static void removeOnUnhandledKeyEventListener(@NonNull View v,
             @NonNull OnUnhandledKeyEventListenerCompat listener) {
         if (Build.VERSION.SDK_INT >= 28) {
@@ -4030,6 +4033,7 @@
             }
         }
 
+        @SuppressWarnings("unchecked")
         T get(View view) {
             if (frameworkAvailable()) {
                 return frameworkGet(view);
diff --git a/core/core/src/main/java/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.java b/core/core/src/main/java/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.java
index 87345458..712ae1e 100644
--- a/core/core/src/main/java/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.java
+++ b/core/core/src/main/java/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.java
@@ -2636,6 +2636,7 @@
         return spans;
     }
 
+    @SuppressWarnings("unchecked")
     private SparseArray<WeakReference<ClickableSpan>> getSpansFromViewTags(View host) {
         return (SparseArray<WeakReference<ClickableSpan>>) host.getTag(
                 R.id.tag_accessibility_clickable_spans);
diff --git a/core/core/src/main/java/androidx/core/widget/TextViewCompat.java b/core/core/src/main/java/androidx/core/widget/TextViewCompat.java
index 5f9637a..9f7eab2 100644
--- a/core/core/src/main/java/androidx/core/widget/TextViewCompat.java
+++ b/core/core/src/main/java/androidx/core/widget/TextViewCompat.java
@@ -541,7 +541,7 @@
         // Since in most cases the menu instance processed by this callback is going
         // to be a MenuBuilder, we keep these references to avoid querying for them
         // frequently by reflection in recomputeProcessTextMenuItems.
-        private Class mMenuBuilderClass;
+        private Class<?> mMenuBuilderClass;
         private Method mMenuBuilderRemoveItemAtMethod;
         private boolean mCanUseMenuBuilderReferences;
         private boolean mInitializedMenuBuilderReferences;
diff --git a/drawerlayout/build.gradle b/drawerlayout/build.gradle
index 7caf70d..96e9323 100644
--- a/drawerlayout/build.gradle
+++ b/drawerlayout/build.gradle
@@ -28,4 +28,5 @@
     mavenGroup = LibraryGroups.DRAWERLAYOUT
     inceptionYear = "2018"
     description = "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later."
+    failOnDeprecationWarnings = false
 }
diff --git a/dynamic-animation/build.gradle b/dynamic-animation/build.gradle
index a9da7a4..645fc00 100644
--- a/dynamic-animation/build.gradle
+++ b/dynamic-animation/build.gradle
@@ -29,5 +29,4 @@
     mavenGroup = LibraryGroups.DYNAMICANIMATION
     inceptionYear = "2017"
     description = "Physics-based animation in support library, where the animations are driven by physics force. You can use this Animation library to create smooth and realistic animations."
-    failOnUncheckedWarnings = false
-}
\ No newline at end of file
+    }
\ No newline at end of file
diff --git a/dynamic-animation/src/main/java/androidx/dynamicanimation/animation/DynamicAnimation.java b/dynamic-animation/src/main/java/androidx/dynamicanimation/animation/DynamicAnimation.java
index 9aa8413..db5826c 100644
--- a/dynamic-animation/src/main/java/androidx/dynamicanimation/animation/DynamicAnimation.java
+++ b/dynamic-animation/src/main/java/androidx/dynamicanimation/animation/DynamicAnimation.java
@@ -376,6 +376,7 @@
      * @param startValue start value for the animation
      * @return the Animation whose start value is being set
      */
+    @SuppressWarnings("unchecked")
     public T setStartValue(float startValue) {
         mValue = startValue;
         mStartValueIsSet = true;
@@ -400,6 +401,7 @@
      * @param startVelocity start velocity of the animation
      * @return the Animation whose start velocity is being set
      */
+    @SuppressWarnings("unchecked")
     public T setStartVelocity(float startVelocity) {
         mVelocity = startVelocity;
         return (T) this;
@@ -413,6 +415,7 @@
      * @param max maximum value of the property to be animated
      * @return the Animation whose max value is being set
      */
+    @SuppressWarnings("unchecked")
     public T setMaxValue(float max) {
         // This max value should be checked and handled in the subclass animations, instead of
         // assuming the end of the animations when the max/min value is hit in the base class.
@@ -430,6 +433,7 @@
      * @param min minimum value of the property to be animated
      * @return the Animation whose min value is being set
      */
+    @SuppressWarnings("unchecked")
     public T setMinValue(float min) {
         mMinValue = min;
         return (T) this;
@@ -442,6 +446,7 @@
      * @param listener the listener to be added
      * @return the animation to which the listener is added
      */
+    @SuppressWarnings("unchecked")
     public T addEndListener(OnAnimationEndListener listener) {
         if (!mEndListeners.contains(listener)) {
             mEndListeners.add(listener);
@@ -470,6 +475,7 @@
      * @throws UnsupportedOperationException if the update listener is added after the animation has
      *                                       started
      */
+    @SuppressWarnings("unchecked")
     public T addUpdateListener(OnAnimationUpdateListener listener) {
         if (isRunning()) {
             // Require update listener to be added before the animation, such as when we start
@@ -520,6 +526,7 @@
      * @return the animation whose min visible change is being set
      * @throws IllegalArgumentException if the given threshold is not positive
      */
+    @SuppressWarnings("unchecked")
     public T setMinimumVisibleChange(@FloatRange(from = 0.0, fromInclusive = false)
             float minimumVisibleChange) {
         if (minimumVisibleChange <= 0) {
@@ -689,6 +696,7 @@
     /**
      * Updates the property value through the corresponding setter.
      */
+    @SuppressWarnings("unchecked")
     void setPropertyValue(float value) {
         mProperty.setValue(mTarget, value);
         for (int i = 0; i < mUpdateListeners.size(); i++) {
@@ -709,6 +717,7 @@
     /**
      * Obtain the property value through the corresponding getter.
      */
+    @SuppressWarnings("unchecked")
     private float getPropertyValue() {
         return mProperty.getValue(mTarget);
     }
diff --git a/fragment/fragment/build.gradle b/fragment/fragment/build.gradle
index d678f94..dd5a648 100644
--- a/fragment/fragment/build.gradle
+++ b/fragment/fragment/build.gradle
@@ -55,6 +55,5 @@
     mavenGroup = LibraryGroups.FRAGMENT
     inceptionYear = "2011"
     description = "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren\'t a part of the framework APIs. Compatible on devices running API 14 or later."
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/fragment/fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java b/fragment/fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
index f45e177..0fc0466 100644
--- a/fragment/fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
+++ b/fragment/fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
@@ -369,6 +369,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public List<Fragment> getFragments() {
         if (mAdded.isEmpty()) {
             return Collections.emptyList();
diff --git a/leanback/build.gradle b/leanback/build.gradle
index 075cb16..f7ce202 100644
--- a/leanback/build.gradle
+++ b/leanback/build.gradle
@@ -47,6 +47,5 @@
     mavenGroup = LibraryGroups.LEANBACK
     inceptionYear = "2014"
     description = "Android Support Leanback v17"
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/leanback/src/main/java/androidx/leanback/app/BackgroundManager.java b/leanback/src/main/java/androidx/leanback/app/BackgroundManager.java
index eaed2cc..11c618f 100644
--- a/leanback/src/main/java/androidx/leanback/app/BackgroundManager.java
+++ b/leanback/src/main/java/androidx/leanback/app/BackgroundManager.java
@@ -252,7 +252,7 @@
 
         TranslucentLayerDrawable(BackgroundManager manager, Drawable[] drawables) {
             super(drawables);
-            mManagerWeakReference = new WeakReference(manager);
+            mManagerWeakReference = new WeakReference<>(manager);
             int count = drawables.length;
             mWrapper = new DrawableWrapper[count];
             for (int i = 0; i < count; i++) {
diff --git a/leanback/src/main/java/androidx/leanback/app/BrowseFragment.java b/leanback/src/main/java/androidx/leanback/app/BrowseFragment.java
index 86be0ed..75df36b 100644
--- a/leanback/src/main/java/androidx/leanback/app/BrowseFragment.java
+++ b/leanback/src/main/java/androidx/leanback/app/BrowseFragment.java
@@ -86,6 +86,7 @@
  * @deprecated use {@link BrowseSupportFragment}
  */
 @Deprecated
+@SuppressWarnings("unchecked")
 public class BrowseFragment extends BaseFragment {
 
     // BUNDLE attribute for saving header show/hide status when backstack is used:
diff --git a/leanback/src/main/java/androidx/leanback/app/BrowseSupportFragment.java b/leanback/src/main/java/androidx/leanback/app/BrowseSupportFragment.java
index 0b5d7e8..b565d11 100644
--- a/leanback/src/main/java/androidx/leanback/app/BrowseSupportFragment.java
+++ b/leanback/src/main/java/androidx/leanback/app/BrowseSupportFragment.java
@@ -1256,7 +1256,7 @@
                 // have been set. In either of those cases mFragmentAdapter will be null.
                 // This way we can maintain the invariant that mMainFragmentAdapter is never
                 // null and it avoids doing null checks all over the code.
-                mMainFragmentAdapter = new MainFragmentAdapter(null);
+                mMainFragmentAdapter = new MainFragmentAdapter<>(null);
                 mMainFragmentAdapter.setFragmentHost(new FragmentHostImpl());
             }
 
diff --git a/leanback/src/main/java/androidx/leanback/app/DetailsFragment.java b/leanback/src/main/java/androidx/leanback/app/DetailsFragment.java
index ced64a8..36cac48 100644
--- a/leanback/src/main/java/androidx/leanback/app/DetailsFragment.java
+++ b/leanback/src/main/java/androidx/leanback/app/DetailsFragment.java
@@ -95,6 +95,7 @@
  * @deprecated use {@link DetailsSupportFragment}
  */
 @Deprecated
+@SuppressWarnings("unchecked")
 public class DetailsFragment extends BaseFragment {
     static final String TAG = "DetailsFragment";
     static final boolean DEBUG = false;
diff --git a/leanback/src/main/java/androidx/leanback/app/DetailsSupportFragment.java b/leanback/src/main/java/androidx/leanback/app/DetailsSupportFragment.java
index 3fb1149..9b0fae6 100644
--- a/leanback/src/main/java/androidx/leanback/app/DetailsSupportFragment.java
+++ b/leanback/src/main/java/androidx/leanback/app/DetailsSupportFragment.java
@@ -348,6 +348,7 @@
     final BaseOnItemViewSelectedListener<Object> mOnItemViewSelectedListener =
             new BaseOnItemViewSelectedListener<Object>() {
         @Override
+        @SuppressWarnings("unchecked")
         public void onItemSelected(Presenter.ViewHolder itemViewHolder, Object item,
                                    RowPresenter.ViewHolder rowViewHolder, Object row) {
             int position = mRowsSupportFragment.getVerticalGridView().getSelectedPosition();
diff --git a/leanback/src/main/java/androidx/leanback/app/PlaybackFragment.java b/leanback/src/main/java/androidx/leanback/app/PlaybackFragment.java
index ca8cd90..531e452 100644
--- a/leanback/src/main/java/androidx/leanback/app/PlaybackFragment.java
+++ b/leanback/src/main/java/androidx/leanback/app/PlaybackFragment.java
@@ -107,6 +107,7 @@
  * @deprecated use {@link PlaybackSupportFragment}
  */
 @Deprecated
+@SuppressWarnings("unchecked")
 public class PlaybackFragment extends Fragment {
     static final String BUNDLE_CONTROL_VISIBLE_ON_CREATEVIEW = "controlvisible_oncreateview";
 
diff --git a/leanback/src/main/java/androidx/leanback/app/PlaybackSupportFragment.java b/leanback/src/main/java/androidx/leanback/app/PlaybackSupportFragment.java
index 5f8c715..597264b 100644
--- a/leanback/src/main/java/androidx/leanback/app/PlaybackSupportFragment.java
+++ b/leanback/src/main/java/androidx/leanback/app/PlaybackSupportFragment.java
@@ -165,6 +165,7 @@
     private final BaseOnItemViewClickedListener mOnItemViewClickedListener =
             new BaseOnItemViewClickedListener() {
                 @Override
+                @SuppressWarnings("unchecked")
                 public void onItemClicked(Presenter.ViewHolder itemViewHolder,
                                           Object item,
                                           RowPresenter.ViewHolder rowViewHolder,
@@ -184,6 +185,7 @@
     private final BaseOnItemViewSelectedListener mOnItemViewSelectedListener =
             new BaseOnItemViewSelectedListener() {
                 @Override
+                @SuppressWarnings("unchecked")
                 public void onItemSelected(Presenter.ViewHolder itemViewHolder,
                                            Object item,
                                            RowPresenter.ViewHolder rowViewHolder,
diff --git a/leanback/src/main/java/androidx/leanback/media/PlaybackControlGlue.java b/leanback/src/main/java/androidx/leanback/media/PlaybackControlGlue.java
index f0f4f4f..795dcc4 100644
--- a/leanback/src/main/java/androidx/leanback/media/PlaybackControlGlue.java
+++ b/leanback/src/main/java/androidx/leanback/media/PlaybackControlGlue.java
@@ -193,6 +193,7 @@
 
     static class UpdatePlaybackStateHandler extends Handler {
         @Override
+        @SuppressWarnings("unchecked")
         public void handleMessage(Message msg) {
             if (msg.what == MSG_UPDATE_PLAYBACK_STATE) {
                 PlaybackControlGlue glue = ((WeakReference<PlaybackControlGlue>) msg.obj).get();
@@ -205,7 +206,7 @@
 
     static final Handler sHandler = new UpdatePlaybackStateHandler();
 
-    final WeakReference<PlaybackControlGlue> mGlueWeakReference =  new WeakReference(this);
+    final WeakReference<PlaybackControlGlue> mGlueWeakReference =  new WeakReference<>(this);
 
     /**
      * Constructor for the glue.
diff --git a/leanback/src/main/java/androidx/leanback/media/PlaybackGlue.java b/leanback/src/main/java/androidx/leanback/media/PlaybackGlue.java
index b348424..b59eb9a 100644
--- a/leanback/src/main/java/androidx/leanback/media/PlaybackGlue.java
+++ b/leanback/src/main/java/androidx/leanback/media/PlaybackGlue.java
@@ -102,7 +102,7 @@
      */
     public void addPlayerCallback(PlayerCallback playerCallback) {
         if (mPlayerCallbacks == null) {
-            mPlayerCallbacks = new ArrayList();
+            mPlayerCallbacks = new ArrayList<>();
         }
         mPlayerCallbacks.add(playerCallback);
     }
@@ -124,7 +124,7 @@
         if (mPlayerCallbacks == null) {
             return null;
         }
-        return new ArrayList(mPlayerCallbacks);
+        return new ArrayList<>(mPlayerCallbacks);
     }
 
     /**
diff --git a/leanback/src/main/java/androidx/leanback/media/PlaybackTransportControlGlue.java b/leanback/src/main/java/androidx/leanback/media/PlaybackTransportControlGlue.java
index d4b91fb..29388a8 100644
--- a/leanback/src/main/java/androidx/leanback/media/PlaybackTransportControlGlue.java
+++ b/leanback/src/main/java/androidx/leanback/media/PlaybackTransportControlGlue.java
@@ -97,6 +97,7 @@
 
     static class UpdatePlaybackStateHandler extends Handler {
         @Override
+        @SuppressWarnings("unchecked")
         public void handleMessage(Message msg) {
             if (msg.what == MSG_UPDATE_PLAYBACK_STATE) {
                 PlaybackTransportControlGlue glue =
@@ -110,7 +111,8 @@
 
     static final Handler sHandler = new UpdatePlaybackStateHandler();
 
-    final WeakReference<PlaybackBaseControlGlue> mGlueWeakReference =  new WeakReference(this);
+    final WeakReference<PlaybackBaseControlGlue> mGlueWeakReference =
+            new WeakReference<>(this);
 
     /**
      * Constructor for the glue.
diff --git a/leanback/src/main/java/androidx/leanback/util/StateMachine.java b/leanback/src/main/java/androidx/leanback/util/StateMachine.java
index 893fa74..c62e570 100644
--- a/leanback/src/main/java/androidx/leanback/util/StateMachine.java
+++ b/leanback/src/main/java/androidx/leanback/util/StateMachine.java
@@ -169,14 +169,14 @@
 
         void addIncoming(Transition t) {
             if (mIncomings == null) {
-                mIncomings = new ArrayList();
+                mIncomings = new ArrayList<>();
             }
             mIncomings.add(t);
         }
 
         void addOutgoing(Transition t) {
             if (mOutgoings == null) {
-                mOutgoings = new ArrayList();
+                mOutgoings = new ArrayList<>();
             }
             mOutgoings.add(t);
         }
@@ -255,8 +255,8 @@
     }
 
     final ArrayList<State> mStates = new ArrayList<State>();
-    final ArrayList<State> mFinishedStates = new ArrayList();
-    final ArrayList<State> mUnfinishedStates = new ArrayList();
+    final ArrayList<State> mFinishedStates = new ArrayList<>();
+    final ArrayList<State> mUnfinishedStates = new ArrayList<>();
 
     public StateMachine() {
     }
diff --git a/leanback/src/main/java/androidx/leanback/widget/AbstractMediaItemPresenter.java b/leanback/src/main/java/androidx/leanback/widget/AbstractMediaItemPresenter.java
index a216a9f..944e67e 100644
--- a/leanback/src/main/java/androidx/leanback/widget/AbstractMediaItemPresenter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/AbstractMediaItemPresenter.java
@@ -184,6 +184,7 @@
             mActionViewHolders = new ArrayList<Presenter.ViewHolder>();
             getMediaItemDetailsView().setOnClickListener(new View.OnClickListener(){
                 @Override
+                @SuppressWarnings("unchecked")
                 public void onClick(View view) {
                     if (getOnItemViewClickedListener() != null) {
                         getOnItemViewClickedListener().onItemClicked(null, null,
@@ -256,6 +257,7 @@
                 });
                 actionViewHolder.view.setOnClickListener(
                         new View.OnClickListener() {
+                            @SuppressWarnings("unchecked")
                             @Override
                             public void onClick(View view) {
                                 if (getOnItemViewClickedListener() != null) {
diff --git a/leanback/src/main/java/androidx/leanback/widget/ArrayObjectAdapter.java b/leanback/src/main/java/androidx/leanback/widget/ArrayObjectAdapter.java
index bd5a3b0..8613606 100644
--- a/leanback/src/main/java/androidx/leanback/widget/ArrayObjectAdapter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/ArrayObjectAdapter.java
@@ -32,11 +32,11 @@
     private static final Boolean DEBUG = false;
     private static final String TAG = "ArrayObjectAdapter";
 
-    private final List mItems = new ArrayList<Object>();
+    private final List<Object> mItems = new ArrayList<>();
 
     // To compute the payload correctly, we should use a temporary list to hold all the old items.
     @SuppressWarnings("WeakerAccess") /* synthetic access */
-    final List mOldItems = new ArrayList<Object>();
+    final List<Object> mOldItems = new ArrayList<>();
 
     // Un modifiable version of mItems;
     private List mUnmodifiableItems;
@@ -123,6 +123,7 @@
      * @param index The index at which the items should be inserted.
      * @param items A {@link Collection} of items to insert.
      */
+    @SuppressWarnings("unchecked")
     public void addAll(int index, Collection items) {
         int itemsCount = items.size();
         if (itemsCount == 0) {
@@ -212,6 +213,7 @@
     /**
      * Gets a read-only view of the list of object of this ArrayObjectAdapter.
      */
+    @SuppressWarnings("unchecked")
     public <E> List<E> unmodifiableList() {
 
         // The mUnmodifiableItems will only be created once as long as the content of mItems has not
@@ -237,6 +239,7 @@
      * @param callback Optional DiffCallback Object to compute the difference between the old data
      *                 set and new data set. When null, {@link #notifyChanged()} will be fired.
      */
+    @SuppressWarnings("unchecked")
     public void setItems(final List itemList, final DiffCallback callback) {
         if (callback == null) {
             // shortcut when DiffCallback is not provided
diff --git a/leanback/src/main/java/androidx/leanback/widget/DetailsOverviewRowPresenter.java b/leanback/src/main/java/androidx/leanback/widget/DetailsOverviewRowPresenter.java
index d51fa2e..31d3f38 100644
--- a/leanback/src/main/java/androidx/leanback/widget/DetailsOverviewRowPresenter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/DetailsOverviewRowPresenter.java
@@ -60,6 +60,7 @@
  * @deprecated  Use {@link FullWidthDetailsOverviewRowPresenter}
  */
 @Deprecated
+@SuppressWarnings("unchecked")
 public class DetailsOverviewRowPresenter extends RowPresenter {
 
     static final String TAG = "DetailsOverviewRowP";
diff --git a/leanback/src/main/java/androidx/leanback/widget/FullWidthDetailsOverviewRowPresenter.java b/leanback/src/main/java/androidx/leanback/widget/FullWidthDetailsOverviewRowPresenter.java
index 53e7e13..dc7a25c 100644
--- a/leanback/src/main/java/androidx/leanback/widget/FullWidthDetailsOverviewRowPresenter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/FullWidthDetailsOverviewRowPresenter.java
@@ -117,6 +117,7 @@
         }
 
         @Override
+        @SuppressWarnings("unchecked")
         public void onBind(final ItemBridgeAdapter.ViewHolder ibvh) {
             if (mViewHolder.getOnItemViewClickedListener() != null
                     || mActionClickedListener != null) {
@@ -246,6 +247,7 @@
             }
         };
 
+        @SuppressWarnings("unchecked")
         void dispatchItemSelection(View view) {
             if (!isSelected()) {
                 return;
@@ -556,9 +558,7 @@
             @Override
             public boolean onUnhandledKey(KeyEvent event) {
                 if (vh.getOnKeyListener() != null) {
-                    if (vh.getOnKeyListener().onKey(vh.view, event.getKeyCode(), event)) {
-                        return true;
-                    }
+                    return vh.getOnKeyListener().onKey(vh.view, event.getKeyCode(), event);
                 }
                 return false;
             }
diff --git a/leanback/src/main/java/androidx/leanback/widget/GridLayoutManager.java b/leanback/src/main/java/androidx/leanback/widget/GridLayoutManager.java
index faa137f..69e2ff2 100644
--- a/leanback/src/main/java/androidx/leanback/widget/GridLayoutManager.java
+++ b/leanback/src/main/java/androidx/leanback/widget/GridLayoutManager.java
@@ -1588,6 +1588,7 @@
     /**
      * Get facet from the ViewHolder or the viewType.
      */
+    @SuppressWarnings("unchecked")
     <E> E getFacet(RecyclerView.ViewHolder vh, Class<? extends E> facetClass) {
         E facet = null;
         if (vh instanceof FacetProvider) {
diff --git a/leanback/src/main/java/androidx/leanback/widget/GuidedAction.java b/leanback/src/main/java/androidx/leanback/widget/GuidedAction.java
index 888ba0b..5282770 100644
--- a/leanback/src/main/java/androidx/leanback/widget/GuidedAction.java
+++ b/leanback/src/main/java/androidx/leanback/widget/GuidedAction.java
@@ -107,7 +107,10 @@
      * Base builder class to build a {@link GuidedAction} object.  When subclass GuidedAction, you
      * can override this BuilderBase class, implements your build() method which should call
      * {@link #applyValues(GuidedAction)}.  When using GuidedAction directly, use {@link Builder}.
+     *
+     * @param <B> the type of BuilderBase
      */
+    @SuppressWarnings("unchecked")
     public abstract static class BuilderBase<B extends BuilderBase> {
         private Context mContext;
         private long mId;
diff --git a/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java b/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java
index 351d5c8..b2ec182 100644
--- a/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java
@@ -179,7 +179,7 @@
         mActionOnFocusListener.unFocus();
         if (mDiffCallback != null) {
             // temporary variable used for DiffCallback
-            final List<GuidedAction> oldActions = new ArrayList();
+            final List<GuidedAction> oldActions = new ArrayList<>();
             oldActions.addAll(mActions);
 
             // update items.
diff --git a/leanback/src/main/java/androidx/leanback/widget/GuidedDatePickerAction.java b/leanback/src/main/java/androidx/leanback/widget/GuidedDatePickerAction.java
index e822247c..7251b7a 100644
--- a/leanback/src/main/java/androidx/leanback/widget/GuidedDatePickerAction.java
+++ b/leanback/src/main/java/androidx/leanback/widget/GuidedDatePickerAction.java
@@ -30,7 +30,10 @@
      * to subclass GuidedDatePickerAction, implement your build() which should call
      * {@link #applyDatePickerValues(GuidedDatePickerAction)}.  When using GuidedDatePickerAction
      * directly, use {@link Builder}.
+     *
+     * @param <B> the type of BuilderBase
      */
+    @SuppressWarnings("unchecked")
     public abstract static class BuilderBase<B extends BuilderBase>
             extends GuidedAction.BuilderBase<B> {
 
diff --git a/leanback/src/main/java/androidx/leanback/widget/ItemBridgeAdapter.java b/leanback/src/main/java/androidx/leanback/widget/ItemBridgeAdapter.java
index b4344d9..1bfa2ca 100644
--- a/leanback/src/main/java/androidx/leanback/widget/ItemBridgeAdapter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/ItemBridgeAdapter.java
@@ -412,6 +412,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public final  void onBindViewHolder(RecyclerView.ViewHolder holder, int position,
             List payloads) {
         if (DEBUG) Log.v(TAG, "onBindViewHolder position " + position);
diff --git a/leanback/src/main/java/androidx/leanback/widget/ListRowPresenter.java b/leanback/src/main/java/androidx/leanback/widget/ListRowPresenter.java
index 2c05641..edd16df 100644
--- a/leanback/src/main/java/androidx/leanback/widget/ListRowPresenter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/ListRowPresenter.java
@@ -245,6 +245,7 @@
         }
 
         @Override
+        @SuppressWarnings("unchecked")
         public void onBind(final ItemBridgeAdapter.ViewHolder viewHolder) {
             // Only when having an OnItemClickListener, we will attach the OnClickListener.
             if (mRowViewHolder.getOnItemViewClickedListener() != null) {
@@ -495,6 +496,7 @@
     /*
      * Perform operations when a child of horizontal grid view is selected.
      */
+    @SuppressWarnings("unchecked")
     void selectChildView(ViewHolder rowViewHolder, View view, boolean fireEvent) {
         if (view != null) {
             if (rowViewHolder.mSelected) {
@@ -580,6 +582,7 @@
      * The method should only be called from onRowViewSelected().
      */
     @Override
+    @SuppressWarnings("unchecked")
     protected void dispatchItemSelectedListener(RowPresenter.ViewHolder holder, boolean selected) {
         ViewHolder vh = (ViewHolder)holder;
         ItemBridgeAdapter.ViewHolder itemViewHolder = (ItemBridgeAdapter.ViewHolder)
diff --git a/leanback/src/main/java/androidx/leanback/widget/NonOverlappingLinearLayout.java b/leanback/src/main/java/androidx/leanback/widget/NonOverlappingLinearLayout.java
index 6b02520..9648058 100644
--- a/leanback/src/main/java/androidx/leanback/widget/NonOverlappingLinearLayout.java
+++ b/leanback/src/main/java/androidx/leanback/widget/NonOverlappingLinearLayout.java
@@ -32,7 +32,7 @@
 
     boolean mFocusableViewAvailableFixEnabled = false;
     boolean mDeferFocusableViewAvailableInLayout;
-    final ArrayList<ArrayList<View>> mSortedAvailableViews = new ArrayList();
+    final ArrayList<ArrayList<View>> mSortedAvailableViews = new ArrayList<>();
 
 
     public NonOverlappingLinearLayout(Context context) {
@@ -70,7 +70,7 @@
                     mSortedAvailableViews.remove(mSortedAvailableViews.size() - 1);
                 }
                 while (mSortedAvailableViews.size() < getChildCount()) {
-                    mSortedAvailableViews.add(new ArrayList());
+                    mSortedAvailableViews.add(new ArrayList<>());
                 }
             }
             super.onLayout(changed, l, t, r, b);
diff --git a/leanback/src/main/java/androidx/leanback/widget/ParallaxEffect.java b/leanback/src/main/java/androidx/leanback/widget/ParallaxEffect.java
index 1ef8379..b749d75 100644
--- a/leanback/src/main/java/androidx/leanback/widget/ParallaxEffect.java
+++ b/leanback/src/main/java/androidx/leanback/widget/ParallaxEffect.java
@@ -43,7 +43,7 @@
  */
 public abstract class ParallaxEffect {
 
-    final List<Parallax.PropertyMarkerValue> mMarkerValues = new ArrayList(2);
+    final List<Parallax.PropertyMarkerValue> mMarkerValues = new ArrayList<>(2);
     final List<Float> mWeights = new ArrayList<Float>(2);
     final List<Float> mTotalWeights = new ArrayList<Float>(2);
     final List<ParallaxTarget> mTargets = new ArrayList<ParallaxTarget>(4);
@@ -175,6 +175,7 @@
      * @param <V> Type of target property value, either Integer or Float.
      * @see ParallaxTarget#isDirectMapping()
      */
+    @SuppressWarnings("unchecked")
     public final <T, V extends Number> ParallaxEffect target(T targetObject,
             Property<T, V> targetProperty) {
         mTargets.add(new ParallaxTarget.DirectPropertyTarget(targetObject, targetProperty));
diff --git a/leanback/src/main/java/androidx/leanback/widget/ParallaxTarget.java b/leanback/src/main/java/androidx/leanback/widget/ParallaxTarget.java
index 09b0560..d84effc 100644
--- a/leanback/src/main/java/androidx/leanback/widget/ParallaxTarget.java
+++ b/leanback/src/main/java/androidx/leanback/widget/ParallaxTarget.java
@@ -125,6 +125,7 @@
         }
 
         @Override
+        @SuppressWarnings("unchecked")
         public void directUpdate(Number value) {
             mProperty.set((T) mObject, (V) value);
         }
diff --git a/leanback/src/main/java/androidx/leanback/widget/PlaybackControlsRowPresenter.java b/leanback/src/main/java/androidx/leanback/widget/PlaybackControlsRowPresenter.java
index 1cdea537..f1cf7cb 100644
--- a/leanback/src/main/java/androidx/leanback/widget/PlaybackControlsRowPresenter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/PlaybackControlsRowPresenter.java
@@ -106,6 +106,7 @@
             }
         }
 
+        @SuppressWarnings("unchecked")
         void dispatchItemSelection() {
             if (!isSelected()) {
                 return;
@@ -121,7 +122,7 @@
                             ViewHolder.this, getRow());
                 }
             }
-        };
+        }
 
         Presenter getPresenter(boolean primary) {
             ObjectAdapter adapter = primary
@@ -183,6 +184,7 @@
     private final OnControlClickedListener mOnControlClickedListener =
             new OnControlClickedListener() {
         @Override
+        @SuppressWarnings("unchecked")
         public void onControlClicked(Presenter.ViewHolder itemViewHolder, Object item,
                 ControlBarPresenter.BoundData data) {
             ViewHolder vh = ((BoundData) data).mRowViewHolder;
diff --git a/leanback/src/main/java/androidx/leanback/widget/PlaybackTransportRowPresenter.java b/leanback/src/main/java/androidx/leanback/widget/PlaybackTransportRowPresenter.java
index f8383e7..a079ecb 100644
--- a/leanback/src/main/java/androidx/leanback/widget/PlaybackTransportRowPresenter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/PlaybackTransportRowPresenter.java
@@ -408,6 +408,7 @@
             mThumbsBar.setVisibility(View.INVISIBLE);
         }
 
+        @SuppressWarnings("unchecked")
         void dispatchItemSelection() {
             if (!isSelected()) {
                 return;
@@ -566,6 +567,7 @@
     private final OnControlClickedListener mOnControlClickedListener =
             new OnControlClickedListener() {
         @Override
+        @SuppressWarnings("unchecked")
         public void onControlClicked(Presenter.ViewHolder itemViewHolder, Object item,
                 ControlBarPresenter.BoundData data) {
             ViewHolder vh = ((BoundData) data).mRowViewHolder;
@@ -703,15 +705,13 @@
         vh.mSecondaryControlsDock.addView(vh.mSecondaryControlsVh.view);
         ((PlaybackTransportRowView) vh.view.findViewById(R.id.transport_row))
                 .setOnUnhandledKeyListener(new PlaybackTransportRowView.OnUnhandledKeyListener() {
-                @Override
-                public boolean onUnhandledKey(KeyEvent event) {
-                    if (vh.getOnKeyListener() != null) {
-                        if (vh.getOnKeyListener().onKey(vh.view, event.getKeyCode(), event)) {
-                            return true;
+                    @Override
+                    public boolean onUnhandledKey(KeyEvent event) {
+                        if (vh.getOnKeyListener() != null) {
+                            return vh.getOnKeyListener().onKey(vh.view, event.getKeyCode(), event);
                         }
+                        return false;
                     }
-                    return false;
-                }
             });
     }
 
@@ -776,6 +776,7 @@
      *
      * @param vh ViewHolder of PlaybackTransportRowPresenter
      */
+    @SuppressWarnings("unchecked")
     protected void onProgressBarClicked(ViewHolder vh) {
         if (vh != null) {
             if (vh.mPlayPauseAction == null) {
diff --git a/leanback/src/main/java/androidx/leanback/widget/RowPresenter.java b/leanback/src/main/java/androidx/leanback/widget/RowPresenter.java
index 6855590..af7e50e 100644
--- a/leanback/src/main/java/androidx/leanback/widget/RowPresenter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/RowPresenter.java
@@ -494,6 +494,7 @@
      * A Subclass of RowPresenter having child items should override this method and dispatch
      * events with item information.
      */
+    @SuppressWarnings("unchecked")
     protected void dispatchItemSelectedListener(ViewHolder vh, boolean selected) {
         if (selected) {
             if (vh.mOnItemViewSelectedListener != null) {
diff --git a/lifecycle/lifecycle-livedata-core/build.gradle b/lifecycle/lifecycle-livedata-core/build.gradle
index 74d75f5..d91042c 100644
--- a/lifecycle/lifecycle-livedata-core/build.gradle
+++ b/lifecycle/lifecycle-livedata-core/build.gradle
@@ -44,5 +44,4 @@
     inceptionYear = "2017"
     description = "Android Lifecycle LiveData Core"
     url = AndroidXExtension.ARCHITECTURE_URL
-    failOnUncheckedWarnings = false
-}
+    }
diff --git a/lifecycle/lifecycle-viewmodel/build.gradle b/lifecycle/lifecycle-viewmodel/build.gradle
index 6a1ba48..a38cb33 100644
--- a/lifecycle/lifecycle-viewmodel/build.gradle
+++ b/lifecycle/lifecycle-viewmodel/build.gradle
@@ -50,5 +50,4 @@
     inceptionYear = "2017"
     description = "Android Lifecycle ViewModel"
     url = AndroidXExtension.ARCHITECTURE_URL
-    failOnUncheckedWarnings = false
-}
+    }
diff --git a/loader/loader/build.gradle b/loader/loader/build.gradle
index e83f4a1..ec9f490 100644
--- a/loader/loader/build.gradle
+++ b/loader/loader/build.gradle
@@ -31,5 +31,4 @@
     mavenGroup = LibraryGroups.LOADER
     inceptionYear = "2011"
     description = "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren\'t a part of the framework APIs. Compatible on devices running API 14 or later."
-    failOnUncheckedWarnings = false
-}
+    }
diff --git a/media/build.gradle b/media/build.gradle
index c81ca57..f0a49ef 100644
--- a/media/build.gradle
+++ b/media/build.gradle
@@ -39,7 +39,6 @@
     mavenGroup = LibraryGroups.MEDIA
     inceptionYear = "2011"
     description = "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later."
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
     trackRestrictedAPIs = false // TODO: Remove it (b/131031933)
 }
diff --git a/media/src/main/java/android/support/v4/media/MediaBrowserCompat.java b/media/src/main/java/android/support/v4/media/MediaBrowserCompat.java
index b79a287..c3935c5 100644
--- a/media/src/main/java/android/support/v4/media/MediaBrowserCompat.java
+++ b/media/src/main/java/android/support/v4/media/MediaBrowserCompat.java
@@ -1404,6 +1404,7 @@
         }
 
         @Override
+        @SuppressWarnings("unchecked")
         public void onLoadChildren(final Messenger callback, final String parentId,
                 final List list, final Bundle options, final Bundle notifyChildrenChangedOptions) {
             // Check that there hasn't been a disconnect or a different ServiceConnection.
@@ -1947,7 +1948,7 @@
         }
 
         @Override
-        @SuppressWarnings("ReferenceEquality")
+        @SuppressWarnings({"ReferenceEquality", "unchecked"})
         public void onLoadChildren(Messenger callback, String parentId, List list, Bundle options,
                 Bundle notifyChildrenChangedOptions) {
             if (mCallbacksMessenger != callback) {
@@ -2117,9 +2118,7 @@
 
                         serviceCallback.onServiceConnected(callbacksMessenger,
                                 data.getString(DATA_MEDIA_ITEM_ID),
-                                (MediaSessionCompat.Token) data.getParcelable(
-                                        DATA_MEDIA_SESSION_TOKEN),
-                                rootHints);
+                                data.getParcelable(DATA_MEDIA_SESSION_TOKEN), rootHints);
                         break;
                     }
                     case SERVICE_MSG_ON_CONNECT_FAILED:
diff --git a/media/src/main/java/android/support/v4/media/session/MediaControllerCompat.java b/media/src/main/java/android/support/v4/media/session/MediaControllerCompat.java
index 97c2ed4..d8423b9 100644
--- a/media/src/main/java/android/support/v4/media/session/MediaControllerCompat.java
+++ b/media/src/main/java/android/support/v4/media/session/MediaControllerCompat.java
@@ -1105,6 +1105,7 @@
             }
 
             @Override
+            @SuppressWarnings("unchecked")
             public void handleMessage(Message msg) {
                 if (!mRegistered) {
                     return;
diff --git a/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java b/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java
index fd33368..aba369a 100644
--- a/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java
+++ b/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java
@@ -1254,6 +1254,7 @@
     }
 
     @RequiresApi(21)
+    @SuppressWarnings("unchecked")
     static class ResultWrapper<T> {
         MediaBrowserService.Result mResultFwk;
 
diff --git a/media/version-compat-tests/lib/build.gradle b/media/version-compat-tests/lib/build.gradle
index df62c32..bd1041d 100644
--- a/media/version-compat-tests/lib/build.gradle
+++ b/media/version-compat-tests/lib/build.gradle
@@ -28,6 +28,5 @@
 }
 
 androidx {
-    failOnUncheckedWarnings = false
     toolingProject = true
 }
diff --git a/media/version-compat-tests/lib/src/main/java/android/support/mediacompat/testlib/util/IntentUtil.java b/media/version-compat-tests/lib/src/main/java/android/support/mediacompat/testlib/util/IntentUtil.java
index 532b2a7..20bc0d5 100644
--- a/media/version-compat-tests/lib/src/main/java/android/support/mediacompat/testlib/util/IntentUtil.java
+++ b/media/version-compat-tests/lib/src/main/java/android/support/mediacompat/testlib/util/IntentUtil.java
@@ -103,6 +103,7 @@
         context.sendBroadcast(intent);
     }
 
+    @SuppressWarnings("unchecked")
     private static Intent createIntent(ComponentName componentName, int methodId, Object arg) {
         Intent intent = new Intent();
         intent.setComponent(componentName);
diff --git a/media2/common/build.gradle b/media2/common/build.gradle
index 522fcc2..3add07b 100644
--- a/media2/common/build.gradle
+++ b/media2/common/build.gradle
@@ -37,7 +37,6 @@
     inceptionYear = "2018"
     description = "Media2 Common"
     // TODO: Remove these (b/130838274)
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
     trackRestrictedAPIs = false // TODO: Remove it (b/131561173)
 }
diff --git a/media2/common/src/main/java/androidx/media2/common/MediaParcelUtils.java b/media2/common/src/main/java/androidx/media2/common/MediaParcelUtils.java
index 9cefa8a..c8a119e 100644
--- a/media2/common/src/main/java/androidx/media2/common/MediaParcelUtils.java
+++ b/media2/common/src/main/java/androidx/media2/common/MediaParcelUtils.java
@@ -73,7 +73,7 @@
     @SuppressWarnings("TypeParameterUnusedInFormals")
     @Nullable
     public static <T extends VersionedParcelable> T fromParcelable(@NonNull ParcelImpl p) {
-        return ParcelUtils.<T>fromParcelable(p);
+        return ParcelUtils.fromParcelable(p);
     }
 
     /**
@@ -82,7 +82,7 @@
      * @param parcelList
      * @return
      */
-    @SuppressWarnings("TypeParameterUnusedInFormals")
+    @SuppressWarnings({"TypeParameterUnusedInFormals", "unchecked"})
     @NonNull
     public static <T extends VersionedParcelable> List<T> fromParcelableList(
             @NonNull List<ParcelImpl> parcelList) {
@@ -110,6 +110,7 @@
         }
 
         @Override
+        @SuppressWarnings("unchecked")
         public MediaItem getVersionedParcel() {
             return mItem;
         }
diff --git a/media2/player/build.gradle b/media2/player/build.gradle
index 6fdcfcc..7cd48fc 100644
--- a/media2/player/build.gradle
+++ b/media2/player/build.gradle
@@ -47,7 +47,6 @@
     inceptionYear = "2018"
     description = "Media2 Player"
     // TODO: Remove these (b/130838274)
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
     trackRestrictedAPIs = false // TODO: Remove it (b/131561173)
 }
diff --git a/media2/player/src/main/java/androidx/media2/player/MediaPlayer.java b/media2/player/src/main/java/androidx/media2/player/MediaPlayer.java
index 2889929..c10a767 100644
--- a/media2/player/src/main/java/androidx/media2/player/MediaPlayer.java
+++ b/media2/player/src/main/java/androidx/media2/player/MediaPlayer.java
@@ -715,6 +715,7 @@
         }, mExecutor);
     }
 
+    @SuppressWarnings("unchecked")
     private void addPendingFuture(final PendingFuture pendingFuture) {
         synchronized (mPendingFutures) {
             mPendingFutures.add(pendingFuture);
@@ -2924,7 +2925,7 @@
         return (value > maxValue) ? maxValue : value;
     }
 
-    @SuppressWarnings("WeakerAccess") /* synthetic access */
+    @SuppressWarnings({"WeakerAccess", "unchecked"}) /* synthetic access */
     void handleCallComplete(MediaPlayer2 mp, final MediaItem item, int what, int status) {
         PendingCommand expected;
         synchronized (mPendingCommands) {
diff --git a/media2/player/src/main/java/androidx/media2/player/MediaPlayer2Impl.java b/media2/player/src/main/java/androidx/media2/player/MediaPlayer2Impl.java
index 03eff11..d9b842a 100644
--- a/media2/player/src/main/java/androidx/media2/player/MediaPlayer2Impl.java
+++ b/media2/player/src/main/java/androidx/media2/player/MediaPlayer2Impl.java
@@ -672,7 +672,7 @@
                     "Illegal null Executor for the EventCallback");
         }
         synchronized (mLock) {
-            mMp2EventCallbackRecord = new Pair(executor, eventCallback);
+            mMp2EventCallbackRecord = new Pair<>(executor, eventCallback);
         }
     }
 
@@ -708,7 +708,7 @@
                     "Illegal null Executor for the EventCallback");
         }
         synchronized (mLock) {
-            mDrmEventCallbackRecord = new Pair(executor, eventCallback);
+            mDrmEventCallbackRecord = new Pair<>(executor, eventCallback);
         }
     }
 
diff --git a/media2/player/src/main/java/androidx/media2/player/exoplayer/DataSourceCallbackDataSource.java b/media2/player/src/main/java/androidx/media2/player/exoplayer/DataSourceCallbackDataSource.java
index 4c4b845..d8e5ac2 100644
--- a/media2/player/src/main/java/androidx/media2/player/exoplayer/DataSourceCallbackDataSource.java
+++ b/media2/player/src/main/java/androidx/media2/player/exoplayer/DataSourceCallbackDataSource.java
@@ -39,6 +39,7 @@
  * @hide
  */
 @RestrictTo(LIBRARY_GROUP_PREFIX)
+@SuppressWarnings("unchecked")
 @SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
 public final class DataSourceCallbackDataSource extends BaseDataSource {
 
diff --git a/media2/player/src/main/java/androidx/media2/player/exoplayer/FileDescriptorDataSource.java b/media2/player/src/main/java/androidx/media2/player/exoplayer/FileDescriptorDataSource.java
index 0d50d0e..d85f9e7 100644
--- a/media2/player/src/main/java/androidx/media2/player/exoplayer/FileDescriptorDataSource.java
+++ b/media2/player/src/main/java/androidx/media2/player/exoplayer/FileDescriptorDataSource.java
@@ -41,6 +41,7 @@
  * @hide
  */
 @RestrictTo(LIBRARY_GROUP_PREFIX)
+@SuppressWarnings("unchecked")
 @SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
 /* package */ class FileDescriptorDataSource extends BaseDataSource {
 
diff --git a/media2/session/build.gradle b/media2/session/build.gradle
index 4ea98ff..584b30e 100644
--- a/media2/session/build.gradle
+++ b/media2/session/build.gradle
@@ -40,7 +40,6 @@
     inceptionYear = "2018"
     description = "Media2 Session"
     // TODO: Remove these (b/130838274)
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
     trackRestrictedAPIs = false // TODO: Remove it (b/131561173)
 }
diff --git a/media2/session/src/main/java/androidx/media2/session/MediaController.java b/media2/session/src/main/java/androidx/media2/session/MediaController.java
index 1f37d9d..e8e3499 100644
--- a/media2/session/src/main/java/androidx/media2/session/MediaController.java
+++ b/media2/session/src/main/java/androidx/media2/session/MediaController.java
@@ -1555,6 +1555,7 @@
          * @see #setConnectionHints(Bundle)
          */
         @NonNull
+        @SuppressWarnings("unchecked")
         public U setSessionToken(@NonNull SessionToken token) {
             if (token == null) {
                 throw new NullPointerException("token shouldn't be null");
@@ -1574,6 +1575,7 @@
          * @return The Builder to allow chaining
          */
         @NonNull
+        @SuppressWarnings("unchecked")
         public U setSessionCompatToken(@NonNull MediaSessionCompat.Token compatToken) {
             if (compatToken == null) {
                 throw new NullPointerException("compatToken shouldn't be null");
@@ -1596,6 +1598,7 @@
          * @return The Builder to allow chaining
          */
         @NonNull
+        @SuppressWarnings("unchecked")
         public U setConnectionHints(@NonNull Bundle connectionHints) {
             if (connectionHints == null) {
                 throw new NullPointerException("connectionHints shouldn't be null");
@@ -1612,6 +1615,7 @@
          * @return The Builder to allow chaining
          */
         @NonNull
+        @SuppressWarnings("unchecked")
         public U setControllerCallback(@NonNull Executor executor, @NonNull C callback) {
             if (executor == null) {
                 throw new NullPointerException("executor shouldn't be null");
diff --git a/media2/session/src/main/java/androidx/media2/session/MediaSession.java b/media2/session/src/main/java/androidx/media2/session/MediaSession.java
index 837fb95..67c1f15 100644
--- a/media2/session/src/main/java/androidx/media2/session/MediaSession.java
+++ b/media2/session/src/main/java/androidx/media2/session/MediaSession.java
@@ -1269,6 +1269,7 @@
          *
          * @param pi The intent to launch to show UI for this session.
          */
+        @SuppressWarnings("unchecked")
         @NonNull U setSessionActivity(@Nullable PendingIntent pi) {
             mSessionActivity = pi;
             return (U) this;
@@ -1286,6 +1287,7 @@
         // Note: This ID is not visible to the controllers. ID is introduced in order to prevent
         // apps from creating multiple sessions without any clear reasons. If they create two
         // sessions with the same ID in a process, then an IllegalStateException will be thrown.
+        @SuppressWarnings("unchecked")
         @NonNull U setId(@NonNull String id) {
             if (id == null) {
                 throw new NullPointerException("id shouldn't be null");
@@ -1301,6 +1303,7 @@
          * @param callback session callback.
          * @return
          */
+        @SuppressWarnings("unchecked")
         @NonNull U setSessionCallback(@NonNull Executor executor, @NonNull C callback) {
             if (executor == null) {
                 throw new NullPointerException("executor shouldn't be null");
@@ -1321,6 +1324,7 @@
          * @see SessionToken#getExtras()
          */
         @NonNull
+        @SuppressWarnings("unchecked")
         public U setExtras(@NonNull Bundle extras) {
             if (extras == null) {
                 throw new NullPointerException("extras shouldn't be null");
diff --git a/media2/session/src/main/java/androidx/media2/session/MediaSessionImplBase.java b/media2/session/src/main/java/androidx/media2/session/MediaSessionImplBase.java
index ee83e85..325cf14 100644
--- a/media2/session/src/main/java/androidx/media2/session/MediaSessionImplBase.java
+++ b/media2/session/src/main/java/androidx/media2/session/MediaSessionImplBase.java
@@ -409,6 +409,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public @NonNull List<ControllerInfo> getConnectedControllers() {
         List<ControllerInfo> controllers = new ArrayList<>();
         controllers.addAll(mSessionStub.getConnectedControllersManager()
@@ -483,6 +484,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public ListenableFuture<PlayerResult> play() {
         return dispatchPlayerTask(new PlayerTask<ListenableFuture<PlayerResult>>() {
             @Override
@@ -1686,6 +1688,7 @@
         final ListenableFuture<T>[] mFutures;
         AtomicInteger mSuccessCount = new AtomicInteger(0);
 
+        @SuppressWarnings("unchecked")
         public static <U extends BaseResult> CombinedCommandResultFuture create(
                 Executor executor, ListenableFuture<U>... futures) {
             return new CombinedCommandResultFuture<U>(executor, futures);
diff --git a/media2/session/src/main/java/androidx/media2/session/SequencedFutureManager.java b/media2/session/src/main/java/androidx/media2/session/SequencedFutureManager.java
index ccf15fb..ce5a4da 100644
--- a/media2/session/src/main/java/androidx/media2/session/SequencedFutureManager.java
+++ b/media2/session/src/main/java/androidx/media2/session/SequencedFutureManager.java
@@ -79,6 +79,7 @@
      * @param seq sequence number to find future
      * @param result result to set
      */
+    @SuppressWarnings("unchecked")
     public <T> void setFutureResult(int seq, T result) {
         synchronized (mLock) {
             SequencedFuture future = mSeqToFutureMap.remove(seq);
@@ -103,6 +104,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void close() {
         List<SequencedFuture> pendingResults = new ArrayList<>();
         synchronized (mLock) {
@@ -122,7 +124,6 @@
          * Creates a new {@code ResolvableFuture} that can be completed or cancelled by a later
          * method call.
          */
-        @SuppressWarnings("WeakerAccess") /* synthetic access */
         static <T> SequencedFuture<T> create(int seq, @NonNull T resultWhenClosed) {
             return new SequencedFuture<T>(seq, resultWhenClosed);
         }
diff --git a/media2/widget/build.gradle b/media2/widget/build.gradle
index 7e6b165..887e895 100644
--- a/media2/widget/build.gradle
+++ b/media2/widget/build.gradle
@@ -56,6 +56,5 @@
     inceptionYear = "2018"
     description = "AndroidX Media2 Widget"
     // TODO: Remove these (b/130838274)
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/mediarouter/build.gradle b/mediarouter/build.gradle
index 460f707..e29baa3 100644
--- a/mediarouter/build.gradle
+++ b/mediarouter/build.gradle
@@ -43,6 +43,5 @@
     mavenGroup = LibraryGroups.MEDIAROUTER
     inceptionYear = "2013"
     description = "Android MediaRouter Support Library"
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteChooserDialog.java b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteChooserDialog.java
index 9edf6ae..db630db 100644
--- a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteChooserDialog.java
+++ b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteChooserDialog.java
@@ -78,6 +78,7 @@
     private ListView mListView;
     private boolean mAttachedToWindow;
     private long mLastUpdateTime;
+    @SuppressWarnings("unchecked")
     private final Handler mHandler = new Handler() {
         @Override
         public void handleMessage(Message message) {
diff --git a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteDynamicChooserDialog.java b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteDynamicChooserDialog.java
index ecbbf20..27ffa88 100644
--- a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteDynamicChooserDialog.java
+++ b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteDynamicChooserDialog.java
@@ -83,6 +83,7 @@
     private boolean mAttachedToWindow;
     private long mUpdateRoutesDelayMs;
     private long mLastUpdateTime;
+    @SuppressWarnings("unchecked")
     private final Handler mHandler = new Handler() {
         @Override
         public void handleMessage(Message message) {
diff --git a/recyclerview/recyclerview/build.gradle b/recyclerview/recyclerview/build.gradle
index d244d70..7fe7a61 100644
--- a/recyclerview/recyclerview/build.gradle
+++ b/recyclerview/recyclerview/build.gradle
@@ -48,6 +48,5 @@
     mavenGroup = LibraryGroups.RECYCLERVIEW
     inceptionYear = "2014"
     description = "Android Support RecyclerView v7"
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java
index 6f422d9..c75d1bf 100644
--- a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java
+++ b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java
@@ -5977,6 +5977,7 @@
          *                   bind the holder.
          * @return
          */
+        @SuppressWarnings("unchecked")
         private boolean tryBindViewHolderByDeadline(@NonNull ViewHolder holder, int offsetPosition,
                 int position, long deadlineNs) {
             holder.mOwnerRecyclerView = RecyclerView.this;
@@ -6727,6 +6728,7 @@
             return null;
         }
 
+        @SuppressWarnings("unchecked")
         void dispatchViewRecycled(@NonNull ViewHolder holder) {
             if (mRecyclerListener != null) {
                 mRecyclerListener.onViewRecycled(holder);
@@ -7499,6 +7501,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     void dispatchChildDetached(View child) {
         final ViewHolder viewHolder = getChildViewHolderInt(child);
         onChildDetachedFromWindow(child);
@@ -7513,6 +7516,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     void dispatchChildAttached(View child) {
         final ViewHolder viewHolder = getChildViewHolderInt(child);
         onChildAttachedToWindow(child);
@@ -12500,7 +12504,7 @@
          *                   to
          *                   preserve cross functionality and avoid conflicts.
          */
-        @SuppressWarnings("TypeParameterUnusedInFormals")
+        @SuppressWarnings({"TypeParameterUnusedInFormals", "unchecked"})
         public <T> T get(int resourceId) {
             if (mData == null) {
                 return null;
diff --git a/recyclerview/selection/build.gradle b/recyclerview/selection/build.gradle
index 66d1d82..17b00dc 100644
--- a/recyclerview/selection/build.gradle
+++ b/recyclerview/selection/build.gradle
@@ -46,6 +46,5 @@
     mavenGroup = LibraryGroups.RECYCLERVIEW
     inceptionYear = "2017"
     description = "Library providing item selection framework for RecyclerView. Support for touch based and band selection is provided."
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
index a513f57..e8540ce 100644
--- a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
+++ b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
@@ -50,6 +50,7 @@
  * @hide
  */
 @RestrictTo(LIBRARY)
+@SuppressWarnings("unchecked")
 public class DefaultSelectionTracker<K> extends SelectionTracker<K> {
 
     private static final String TAG = "DefaultSelectionTracker";
@@ -357,7 +358,7 @@
         return mAdapterObserver;
     }
 
-    @SuppressWarnings("WeakerAccess") /* synthetic access */
+    @SuppressWarnings({"WeakerAccess", "unchecked"}) /* synthetic access */
     void onDataSetChanged() {
         mSelection.clearProvisionalSelection();
 
@@ -510,7 +511,6 @@
     }
 
     @Override
-    @SuppressWarnings("unchecked")
     public final void onSaveInstanceState(@NonNull Bundle state) {
         if (mSelection.isEmpty()) {
             return;
diff --git a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/GestureRouter.java b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/GestureRouter.java
index 797f32d..3c25415 100644
--- a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/GestureRouter.java
+++ b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/GestureRouter.java
@@ -43,6 +43,7 @@
         mDelegates = new ToolHandlerRegistry<>(defaultDelegate);
     }
 
+    @SuppressWarnings("unchecked")
     GestureRouter() {
         this((T) new SimpleOnGestureListener());
     }
diff --git a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/GridModel.java b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/GridModel.java
index 17958ad..993727b3 100644
--- a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/GridModel.java
+++ b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/GridModel.java
@@ -101,6 +101,7 @@
 
     private final OnScrollListener mScrollListener;
 
+    @SuppressWarnings("unchecked")
     GridModel(
             GridHost host,
             ItemKeyProvider<K> keyProvider,
@@ -284,6 +285,7 @@
      * mSelection, so computeCurrentSelection() should be called before this
      * function.
      */
+    @SuppressWarnings("unchecked")
     private void notifySelectionChanged() {
         for (SelectionObserver listener : mOnSelectionChangedListeners) {
             listener.onSelectionChanged(mSelection);
diff --git a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/StorageStrategy.java b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/StorageStrategy.java
index a27752f..9334d8a 100644
--- a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/StorageStrategy.java
+++ b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/StorageStrategy.java
@@ -90,7 +90,7 @@
      * (like {@link android.net.Uri}).
      */
     public static <K extends Parcelable> StorageStrategy<K> createParcelableStorage(Class<K> type) {
-        return new ParcelableStorageStrategy(type);
+        return new ParcelableStorageStrategy<>(type);
     }
 
     /**
diff --git a/remotecallback/build.gradle b/remotecallback/build.gradle
index 0cc159e..ae262cd 100644
--- a/remotecallback/build.gradle
+++ b/remotecallback/build.gradle
@@ -50,6 +50,5 @@
     mavenGroup = LibraryGroups.REMOTECALLBACK
     inceptionYear = "2018"
     description = "Wraps PendingIntents in a friendly and easier way to handle remote callbacks"
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/remotecallback/processor/build.gradle b/remotecallback/processor/build.gradle
index 7bf917f..321b450 100644
--- a/remotecallback/processor/build.gradle
+++ b/remotecallback/processor/build.gradle
@@ -38,7 +38,6 @@
     mavenGroup = LibraryGroups.REMOTECALLBACK
     inceptionYear = "2018"
     description = "Compiler for RemoteCallback implementations"
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
     compilationTarget = CompilationTarget.HOST
 }
diff --git a/remotecallback/src/main/java/androidx/remotecallback/CallbackHandlerRegistry.java b/remotecallback/src/main/java/androidx/remotecallback/CallbackHandlerRegistry.java
index 4dc9b72..6d9a1ec 100644
--- a/remotecallback/src/main/java/androidx/remotecallback/CallbackHandlerRegistry.java
+++ b/remotecallback/src/main/java/androidx/remotecallback/CallbackHandlerRegistry.java
@@ -51,7 +51,7 @@
     /**
      * @hide
      */
-    @SuppressWarnings("TypeParameterUnusedInFormals")
+    @SuppressWarnings({"TypeParameterUnusedInFormals", "unchecked"})
     @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
     public <T extends CallbackReceiver> T getAndResetStub(Class<? extends CallbackReceiver> cls,
             Context context, String authority) {
@@ -195,6 +195,7 @@
      * Note: This should only be called by generated code, there is no reason to reference this
      * otherwise.
      */
+    @SuppressWarnings("unchecked")
     public static RemoteCallback stubToRemoteCallback(CallbackReceiver receiver,
             Class<? extends CallbackReceiver> cls, Bundle args, String method) {
         if (!(receiver instanceof CallbackBase)) {
@@ -227,7 +228,7 @@
      */
     public interface CallbackHandler<T extends CallbackReceiver> {
         /**
-         * Executes a callback given a Bundle of aurgements.
+         * Executes a callback given a Bundle of arguments.
          * Note: This should only be called by generated code, there is no reason to reference this
          * otherwise.
          */
diff --git a/savedstate/build.gradle b/savedstate/build.gradle
index a8977ed..f7c1023 100644
--- a/savedstate/build.gradle
+++ b/savedstate/build.gradle
@@ -23,7 +23,7 @@
 }
 
 dependencies {
-    api("androidx.annotation:annotation:1.0.0")
+    api("androidx.annotation:annotation:1.1.0")
     implementation(ARCH_CORE_COMMON)
     implementation(ARCH_LIFECYCLE_COMMON, libs.exclude_annotations_transitive)
     androidTestImplementation(KOTLIN_STDLIB)
diff --git a/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryController.java b/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryController.java
index 2519239..6fb25d2 100644
--- a/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryController.java
+++ b/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryController.java
@@ -51,7 +51,6 @@
      *
      * @param savedState restored state
      */
-    @SuppressWarnings("WeakerAccess")
     @MainThread
     public void performRestore(@Nullable Bundle savedState) {
         Lifecycle lifecycle = mOwner.getLifecycle();
diff --git a/slices/builders/build.gradle b/slices/builders/build.gradle
index 11f4a6e..914633c 100644
--- a/slices/builders/build.gradle
+++ b/slices/builders/build.gradle
@@ -39,6 +39,5 @@
     mavenGroup = LibraryGroups.SLICE
     inceptionYear = "2017"
     description = "A set of builders to create templates using SliceProvider APIs"
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/slices/builders/ktx/build.gradle b/slices/builders/ktx/build.gradle
index 768a63a..73ed2a7 100644
--- a/slices/builders/ktx/build.gradle
+++ b/slices/builders/ktx/build.gradle
@@ -58,6 +58,5 @@
     mavenGroup = LibraryGroups.SLICE
     inceptionYear = "2018"
     description = "A set of Kotlin extension methods built on top of slice-builders APIs."
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/slices/builders/src/main/java/androidx/slice/builders/TemplateSliceBuilder.java b/slices/builders/src/main/java/androidx/slice/builders/TemplateSliceBuilder.java
index dd9464c..12d7b07 100644
--- a/slices/builders/src/main/java/androidx/slice/builders/TemplateSliceBuilder.java
+++ b/slices/builders/src/main/java/androidx/slice/builders/TemplateSliceBuilder.java
@@ -144,6 +144,7 @@
      * @hide
      */
     @RestrictTo(LIBRARY)
+    @SuppressWarnings("unchecked")
     static <T> Pair<SliceSpec, Class<? extends TemplateBuilderImpl>> pair(SliceSpec spec,
             Class<T> cls) {
         return new Pair(spec, cls);
diff --git a/slices/builders/src/main/java/androidx/slice/builders/impl/GridRowBuilderListV1Impl.java b/slices/builders/src/main/java/androidx/slice/builders/impl/GridRowBuilderListV1Impl.java
index d519eeb..0a0a64d 100644
--- a/slices/builders/src/main/java/androidx/slice/builders/impl/GridRowBuilderListV1Impl.java
+++ b/slices/builders/src/main/java/androidx/slice/builders/impl/GridRowBuilderListV1Impl.java
@@ -144,6 +144,7 @@
 
         /**
          */
+        @SuppressWarnings("unchecked")
         public void fillFrom(CellBuilder builder) {
             if (builder.getCellDescription() != null) {
                 setContentDescription(builder.getCellDescription());
diff --git a/slices/builders/src/main/java/androidx/slice/builders/impl/ListBuilderImpl.java b/slices/builders/src/main/java/androidx/slice/builders/impl/ListBuilderImpl.java
index 009ac20..8a8954c 100644
--- a/slices/builders/src/main/java/androidx/slice/builders/impl/ListBuilderImpl.java
+++ b/slices/builders/src/main/java/androidx/slice/builders/impl/ListBuilderImpl.java
@@ -439,6 +439,7 @@
             super(builder, null);
         }
 
+        @SuppressWarnings("unchecked")
         void fillFrom(RowBuilder builder) {
             if (builder.getUri() != null) {
                 setBuilder(new Slice.Builder(builder.getUri()));
diff --git a/slices/core/build.gradle b/slices/core/build.gradle
index 6c412b2..18679ce 100644
--- a/slices/core/build.gradle
+++ b/slices/core/build.gradle
@@ -48,6 +48,5 @@
     mavenGroup = LibraryGroups.SLICE
     inceptionYear = "2017"
     description = "The slices core library provides utilities for the slices view and provider libraries"
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/slices/core/src/main/java/androidx/slice/ArrayUtils.java b/slices/core/src/main/java/androidx/slice/ArrayUtils.java
index 2330507..a020ad3 100644
--- a/slices/core/src/main/java/androidx/slice/ArrayUtils.java
+++ b/slices/core/src/main/java/androidx/slice/ArrayUtils.java
@@ -39,6 +39,7 @@
         return false;
     }
 
+    @SuppressWarnings("unchecked")
     public static <T> T[] appendElement(Class<T> kind, T[] array, T element) {
         final T[] result;
         final int end;
@@ -54,6 +55,7 @@
         return result;
     }
 
+    @SuppressWarnings("unchecked")
     public static <T> T[] removeElement(Class<T> kind, T[] array, T element) {
         if (array != null) {
             if (!contains(array, element)) {
diff --git a/slices/core/src/main/java/androidx/slice/SliceItem.java b/slices/core/src/main/java/androidx/slice/SliceItem.java
index 1457e22..67e9292 100644
--- a/slices/core/src/main/java/androidx/slice/SliceItem.java
+++ b/slices/core/src/main/java/androidx/slice/SliceItem.java
@@ -264,6 +264,7 @@
      * @return The pending intent held by this {@link android.app.slice.SliceItem#FORMAT_ACTION}
      * SliceItem
      */
+    @SuppressWarnings("unchecked")
     public PendingIntent getAction() {
         Object action = ((Pair<Object, Slice>) mObj).first;
         if (action instanceof PendingIntent) {
@@ -285,6 +286,7 @@
     /**
      * @hide
      */
+    @SuppressWarnings("unchecked")
     @RestrictTo(Scope.LIBRARY_GROUP_PREFIX)
     public boolean fireActionInternal(@Nullable Context context, @Nullable Intent i)
             throws PendingIntent.CanceledException {
@@ -320,6 +322,7 @@
      * @return The slice held by this {@link android.app.slice.SliceItem#FORMAT_ACTION} or
      * {@link android.app.slice.SliceItem#FORMAT_SLICE} SliceItem
      */
+    @SuppressWarnings("unchecked")
     public Slice getSlice() {
         if (FORMAT_ACTION.equals(getFormat())) {
             return ((Pair<Object, Slice>) mObj).second;
@@ -396,6 +399,7 @@
         return false;
     }
 
+    @SuppressWarnings("unchecked")
     private void writeObj(Bundle dest, Object obj, String type) {
         switch (type) {
             case FORMAT_IMAGE:
@@ -482,6 +486,7 @@
      * @hide
      */
     @RestrictTo(Scope.LIBRARY)
+    @SuppressWarnings("unchecked")
     public String toString(String indent) {
         StringBuilder sb = new StringBuilder();
         sb.append(indent);
diff --git a/slices/core/src/main/java/androidx/slice/SliceItemHolder.java b/slices/core/src/main/java/androidx/slice/SliceItemHolder.java
index 8aa7a76..504e9a7 100644
--- a/slices/core/src/main/java/androidx/slice/SliceItemHolder.java
+++ b/slices/core/src/main/java/androidx/slice/SliceItemHolder.java
@@ -81,6 +81,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     public SliceItemHolder(String format, Object mObj, boolean isStream) {
         switch (format) {
             case FORMAT_ACTION:
diff --git a/slices/core/src/main/java/androidx/slice/core/SliceQuery.java b/slices/core/src/main/java/androidx/slice/core/SliceQuery.java
index 9665874..1830104 100644
--- a/slices/core/src/main/java/androidx/slice/core/SliceQuery.java
+++ b/slices/core/src/main/java/androidx/slice/core/SliceQuery.java
@@ -125,7 +125,7 @@
      */
     public static List<SliceItem> findAll(Slice s, final String format, final String[] hints,
             final String[] nonHints) {
-        ArrayList<SliceItem> ret = new ArrayList();
+        ArrayList<SliceItem> ret = new ArrayList<>();
         findAll(toQueue(s), new Filter<SliceItem>() {
             @Override
             public boolean filter(SliceItem item) {
@@ -140,7 +140,7 @@
      */
     public static List<SliceItem> findAll(SliceItem s, final String format, final String[] hints,
             final String[] nonHints) {
-        ArrayList<SliceItem> ret = new ArrayList();
+        ArrayList<SliceItem> ret = new ArrayList<>();
         findAll(toQueue(s), new Filter<SliceItem>() {
             @Override
             public boolean filter(SliceItem item) {
diff --git a/slices/test/build.gradle b/slices/test/build.gradle
index 9cb494c..c41fcc5 100644
--- a/slices/test/build.gradle
+++ b/slices/test/build.gradle
@@ -45,6 +45,5 @@
     mavenGroup = LibraryGroups.SLICE
     inceptionYear = "2017"
     description = "A library that holds common code for testing slices"
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/slices/view/build.gradle b/slices/view/build.gradle
index 1bef28e..39f3dff 100644
--- a/slices/view/build.gradle
+++ b/slices/view/build.gradle
@@ -48,7 +48,6 @@
     mavenGroup = LibraryGroups.SLICE
     inceptionYear = "2017"
     description = "A library that handles rendering of slice content into supported templates"
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
     trackRestrictedAPIs = false
 }
diff --git a/slices/view/src/main/java/androidx/slice/widget/GridRowView.java b/slices/view/src/main/java/androidx/slice/widget/GridRowView.java
index fd0cf13..187d1d2 100644
--- a/slices/view/src/main/java/androidx/slice/widget/GridRowView.java
+++ b/slices/view/src/main/java/androidx/slice/widget/GridRowView.java
@@ -487,6 +487,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void onClick(View view) {
         Pair<SliceItem, EventInfo> tagItem = (Pair<SliceItem, EventInfo>) view.getTag();
         final SliceItem sliceItem = tagItem.first;
diff --git a/slices/view/src/main/java/androidx/slice/widget/ListContent.java b/slices/view/src/main/java/androidx/slice/widget/ListContent.java
index 3e6a8a3..de11101 100644
--- a/slices/view/src/main/java/androidx/slice/widget/ListContent.java
+++ b/slices/view/src/main/java/androidx/slice/widget/ListContent.java
@@ -144,7 +144,7 @@
     public ArrayList<SliceContent> getRowItems(int availableHeight, SliceStyle style,
             SliceViewPolicy policy) {
         if (policy.getMode() == MODE_SMALL) {
-            return new ArrayList(Arrays.asList(getHeader()));
+            return new ArrayList<>(Arrays.asList(getHeader()));
         } else if (!policy.isScrollable() && availableHeight > 0) {
             return style.getListItemsForNonScrollingList(this, availableHeight, policy);
         }
diff --git a/slices/view/src/main/java/androidx/slice/widget/RowView.java b/slices/view/src/main/java/androidx/slice/widget/RowView.java
index 18ce24c..105e7f6 100644
--- a/slices/view/src/main/java/androidx/slice/widget/RowView.java
+++ b/slices/view/src/main/java/androidx/slice/widget/RowView.java
@@ -475,6 +475,7 @@
         updateActionSpinner();
     }
 
+    @SuppressWarnings("unchecked")
     private void updateEndItems() {
         if (mRowContent == null) {
             return;
diff --git a/testutils/build.gradle b/testutils/build.gradle
index f3bece4..8161fa4 100644
--- a/testutils/build.gradle
+++ b/testutils/build.gradle
@@ -43,6 +43,5 @@
 }
 
 androidx {
-    failOnUncheckedWarnings = false
     toolingProject = true
 }
diff --git a/textclassifier/build.gradle b/textclassifier/build.gradle
index dd802d6..9cbf74e 100644
--- a/textclassifier/build.gradle
+++ b/textclassifier/build.gradle
@@ -38,5 +38,5 @@
     mavenGroup = LibraryGroups.TEXTCLASSIFIER
     inceptionYear = "2018"
     description = "The TextClassifier Support Library can be added to an Android application in order to use the TextClassifier API introduced in Android O on all devices with API level 14 or later."
-    failOnUncheckedWarnings = false
+    failOnDeprecationWarnings = false
 }
diff --git a/textclassifier/src/main/java/androidx/textclassifier/widget/FloatingToolbar.java b/textclassifier/src/main/java/androidx/textclassifier/widget/FloatingToolbar.java
index 3adf957..81d0524 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/widget/FloatingToolbar.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/widget/FloatingToolbar.java
@@ -1275,6 +1275,7 @@
             return remainingMenuItems;
         }
 
+        @SuppressWarnings("unchecked")
         void layoutOverflowPanelItems(List<SupportMenuItem> menuItems) {
             ArrayAdapter<SupportMenuItem> overflowPanelAdapter =
                     (ArrayAdapter<SupportMenuItem>) mOverflowPanel.getAdapter();
@@ -1325,6 +1326,7 @@
         /**
          * Clears out the panels and their container. Resets their calculated sizes.
          */
+        @SuppressWarnings("unchecked")
         void clearPanels() {
             mOverflowPanelSize = null;
             mMainPanelSize = null;
diff --git a/transition/src/main/java/androidx/transition/Transition.java b/transition/src/main/java/androidx/transition/Transition.java
index 21895ca..5b3c024 100644
--- a/transition/src/main/java/androidx/transition/Transition.java
+++ b/transition/src/main/java/androidx/transition/Transition.java
@@ -1994,7 +1994,7 @@
         }
 
         WindowIdImpl windowId = ViewUtils.getWindowId(sceneRoot);
-        final ArrayMap<Animator, AnimationInfo> oldAnimators = new ArrayMap(runningAnimators);
+        final ArrayMap<Animator, AnimationInfo> oldAnimators = new ArrayMap<>(runningAnimators);
         runningAnimators.clear();
 
         for (int i = numOldAnims - 1; i >= 0; i--) {
diff --git a/tv-provider/build.gradle b/tv-provider/build.gradle
index 89b16a4..b4cbc11 100644
--- a/tv-provider/build.gradle
+++ b/tv-provider/build.gradle
@@ -32,6 +32,5 @@
     mavenGroup = LibraryGroups.TVPROVIDER
     inceptionYear = "2017"
     description = "Android Support Library for TV Provider"
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/BasePreviewProgram.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/BasePreviewProgram.java
index 1ca313e..c5a2b61 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/BasePreviewProgram.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/BasePreviewProgram.java
@@ -42,6 +42,7 @@
  * @hide
  */
 @RestrictTo(LIBRARY)
+@SuppressWarnings("unchecked")
 public abstract class BasePreviewProgram extends BaseProgram {
     /**
      * @hide
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/BaseProgram.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/BaseProgram.java
index d2ae4e7..ff1a99c 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/BaseProgram.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/BaseProgram.java
@@ -40,6 +40,7 @@
  * @hide
  */
 @RestrictTo(LIBRARY)
+@SuppressWarnings("unchecked")
 public abstract class BaseProgram {
     /**
      * @hide
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/CollectionUtils.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/CollectionUtils.java
index 70963689..22370f2 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/CollectionUtils.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/CollectionUtils.java
@@ -33,6 +33,7 @@
      * @see <a href="http://stackoverflow.com/a/784842/1122089">Stackoverflow answer</a> by
      *      <a href="http://stackoverflow.com/users/40342/joachim-sauer">Joachim Sauer</a>
      */
+    @SuppressWarnings("unchecked")
     public static <T> T[] concatAll(T[] first, T[]... rest) {
         int totalLength = first.length;
         for (T[] array : rest) {
diff --git a/versionedparcelable/build.gradle b/versionedparcelable/build.gradle
index 0c83883..e477d66 100644
--- a/versionedparcelable/build.gradle
+++ b/versionedparcelable/build.gradle
@@ -51,6 +51,5 @@
     mavenGroup = LibraryGroups.VERSIONEDPARCELABLE
     inceptionYear = "2018"
     description = "Provides a stable but relatively compact binary serialization format that can be passed across processes or persisted safely."
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
diff --git a/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelImpl.java b/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelImpl.java
index a4bcb20..3066644 100644
--- a/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelImpl.java
+++ b/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelImpl.java
@@ -41,7 +41,7 @@
 
     /**
      */
-    @SuppressWarnings("TypeParameterUnusedInFormals")
+    @SuppressWarnings({"TypeParameterUnusedInFormals", "unchecked"})
     public <T extends VersionedParcelable> T getVersionedParcel() {
         return (T) mParcel;
     }
diff --git a/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelUtils.java b/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelUtils.java
index e7d74a2..20cc419 100644
--- a/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelUtils.java
+++ b/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelUtils.java
@@ -148,7 +148,7 @@
             ArrayList<Parcelable> parcelableArrayList =
                     innerBundle.getParcelableArrayList(INNER_BUNDLE_KEY);
             for (Parcelable parcelable : parcelableArrayList) {
-                resultList.add((T) fromParcelable(parcelable));
+                resultList.add(fromParcelable(parcelable));
             }
             return resultList;
         } catch (RuntimeException e) {
diff --git a/versionedparcelable/src/main/java/androidx/versionedparcelable/VersionedParcel.java b/versionedparcelable/src/main/java/androidx/versionedparcelable/VersionedParcel.java
index bf30feb..92499b6 100644
--- a/versionedparcelable/src/main/java/androidx/versionedparcelable/VersionedParcel.java
+++ b/versionedparcelable/src/main/java/androidx/versionedparcelable/VersionedParcel.java
@@ -1340,6 +1340,7 @@
         return readCollection(new ArrayList<T>());
     }
 
+    @SuppressWarnings("unchecked")
     private <T, S extends Collection<T>> S readCollection(S list) {
         int n = readInt();
         if (n < 0) {
@@ -1440,6 +1441,7 @@
 
     /**
      */
+    @SuppressWarnings("unchecked")
     protected <T> T[] readArray(T[] def) {
         int n = readInt();
         if (n < 0) {
@@ -1504,7 +1506,7 @@
      * @throws BadParcelableException Throws BadVersionedParcelableException if there
      *                                was an error trying to instantiate the VersionedParcelable.
      */
-    @SuppressWarnings({"unchecked", "TypeParameterUnusedInFormals"})
+    @SuppressWarnings("TypeParameterUnusedInFormals")
     protected <T extends VersionedParcelable> T readVersionedParcelable() {
         String name = readString();
         if (name == null) {
@@ -1603,8 +1605,7 @@
             NoSuchMethodException, ClassNotFoundException {
         Method m = mReadCache.get(parcelCls);
         if (m == null) {
-            long start = System.currentTimeMillis();
-            Class cls = Class.forName(parcelCls, true, VersionedParcel.class.getClassLoader());
+            Class<?> cls = Class.forName(parcelCls, true, VersionedParcel.class.getClassLoader());
             m = cls.getDeclaredMethod("read", VersionedParcel.class);
             mReadCache.put(parcelCls, m);
         }
@@ -1615,15 +1616,14 @@
             NoSuchMethodException, ClassNotFoundException {
         Method m = mWriteCache.get(baseCls.getName());
         if (m == null) {
-            Class cls = findParcelClass(baseCls);
-            long start = System.currentTimeMillis();
+            Class<?> cls = findParcelClass(baseCls);
             m = cls.getDeclaredMethod("write", baseCls, VersionedParcel.class);
             mWriteCache.put(baseCls.getName(), m);
         }
         return m;
     }
 
-    private Class findParcelClass(Class<? extends VersionedParcelable> cls)
+    private Class findParcelClass(Class<?> cls)
             throws ClassNotFoundException {
         Class ret = mParcelizerCache.get(cls.getName());
         if (ret == null) {
diff --git a/viewpager2/build.gradle b/viewpager2/build.gradle
index 03321c5..b636bc7 100644
--- a/viewpager2/build.gradle
+++ b/viewpager2/build.gradle
@@ -59,4 +59,5 @@
     mavenGroup = LibraryGroups.VIEWPAGER2
     inceptionYear = "2017"
     description = "AndroidX Widget ViewPager2"
+    failOnDeprecationWarnings = false
 }
diff --git a/work/workmanager-gcm/build.gradle b/work/workmanager-gcm/build.gradle
index 0443d46..6fd0461 100644
--- a/work/workmanager-gcm/build.gradle
+++ b/work/workmanager-gcm/build.gradle
@@ -73,4 +73,5 @@
     inceptionYear = "2019"
     description = "Android WorkManager GCMNetworkManager Support"
     url = AndroidXExtension.ARCHITECTURE_URL
+    failOnDeprecationWarnings = false
 }
diff --git a/work/workmanager-rxjava2/build.gradle b/work/workmanager-rxjava2/build.gradle
index 9b4b942..7c835d2 100644
--- a/work/workmanager-rxjava2/build.gradle
+++ b/work/workmanager-rxjava2/build.gradle
@@ -42,6 +42,5 @@
     inceptionYear = "2018"
     description = "Android WorkManager RxJava2 interoperatibility library"
     url = AndroidXExtension.ARCHITECTURE_URL
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
 }
\ No newline at end of file
diff --git a/work/workmanager-testing/src/main/java/androidx/work/testing/TestWorkerBuilder.java b/work/workmanager-testing/src/main/java/androidx/work/testing/TestWorkerBuilder.java
index aa9392f..dd41d211 100644
--- a/work/workmanager-testing/src/main/java/androidx/work/testing/TestWorkerBuilder.java
+++ b/work/workmanager-testing/src/main/java/androidx/work/testing/TestWorkerBuilder.java
@@ -55,6 +55,7 @@
      * @return The new instance of a {@link TestWorkerBuilder}
      */
     @NonNull
+    @SuppressWarnings("unchecked")
     public static TestWorkerBuilder<? extends Worker> from(
             @NonNull Context context,
             @NonNull WorkRequest workRequest,
diff --git a/work/workmanager/build.gradle b/work/workmanager/build.gradle
index 6377fa9..877e63d 100644
--- a/work/workmanager/build.gradle
+++ b/work/workmanager/build.gradle
@@ -79,7 +79,6 @@
     inceptionYear = "2018"
     description = "Android WorkManager runtime library"
     url = AndroidXExtension.ARCHITECTURE_URL
-    failOnUncheckedWarnings = false
     failOnDeprecationWarnings = false
     trackRestrictedAPIs = false
 }
diff --git a/work/workmanager/src/main/java/androidx/work/impl/constraints/WorkConstraintsTracker.java b/work/workmanager/src/main/java/androidx/work/impl/constraints/WorkConstraintsTracker.java
index 612428a..48f44d9a 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/constraints/WorkConstraintsTracker.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/constraints/WorkConstraintsTracker.java
@@ -46,7 +46,7 @@
     private static final String TAG = Logger.tagWithPrefix("WorkConstraintsTracker");
 
     @Nullable private final WorkConstraintsCallback mCallback;
-    private final ConstraintController[] mConstraintControllers;
+    private final ConstraintController<?>[] mConstraintControllers;
 
     // We need to keep hold a lock here for the cases where there is 1 WCT tracking a list of
     // WorkSpecs. Changes in constraints are notified on the main thread. Enqueues / Cancellations
@@ -95,6 +95,7 @@
      *
      * @param workSpecs A list of {@link WorkSpec}s to monitor constraints for
      */
+    @SuppressWarnings("unchecked")
     public void replace(@NonNull List<WorkSpec> workSpecs) {
         synchronized (mLock) {
             for (ConstraintController controller : mConstraintControllers) {