summaryrefslogtreecommitdiff
path: root/core/java/android/widget/DateTimeView.java
Commit message (Collapse)AuthorAgeFilesLines
* Don't trigger full relayout if DateTimeView doesn't changeJernej Virag2022-04-211-3/+16
| | | | | | | | | | | | | | | | Right now, when an update is triggered, DateTimeView will trigger a full relayout of its parents because it always calls setText, even if it doesn't change the contents (later down the line, TextView will call requestLayout() for wrap_content, even if size didn't change). Checking if the content actually changed avoids that extra layout pass which avoids needless relayouts in e.g. SystemUI Notifications. Bug:220712538 Test: atest DateTimeView (new test failed before fix / passes after fix) Change-Id: Ib391d6715136b64b98f0bda3b3d4a3f991809c89
* Clean <plurals> in DateTimeViewCalvin Pan2022-01-261-46/+41
| | | | | | Bug: 199230228 Test: make Change-Id: Ib484fc0c59f7900b751f4e782dd67c000cc855bb
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-1/+2
| | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-2/+1
| | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-1/+2
| | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* Use new UnsupportedAppUsage annotation.Artur Satayev2020-01-061-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I41e12e425284e74561c6b61663241df364ae54a1
* Merge "Switch widgets away from android.text.format.Time"Neil Fuller2019-07-091-57/+68
|\ | | | | | | | | | | am: db31e6d07a Change-Id: I550b2c7ac5e3e5b07eda51c190c354e5236a561e
| * Switch widgets away from android.text.format.TimeNeil Fuller2019-06-181-57/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | android.text.format.Time is limited to 32-bit seconds from the beginning of the Unix epoch and so classes that use it are limited to 1901 - 2038. Switching to java.time avoids this issue. Manual Testing: AnalogClock is deprecated and not used anywhere so difficult to test. DateTimeView is used in the status bar. Behavior was verified with current date/time and also Europe/London around 2019-03-31 01:00 (skip forward) and around 2019-10-27 02:00 (fall back). The time picker in settings uses android.icu.util.Calendar which favored the later time if there are two local times with the same display time (e.g. the fall back case). The "repeat" case was tested with "date @1572137900" to set the clock to "the first" 01:58, then waiting 2 minutes to ensure that the 01:59 -> 01:00 transition occurs correctly. Bug: 16550209 Test: build / boot / treehugger Test: See above Change-Id: Ibadad3041a2e54fe12d347960bf1e0f3ebe10c01
| * Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For packages: android.widget This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: Idf7ccc7a850fa984ea16f91cdd70159087274e5c Merged-In: Ic61019b1df85448a158fc2ba55c326353222c6b9
* | @InspectableProperty coverage for android.widgetAshley Rose2019-02-041-0/+11
| | | | | | | | | | | | | | | | | | A few getters for view properties have been added where they were missing. CTS tests for the new APIs are pending in b/123894719. Test: m framework Bug: 120492712 Change-Id: I743ce693d384eaf749ced3db7f81bda7d19ed275
* | Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-211-0/+4
|/ | | | | | | | | | | | | | | | For packages: android.widget This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: Ic61019b1df85448a158fc2ba55c326353222c6b9
* Merge "Avoid use of DateUtilsBridge.icuTimeZone()"Neil Fuller2018-07-161-2/+2
|\ | | | | | | | | | | am: e859c42e23 Change-Id: I6b6452f9609d88ce61959e7c4ae4f0fd8fa97e64
| * Avoid use of DateUtilsBridge.icuTimeZone()Neil Fuller2018-07-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | DateUtilsBridge is only used in one place in framework. The usage is avoidable by sticking to java.util. This decreases the number of non-public libcore classes in use by framework. Test: build Bug: 111055375 Change-Id: Ifd6576b5b6df1e154f16ec201a4575d0b95de66d
* | Fix exception from DateTimeView unregisters receiver againRiddle Hsu2018-06-061-2/+4
| | | | | | | | | | | | | | | | | | | | Although parent view may invoke onDetachedFromWindow incorrectly, itself should guarantee to unregister receiver only when removing the last attached view. Change-Id: I4b701c223c6aa354896a4067f77aad9c98d88dfd Fixes: 78506836 Test: atest FrameworksCoreTests:DateTimeViewTest
* | Fix new notification showing timestamp "now" after turning off DNDshawnlin2018-05-031-1/+9
|/ | | | | | | | | | | | | DateTimeView won't update timestamp until the view is attached to window and received TIME_TICK intent. Update timestamp on onAttachedToWindow(). Test: manual 1) turn on DND 2) send a notification and wait some time 3) turn off DND and check the timestamp Fixes: 77970557 Change-Id: Ia8420aacf5b91b0bb9cbec561629ddbfc8de4f67
* Move all time ticks to bg handlers, and postJason Monk2017-01-131-16/+49
| | | | | | | | This will hopefully avoid blaming sysui for ANRs when the system is hosed. Test: Manual, build, push, wait for time to change Change-Id: I1661ac1a997ad8917b449dd175229d8b77f583c9
* Fixed the relative time spoken with accessibilitySelim Cinek2016-05-251-1/+58
| | | | | | | | The relative time was unclear for certain locales and even worse 1m was spoken as 1 meter. Change-Id: Ie172092da27ea8119906b0c301b5569bf3efabbb Fixes: 28961667
* Fixed a bug where notification header could become emptySelim Cinek2016-04-211-1/+11
| | | | | | | | Also fixed a few more issues with the header util that could lead to wrong states. Change-Id: I95c3479f5d9e5221ee9e91120271e7957b887607 Fixes: 28295743
* Switched the notification time to relative timeSelim Cinek2016-04-211-14/+139
| | | | | | | | The time is now displayed in a relative manner instead of absolute. Change-Id: Idcc4411ed07991b6e176c4890a0d804394d8598a Fixes: 27435284
* Make DateTimeView more robust to weird contexts.Dan Sandler2015-07-301-1/+2
| | | | | | | | | | In particular, some clients (*ahem* SystemUI) have been known to inflate RemoteViews with unusual derived contexts that may not have valid application contexts. DateTimeView can now resist this. Bug: 22852700 Change-Id: I5e91ae0e66859f5f5efd7b19c0ae6dfbc26bcc54
* DateTimeView: don't assume you have an ApplicationContext.Dan Sandler2015-07-301-3/+7
| | | | | Bug: 22840771 Change-Id: I3be6369936f90e9ce4e61a59ea81b0d3408a0f99
* Remove unused imports in frameworks/base.John Spurlock2015-02-281-3/+0
| | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* resolved conflicts for merge of 98b8fe74 to lmp-mr1-dev-plus-aospNarayan Kamath2014-11-241-20/+1
|\ | | | | | | Change-Id: Ic2826f3be8337e72a80978e4565e0884b9ceed70
| * Stop using DATE_FORMAT from settings.Narayan Kamath2014-11-181-28/+1
| | | | | | | | | | bug: 18388178 Change-Id: I315dc463bb0569adc0b5d1c5ac5a17485f2b5adc
* | Don't register more receivers and observers for every DateTimeViewAdam Powell2014-11-071-41/+85
|/ | | | | | | | | SystemUI uses several of these per notification, so be a little more conservative and track individual views to update per process instead. Bug 16902706 Change-Id: Ib77a8e7727d027cae39d5e6f431cac1d1ff8a121
* Revert "Ensure all RemoteViews use myUserId rather than context."Kenny Guy2014-09-041-22/+4
| | | | | | | | | This reverts commit 5287e37687f117ac0b690100ad90842eff58d15a. Reverting because only worked if settings cache had been populated already. Bug: 17302505 Change-Id: I4360606e9d9c6409951f0a02bd0b78c55085e0c6
* Ensure all RemoteViews use myUserId rather than context.Kenny Guy2014-09-041-4/+22
| | | | | | | | | Remote views may be inflated in another user so explicitly use processes user id rather than the user id of the context. Bug: 17302505 Change-Id: I985c91745f03dd7e6b2ab6357600077664d8e6be
* Remove unused imports from frameworks/base.John Spurlock2013-11-201-3/+0
| | | | Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
* Switch over to getting 12-/24-hour time formats from CLDR via icu4c.Elliott Hughes2013-01-141-9/+1
| | | | | | | | I removed the duplication in DateTimeView rather than fix that copy of the code. Bug: 7924970 Change-Id: I60c205d06ad3b50fd2f5d5fc432e4eb186f9c0e7
* Fix obviously broken DateTimeView.onAttachedToWindow().Daniel Sandler2011-08-091-1/+1
| | | | Change-Id: I6b9e948d26b4c22b4520ca48b71c1f7e45ca7899
* Fix bug 2531732 - DateTimeView explodes on bad system date format.Adam Powell2010-03-231-1/+6
| | | | | | Fall back to a default date format instead of throwing an exception. Change-Id: I827a81d9610ea7f9243c1c33579e7a5d3b423692
* Fix bug 2389454 - DateTimeView can NPE if "date_format" isn't set in Settings.Joe Onorato2010-02-011-1/+1
|
* Add DateTimeView, a widget that shows a time or the date depending on theJoe Onorato2010-01-191-0/+258
current time. Use that for notifications instead of a TextView that doesn't ever update. BUG 1563917