Commit Graph

12 Commits

Author SHA1 Message Date
Almaz Mingaleev
dd2a685756 Allow alternative time zone ID to be set device's zone.
If America/Godthab is set as device time zone, display it as if
America/Nuuk is chosen.
If time zone is known, but is not an alternative and not shown
in time zone picker, region will de derived from user's locale.

Bug: 155738410
Test: atest com.android.settings.datetime.timezone.model
Test: set persist.sys.timezone via adb and checked
Date & Time screen

Change-Id: I168fb4319e144dbe9e2496d06a681d4c09b411c0
2021-03-29 11:18:57 +01:00
Stanley Wang
f0cd9742b5 The dynamic index implementation for time zone preferences.
Disable the region settings page if auto time zone is enabled.

Fixes: 146849126
Test: manual
Change-Id: Icce1e5aca14539d6c9149e05a3321429bd337f17
2019-12-30 12:46:32 +08:00
Edgar Wang
08f2a58459 Settings search - Navigate user to exact page
- remove duplicate index preference
- default set searchable = false when the preference has fragment
- make some fragments indexable

Bug: 143057584
Test: robotest & manual

Change-Id: I4d64f6106d2f92f0a45e8c7e26388677f593f412
2019-12-24 21:04:11 +08:00
Neil Fuller
df086ecb4f Switch settings to use TimeDetector
Switch settings to use TimeZoneDetector when setting the system time
zone rather than using AlarmManager directly.

Bug: 140712361
Test: treehugger
Test: manual
Test: make -j30 RunSettingsRoboTests
Change-Id: I6042093294ba9690d4355bfe1c47d9f88a2b7ac6
2019-12-04 13:43:58 +00:00
Nikita Iashchenko
8db2d30fab Fix crash if timezone is changed and "Don't keep activities" mode is on
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
2019-01-29 15:22:56 +00:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Fan Zhang
65983f71d5 Update TimezoneInfoPrefController to register in xml
Test: robotest
Bug: 77216595
Change-Id: I0fde4f8058a8be156dddb620a756254cd85f6a9f
2018-03-29 14:38:44 -07:00
Victor Chang
ca529d9e89 Fix UX problems in time zone pickers
- 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
2018-03-09 19:48:14 +00:00
Victor Chang
d5adf42c5e New time zone picker page
- 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)
2018-03-07 11:52:25 +00:00