The issues is that TimeZoneData is being loaded with LoaderManager on
every fragment's onCreate(). At the same time this fragment has
onActivityResult() handler that accesses TimeZoneData and relies on the
fact that it has been already initialized prior this call. So when you
enable "Don't keep activities" mode, the TimeZoneSettings fragment [1]
that holds TimeZoneData is immediately destroyed after launching time zone
picker fragment [2] (which result [1] waits for), and when android calls
onActivityResult() for [1] (after time zone has been picked in [2]),
Android has to recreate [1] from scratch. So you get onCreate() called and
immidiately after that onActivityResult() called, and at this point we get
the crash, because the loader hasn't finished yet and onActivityResult()
tries to access uninitialized mTimeZoneData.
This CL fixes this crash issue by postponing
mTimeZoneData.lookupCountryTimeZones call until mTimeZoneData is loaded
by loader. It is done through saving data intent in onActivityResult()
and calling onZonePickerRequestResult() when time zone data is loaded.
Bug: 112351583
Test: m Settings droid successfully builds, manual testing with "Don't
keep activities" mode enabled
Change-Id: Id30d36dc17a0de96ba871f9d0f4a2686479d0eeb
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
- Remove emoji region flag in the region picker.
It's more consistent with locale picker which shows no flag in region
picker
- Remove redundant information in the summary field
e.g. same GMT offset in primary and secondary field in fixed offset
picker
- Better mode switching flow. Switch region/fixed offset mode
only when the user confirms their selection in the picker.
Bug: 73952488
Test: m RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.datetime.timezone
Change-Id: Id5da8a2516acd10c9a3d71181e94bc617d797d20
- Show current selected region and time zone in a 2 rows.
Defailed info of current selected time zone in footer
- Show option menu to switch to select UTC offset
- This picker will be changed to the default picker in a later CL
Bug: 73952488
Test: m RunSettingsRoboTests
Change-Id: Ia81bb022e1021369612f5bd60c2c1f4d08db2af8
(cherry picked from commit b7d588f341)