Fix TimePickerTest#testKeyboardTabTraversalModeSpinner on small devices.

testKeyboardTabTraversalModeSpinner was failing on devices with small
screens as it did not fit both of the time pickers on the screen at the
same time.

Test: atest CtsWidgetTestCases:android.widget.cts.TimePickerTest#testKeyboardTabTraversalModeSpinner
Bug: 124621120
Change-Id: I99a2c559b2eb383644d96e8a3cc6335dbbb3232e
Merged-In: I99a2c559b2eb383644d96e8a3cc6335dbbb3232e
diff --git a/tests/tests/widget/src/android/widget/cts/TimePickerTest.java b/tests/tests/widget/src/android/widget/cts/TimePickerTest.java
index 0886aa3..a77c0d3 100644
--- a/tests/tests/widget/src/android/widget/cts/TimePickerTest.java
+++ b/tests/tests/widget/src/android/widget/cts/TimePickerTest.java
@@ -392,6 +392,9 @@
         if (isWatch()) {
             return;
         }
+        // Hide timepicker_clock so that timepicker_spinner would be visible.
+        mActivityRule.runOnUiThread(() ->
+                mActivity.findViewById(R.id.timepicker_clock).setVisibility(View.GONE));
         mTimePicker = (TimePicker) mActivity.findViewById(R.id.timepicker_spinner);
 
         mActivityRule.runOnUiThread(() -> mTimePicker.setIs24HourView(false));