Restore `KeyboardOptions.shouldShowKeyboardOnFocus`.

Fixes: b/333783039
Bug: b/332942148
Test: n/a
Relnote: "Added `KeyboardOptions.shouldShowKeyboardOnFocus` property
    back as deprecated hidden for binary compatibility."
Change-Id: I15cfef582c07970eb66b28fdc1dd046692ee69aa
diff --git a/compose/foundation/foundation/api/1.7.0-beta01.txt b/compose/foundation/foundation/api/1.7.0-beta01.txt
index c9ae8f9..a94aba6 100644
--- a/compose/foundation/foundation/api/1.7.0-beta01.txt
+++ b/compose/foundation/foundation/api/1.7.0-beta01.txt
@@ -1642,6 +1642,7 @@
     method public int getImeAction();
     method public int getKeyboardType();
     method public androidx.compose.ui.text.input.PlatformImeOptions? getPlatformImeOptions();
+    method public boolean getShouldShowKeyboardOnFocus();
     method public Boolean? getShowKeyboardOnFocus();
     method public androidx.compose.foundation.text.KeyboardOptions merge(androidx.compose.foundation.text.KeyboardOptions? other);
     property @Deprecated public final boolean autoCorrect;
@@ -1651,6 +1652,7 @@
     property public final int imeAction;
     property public final int keyboardType;
     property public final androidx.compose.ui.text.input.PlatformImeOptions? platformImeOptions;
+    property public boolean shouldShowKeyboardOnFocus;
     property public final Boolean? showKeyboardOnFocus;
     field public static final androidx.compose.foundation.text.KeyboardOptions.Companion Companion;
   }
diff --git a/compose/foundation/foundation/api/current.ignore b/compose/foundation/foundation/api/current.ignore
index c6ac07b..a30dc28 100644
--- a/compose/foundation/foundation/api/current.ignore
+++ b/compose/foundation/foundation/api/current.ignore
@@ -1,35 +1,3 @@
 // Baseline format: 1.0
-AddedAbstractMethod: androidx.compose.foundation.gestures.snapping.SnapLayoutInfoProvider#calculateSnapOffset(float):
-    Added method androidx.compose.foundation.gestures.snapping.SnapLayoutInfoProvider.calculateSnapOffset(float)
-AddedAbstractMethod: androidx.compose.foundation.lazy.grid.LazyGridItemScope#animateItem(androidx.compose.ui.Modifier, androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>, androidx.compose.animation.core.FiniteAnimationSpec<androidx.compose.ui.unit.IntOffset>, androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>):
-    Added method androidx.compose.foundation.lazy.grid.LazyGridItemScope.animateItem(androidx.compose.ui.Modifier,androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>,androidx.compose.animation.core.FiniteAnimationSpec<androidx.compose.ui.unit.IntOffset>,androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>)
-AddedAbstractMethod: androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridItemScope#animateItem(androidx.compose.ui.Modifier, androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>, androidx.compose.animation.core.FiniteAnimationSpec<androidx.compose.ui.unit.IntOffset>, androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>):
-    Added method androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridItemScope.animateItem(androidx.compose.ui.Modifier,androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>,androidx.compose.animation.core.FiniteAnimationSpec<androidx.compose.ui.unit.IntOffset>,androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>)
-AddedAbstractMethod: androidx.compose.foundation.pager.PageInfo#getKey():
-    Added method androidx.compose.foundation.pager.PageInfo.getKey()
-AddedAbstractMethod: androidx.compose.foundation.pager.PagerLayoutInfo#getBeyondViewportPageCount():
-    Added method androidx.compose.foundation.pager.PagerLayoutInfo.getBeyondViewportPageCount()
-AddedAbstractMethod: androidx.compose.foundation.pager.PagerLayoutInfo#getSnapPosition():
-    Added method androidx.compose.foundation.pager.PagerLayoutInfo.getSnapPosition()
-
-
-ChangedType: androidx.compose.foundation.gestures.snapping.SnapFlingBehaviorKt#rememberSnapFlingBehavior(androidx.compose.foundation.gestures.snapping.SnapLayoutInfoProvider):
-    Method androidx.compose.foundation.gestures.snapping.SnapFlingBehaviorKt.rememberSnapFlingBehavior has changed return type from androidx.compose.foundation.gestures.snapping.SnapFlingBehavior to androidx.compose.foundation.gestures.TargetedFlingBehavior
-
-
-RemovedClass: androidx.compose.foundation.lazy.layout.LazyLayoutItemProviderKt:
-    Removed class androidx.compose.foundation.lazy.layout.LazyLayoutItemProviderKt
-RemovedClass: androidx.compose.foundation.relocation.BringIntoViewResponderKt:
-    Removed class androidx.compose.foundation.relocation.BringIntoViewResponderKt
-
-
-RemovedDeprecatedMethod: androidx.compose.foundation.gestures.TapGestureDetectorKt#awaitFirstDown(androidx.compose.ui.input.pointer.AwaitPointerEventScope, boolean):
-    Removed deprecated method androidx.compose.foundation.gestures.TapGestureDetectorKt.awaitFirstDown(androidx.compose.ui.input.pointer.AwaitPointerEventScope,boolean)
-RemovedDeprecatedMethod: androidx.compose.foundation.gestures.TapGestureDetectorKt#waitForUpOrCancellation(androidx.compose.ui.input.pointer.AwaitPointerEventScope):
-    Removed deprecated method androidx.compose.foundation.gestures.TapGestureDetectorKt.waitForUpOrCancellation(androidx.compose.ui.input.pointer.AwaitPointerEventScope)
-
-
-RemovedPackage: androidx.compose.foundation.text2:
-    Removed package androidx.compose.foundation.text2
-RemovedPackage: androidx.compose.foundation.text2.input:
-    Removed package androidx.compose.foundation.text2.input
+AddedMethod: androidx.compose.foundation.text.KeyboardOptions#getShouldShowKeyboardOnFocus():
+    Added method androidx.compose.foundation.text.KeyboardOptions.getShouldShowKeyboardOnFocus()
diff --git a/compose/foundation/foundation/api/current.txt b/compose/foundation/foundation/api/current.txt
index c9ae8f9..a94aba6 100644
--- a/compose/foundation/foundation/api/current.txt
+++ b/compose/foundation/foundation/api/current.txt
@@ -1642,6 +1642,7 @@
     method public int getImeAction();
     method public int getKeyboardType();
     method public androidx.compose.ui.text.input.PlatformImeOptions? getPlatformImeOptions();
