Fix autosize stack overflow

AppCompatTextView.setTextSize called AppCompatTextHelper.setTextSize,
which in turn called AppCompatTextView.setTextSize, and cause an
infinite loop. Enabled autosize support lib for all versions including
O.

Test: ./gradlew support-appcompat-v7:connectedCheck \
      -Pandroid.testInstrumentationRunnerArguments.class=\
      android.support.v7.widget.AppCompatTextViewTest

Test: ./gradlew support-appcompat-v7:connectedCheck \
      -Pandroid.testInstrumentationRunnerArguments.class=\
      android.support.v7.widget.AppCompatTextViewAutoSizeTest

Bug: 37355569
Change-Id: I0a350a4aec526d041def67a951be7321701e182b
(cherry picked from commit 7c7a7e505126eeb9c459e895244b20b4433502f4)
diff --git a/v7/appcompat/src/android/support/v7/widget/AppCompatTextHelper.java b/v7/appcompat/src/android/support/v7/widget/AppCompatTextHelper.java
index 33facec..4709ea9 100644
--- a/v7/appcompat/src/android/support/v7/widget/AppCompatTextHelper.java
+++ b/v7/appcompat/src/android/support/v7/widget/AppCompatTextHelper.java
@@ -287,29 +287,22 @@
     /** @hide */
     @RestrictTo(LIBRARY_GROUP)
     void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        // Auto-size is supported by the framework starting from Android O.
-        if (Build.VERSION.SDK_INT < 26) {
-            if (isAutoSizeEnabled()) {
-                if (getNeedsAutoSizeText()) {
-                    // Call auto-size after the width and height have been calculated.
-                    autoSizeText();
-                }
-                // Always try to auto-size if enabled. Functions that do not want to trigger
-                // auto-sizing after the next layout round should set this to false.
-                setNeedsAutoSizeText(true);
+        if (isAutoSizeEnabled()) {
+            if (getNeedsAutoSizeText()) {
+                // Call auto-size after the width and height have been calculated.
+                autoSizeText();
             }
+            // Always try to auto-size if enabled. Functions that do not want to trigger
+            // auto-sizing after the next layout round should set this to false.
+            setNeedsAutoSizeText(true);
         }
     }
 
     /** @hide */
     @RestrictTo(LIBRARY_GROUP)
     void setTextSize(int unit, float size) {
-        if (Build.VERSION.SDK_INT < 26) {
-            if (!isAutoSizeEnabled()) {
-                setTextSizeInternal(unit, size);
-            }
-        } else {
-            mView.setTextSize(unit, size);
+        if (!isAutoSizeEnabled()) {
+            setTextSizeInternal(unit, size);
         }
     }
 
diff --git a/v7/appcompat/src/android/support/v7/widget/AppCompatTextViewAutoSizeHelper.java b/v7/appcompat/src/android/support/v7/widget/AppCompatTextViewAutoSizeHelper.java
index f842a81..9f9334d 100644
--- a/v7/appcompat/src/android/support/v7/widget/AppCompatTextViewAutoSizeHelper.java
+++ b/v7/appcompat/src/android/support/v7/widget/AppCompatTextViewAutoSizeHelper.java
@@ -516,15 +516,8 @@
             }
 
             mNeedsAutoSizeText = true;
-            // If the build version is at least 26 there is no need to auto-size using this
-            // helper because the job has been delegated to the actual TextView but the
-            // configuration still needs to be done for the case where this function is called
-            // from {@link #loadFromAttributes}, in which case the auto-size configuration
-            // attributes set up in this function will be read by {@link AppCompatTextHelper}
-            // and after passed on to the actual TextView which will take care of auto-sizing.
-            if (Build.VERSION.SDK_INT < 26) {
-                autoSizeText();
-            }
+
+            autoSizeText();
         }
     }