Reset enforceNavigationBarContrast to system default value from API 31

so the splash screen theme won't corrupt activity's theme.
From API 31+, the splash screen isn't create as PhoneWindow, so it's
unnecessary to inherit the value from API 29.
Also remove the the override action from applyAppSystemUiTheme, since
enforceNavigationBarContrast could already changed from app side during
launch, override it from attribute doesn't make sense.

Bug: 330917018
Test: launch test app which never set enforceNavigationBarContrast in
postSplashScreenTheme, verify the value should stay in default unless
app has change it.

Change-Id: Ic2cd9262230669a2916262306994aba219fb1cf6
diff --git a/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt b/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt
index a750a9b..23aa5df 100644
--- a/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt
+++ b/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt
@@ -492,14 +492,6 @@
                 }
             }
 
-            if (theme.resolveAttribute(attr.enforceNavigationBarContrast, tv, true)) {
-                window.isNavigationBarContrastEnforced = tv.data != 0
-            }
-
-            if (theme.resolveAttribute(attr.enforceStatusBarContrast, tv, true)) {
-                window.isStatusBarContrastEnforced = tv.data != 0
-            }
-
             val decorView = window.decorView as ViewGroup
             ThemeUtils.Api31.applyThemesSystemBarAppearance(theme, decorView, tv)
 
diff --git a/core/core-splashscreen/src/main/res/values-v31/styles.xml b/core/core-splashscreen/src/main/res/values-v31/styles.xml
index 2e4d189..7c48243 100644
--- a/core/core-splashscreen/src/main/res/values-v31/styles.xml
+++ b/core/core-splashscreen/src/main/res/values-v31/styles.xml
@@ -15,6 +15,13 @@
   -->
 
 <resources>
+
+    <!-- For API 31+, reset enforceNavigationBarContrast to system default value, so it won't
+    corrupt activity's theme -->
+    <style name="Base.Theme.SplashScreen" parent="android:Theme.DeviceDefault.DayNight">
+        <item name="android:enforceNavigationBarContrast">true</item>
+    </style>
+
     <style name="Theme.SplashScreen" parent="Base.Theme.SplashScreen.DayNight">
         <item name="android:windowSplashScreenAnimatedIcon">?windowSplashScreenAnimatedIcon</item>
         <item name="android:windowSplashScreenBackground">?windowSplashScreenBackground</item>