+    method public boolean getShouldShowKeyboardOnFocus();
     method public Boolean? getShowKeyboardOnFocus();
     method public androidx.compose.foundation.text.KeyboardOptions merge(androidx.compose.foundation.text.KeyboardOptions? other);
     property @Deprecated public final boolean autoCorrect;
@@ -1651,6 +1652,7 @@
     property public final int imeAction;
     property public final int keyboardType;
     property public final androidx.compose.ui.text.input.PlatformImeOptions? platformImeOptions;
+    property public boolean shouldShowKeyboardOnFocus;
     property public final Boolean? showKeyboardOnFocus;
     field public static final androidx.compose.foundation.text.KeyboardOptions.Companion Companion;
   }
diff --git a/compose/foundation/foundation/api/restricted_1.7.0-beta01.txt b/compose/foundation/foundation/api/restricted_1.7.0-beta01.txt
index 789b02e..d334781a 100644
--- a/compose/foundation/foundation/api/restricted_1.7.0-beta01.txt
+++ b/compose/foundation/foundation/api/restricted_1.7.0-beta01.txt
@@ -1644,6 +1644,7 @@
     method public int getImeAction();
     method public int getKeyboardType();
     method public androidx.compose.ui.text.input.PlatformImeOptions? getPlatformImeOptions();
+    method public boolean getShouldShowKeyboardOnFocus();
     method public Boolean? getShowKeyboardOnFocus();
     method public androidx.compose.foundation.text.KeyboardOptions merge(androidx.compose.foundation.text.KeyboardOptions? other);
     property @Deprecated public final boolean autoCorrect;
@@ -1653,6 +1654,7 @@
     property public final int imeAction;
     property public final int keyboardType;
     property public final androidx.compose.ui.text.input.PlatformImeOptions? platformImeOptions;
+    property public boolean shouldShowKeyboardOnFocus;
     property public final Boolean? showKeyboardOnFocus;
     field public static final androidx.compose.foundation.text.KeyboardOptions.Companion Companion;
   }
diff --git a/compose/foundation/foundation/api/restricted_current.ignore b/compose/foundation/foundation/api/restricted_current.ignore
index c6ac07b..a30dc28 100644
--- a/compose/foundation/foundation/api/restricted_current.ignore
+++ b/compose/foundation/foundation/api/restricted_current.ignore
@@ -1,35 +1,3 @@
 // Baseline format: 1.0
