Merge "Fix Java crash problem" into main
diff --git a/src/com/android/settings/fuelgauge/batteryusage/SpinnerPreference.java b/src/com/android/settings/fuelgauge/batteryusage/SpinnerPreference.java
index 0810158..2bcc7bf 100644
--- a/src/com/android/settings/fuelgauge/batteryusage/SpinnerPreference.java
+++ b/src/com/android/settings/fuelgauge/batteryusage/SpinnerPreference.java
@@ -81,7 +81,8 @@
             return;
         }
         if (!(state instanceof SavedState)) {
-            super.onRestoreInstanceState(state);
+            // To avoid the IllegalArgumentException, return the BaseSavedState.EMPTY_STATE.
+            super.onRestoreInstanceState(BaseSavedState.EMPTY_STATE);
             return;
         }
         SavedState savedState = (SavedState) state;