-AddedAbstractMethod: androidx.compose.foundation.gestures.snapping.SnapLayoutInfoProvider#calculateSnapOffset(float):
-    Added method androidx.compose.foundation.gestures.snapping.SnapLayoutInfoProvider.calculateSnapOffset(float)
-AddedAbstractMethod: androidx.compose.foundation.lazy.grid.LazyGridItemScope#animateItem(androidx.compose.ui.Modifier, androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>, androidx.compose.animation.core.FiniteAnimationSpec<androidx.compose.ui.unit.IntOffset>, androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>):
-    Added method androidx.compose.foundation.lazy.grid.LazyGridItemScope.animateItem(androidx.compose.ui.Modifier,androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>,androidx.compose.animation.core.FiniteAnimationSpec<androidx.compose.ui.unit.IntOffset>,androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>)
-AddedAbstractMethod: androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridItemScope#animateItem(androidx.compose.ui.Modifier, androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>, androidx.compose.animation.core.FiniteAnimationSpec<androidx.compose.ui.unit.IntOffset>, androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>):
-    Added method androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridItemScope.animateItem(androidx.compose.ui.Modifier,androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>,androidx.compose.animation.core.FiniteAnimationSpec<androidx.compose.ui.unit.IntOffset>,androidx.compose.animation.core.FiniteAnimationSpec<java.lang.Float>)
-AddedAbstractMethod: androidx.compose.foundation.pager.PageInfo#getKey():
-    Added method androidx.compose.foundation.pager.PageInfo.getKey()
-AddedAbstractMethod: androidx.compose.foundation.pager.PagerLayoutInfo#getBeyondViewportPageCount():
-    Added method androidx.compose.foundation.pager.PagerLayoutInfo.getBeyondViewportPageCount()
-AddedAbstractMethod: androidx.compose.foundation.pager.PagerLayoutInfo#getSnapPosition():
-    Added method androidx.compose.foundation.pager.PagerLayoutInfo.getSnapPosition()
-
-
-ChangedType: androidx.compose.foundation.gestures.snapping.SnapFlingBehaviorKt#rememberSnapFlingBehavior(androidx.compose.foundation.gestures.snapping.SnapLayoutInfoProvider):
-    Method androidx.compose.foundation.gestures.snapping.SnapFlingBehaviorKt.rememberSnapFlingBehavior has changed return type from androidx.compose.foundation.gestures.snapping.SnapFlingBehavior to androidx.compose.foundation.gestures.TargetedFlingBehavior
-
-
-RemovedClass: androidx.compose.foundation.lazy.layout.LazyLayoutItemProviderKt:
-    Removed class androidx.compose.foundation.lazy.layout.LazyLayoutItemProviderKt
-RemovedClass: androidx.compose.foundation.relocation.BringIntoViewResponderKt:
-    Removed class androidx.compose.foundation.relocation.BringIntoViewResponderKt
-
-
-RemovedDeprecatedMethod: androidx.compose.foundation.gestures.TapGestureDetectorKt#awaitFirstDown(androidx.compose.ui.input.pointer.AwaitPointerEventScope, boolean):
-    Removed deprecated method androidx.compose.foundation.gestures.TapGestureDetectorKt.awaitFirstDown(androidx.compose.ui.input.pointer.AwaitPointerEventScope,boolean)
-RemovedDeprecatedMethod: androidx.compose.foundation.gestures.TapGestureDetectorKt#waitForUpOrCancellation(androidx.compose.ui.input.pointer.AwaitPointerEventScope):
-    Removed deprecated method androidx.compose.foundation.gestures.TapGestureDetectorKt.waitForUpOrCancellation(androidx.compose.ui.input.pointer.AwaitPointerEventScope)
-
-
-RemovedPackage: androidx.compose.foundation.text2:
-    Removed package androidx.compose.foundation.text2
-RemovedPackage: androidx.compose.foundation.text2.input:
-    Removed package androidx.compose.foundation.text2.input
+AddedMethod: androidx.compose.foundation.text.KeyboardOptions#getShouldShowKeyboardOnFocus():
+    Added method androidx.compose.foundation.text.KeyboardOptions.getShouldShowKeyboardOnFocus()
diff --git a/compose/foundation/foundation/api/restricted_current.txt b/compose/foundation/foundation/api/restricted_current.txt
index 789b02e..d334781a 100644
--- a/compose/foundation/foundation/api/restricted_current.txt
+++ b/compose/foundation/foundation/api/restricted_current.txt
@@ -1644,6 +1644,7 @@
     method public int getImeAction();
     method public int getKeyboardType();
     method public androidx.compose.ui.text.input.PlatformImeOptions? getPlatformImeOptions();
+    method public boolean getShouldShowKeyboardOnFocus();
     method public Boolean? getShowKeyboardOnFocus();
     method public androidx.compose.foundation.text.KeyboardOptions merge(androidx.compose.foundation.text.KeyboardOptions? other);
     property @Deprecated public final boolean autoCorrect;
@@ -1653,6 +1654,7 @@
     property public final int imeAction;
     property public final int keyboardType;
     property public final androidx.compose.ui.text.input.PlatformImeOptions? platformImeOptions;
+    property public boolean shouldShowKeyboardOnFocus;
     property public final Boolean? showKeyboardOnFocus;
     field public static final androidx.compose.foundation.text.KeyboardOptions.Companion Companion;
   }
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/KeyboardOptions.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/KeyboardOptions.kt
index 2affcf3..e09edb0 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/KeyboardOptions.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/KeyboardOptions.kt
@@ -161,6 +161,15 @@
     )
     val autoCorrect: Boolean get() = autoCorrectOrDefault
 
+    // Suppress GetterSetterNames because this is how the property was named previously.
+    @Suppress("unused", "GetterSetterNames")
+    @get:Suppress("GetterSetterNames")
+    @Deprecated(
+        "Included for binary compatibility. Use showKeyboardOnFocus.",
+        level = DeprecationLevel.HIDDEN
+    )
+    val shouldShowKeyboardOnFocus: Boolean get() = showKeyboardOnFocus ?: true
+
     private val autoCorrectOrDefault: Boolean
         get() = autoCorrectEnabled
             ?: true