summaryrefslogtreecommitdiff
path: root/core/java/android/widget/TextClock.java
Commit message (Collapse)AuthorAgeFilesLines
* Stop using TIME_TICK broadcast in TextClockStevie Kideckel2021-06-081-16/+24
| | | | | | | | | | | | | This gets called even when the view is not visible, which is bad for performance. I've adapted the existing tick framework to handle ticking for minutes when there aren't seconds in the format. I verified the correct behavior with sample apps with and without seconds in the format, including across DST time changes. Fix: 190467448 Test: locally with sample apps Change-Id: I75fed5c9d162b5361c31fe22d057a007db0ce75c
* 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
* Merge "Remove @CorePlatformApi LocaleData usage in frameworks" am: ↵vichang2020-07-221-14/+14
|\ | | | | | | | | | | | | | | 3f89b904a8 am: 226e3d7641 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1367376 Change-Id: Ib23a5ff1491c89d5cd0f962b1f609c988111c18b
| * Remove @CorePlatformApi LocaleData usage in frameworksVictor Chang2020-07-201-14/+14
| | | | | | | | | | | | | | | | | | | | | | They can be replaced by the public API provided by ICU4J instead. No extra layer of caching equivalent to the LocaleData cache is added because ICU4J has caches instances, e.g. DateFormatSymbols, etc. Bug: 160606356 Test: atest FrameworksCoreTests:android.text.format Change-Id: I07048e0e1a4835d2744b7fce6a5ed79a112e456b
| * Use new UnsupportedAppUsage annotation.Artur Satayev2020-01-091-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 Merged-In: I41e12e425284e74561c6b61663241df364ae54a1
* | Making time-zone an API constantSuprabh Shukla2020-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | This is already effectively an API the way it is documented. Updating all the references of the hard-coded constant. Test: make update-api && make Bug: 151112929 Change-Id: Iadeb03c516215cfc51bc8604b67250348d5a4375
* | Rename the api from refresh() to refreshTime() to make it more clearshawnlin2020-01-081-1/+1
| | | | | | | | | | | | Test: make api-stubs-docs-update-current-api, make Bug: 140102239 Change-Id: Ieb7403748b8b8a7f7c967b7228733a19caf4a306
* | 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
* | Make TextClock.refresh() a public APIshawnlin2019-08-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | Starting from R, apps in /product are not allowed to use hidden API. TextClock.refresh() is used in FloralClock which is in /product. We need to make it a public API. Bug: 132750099 Test: make Change-Id: I20adbff79270ce9d13f3323386d3636c322012f1
* | Merge "Merge "Refresh should always update the field" into qt-dev am: ↵Lucas Dupin2019-05-211-6/+6
|\| | | | | | | | | | | | | | | ae61369c0d am: b87abd1b90" into qt-r1-dev-plus-aosp am: 300b7ac0d8 Change-Id: I95368f7a6f83a738edbd8af99495fce3d31ce68c
| * Refresh should always update the fieldLucas Dupin2019-05-201-6/+6
| | | | | | | | | | | | | | | | | | | | Otherwise it's hard to keep track of things happening or not, since the request would be postponed, leading to bugs elsewhere. Test: Wait for time to pass on lock screen Test: Enter/leave AOD Fixes: 132955195 Change-Id: I54f806f9dd2d1cf4acac420bab08d4579f867a5f
* | Fix NPE in TextClock.George Mount2019-05-101-1/+4
|/ | | | | | Fixes: 111901732 Test: Ran TextClockTest cts Change-Id: Icaf7a7f6e3985bd58e22f74588e95d8a02b52187
* Merge "Update core widgets to save attribute source info."Aurimas Liutikas2019-02-111-0/+2
|\
| * Update core widgets to save attribute source info.Aurimas Liutikas2019-02-071-0/+2
| | | | | | | | | | | | Bug: 111439551 Test: make -j Change-Id: I72997a87122f38b32e38e42a690385acc7d0e521
* | TextClock registerContentObserver with UserHandleBookatz2019-02-061-1/+9
|/ | | | | | | | | | | | When adding a widget that uses TextClock to the home screen from a work profile, the home screen may crash due to a android.permission.INTERACT_ACROSS_USERS permission error, due to a mismatch between the caller's userId and the widget's userId. This fix uses the caller's userId to register the ContentObserver. Bug: 111627637 Test: added a widget (as specified in the bug) that uses TextClock from a work profile Change-Id: I153e55b755d656f1d7882645df15290bf8ad56f9
* @InspectableProperty coverage for android.widgetAshley Rose2019-02-041-0/+5
| | | | | | | | | 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/+3
| | | | | | | | | | | | | | | | 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
* Trigger new frame after display is ready to turn onLucas Dupin2018-04-051-0/+9
| | | | | | | | | | | Making sure that a frame will be pushed after the display is ready to turn on by invaliding the clock after a delay. Also removed unecessary binder call. Test: cover prox sensor and wait 1 minute. repeat ~10 times Change-Id: Ic1b8006781e5486822a5ab65b71b3c44980f2f16 Fixes: 71913808
* Add TestApi to disable the TextClock clock tick.George Mount2017-12-201-0/+19
| | | | | | | | | | | | Bug: 70771205 In order to test TextClock being only updated by the 12/24 hour setting, we must disable the clock tick from causing the text to change. Otherwise whenever the minute changes, the clock text would update. This leads to a flaky test. Test: I4917a2296744697f1b50a17e3c5eb5873d567a47 Change-Id: Ifb669af3e6b882eb7c158b7de16e7eb2f0c48f61
* Make TextClock only listen for specific changes.George Mount2017-12-071-2/+3
| | | | | | | | | | | Bug 68016230 Make TextClock only listen for changes to the 12/24 hour clock setting, so that it doesn't trigger a change when other settings are updated. Test: I5dee1694890ec90b0eabb939cd636971ed9ba5d4 Change-Id: Ia345995dc2f019209e3c68e6e8681cd2c9d5f439
* Move expensive TextClock operations to onAttachIan Lake2017-04-181-25/+36
| | | | | | | | | | | | | | | Registering and unregistering are expensive operations that should not be done when the visibility of the TextClock changes. However, we want to ensure that a non-visible TextClock does not consume extra resources or cause layout/redraw passes. By keeping the TextClock registered but avoiding the side effects of onTimeChanged, we can get the best of both worlds. Test: manual testing BUG: 33960344 Change-Id: I80771524a09ca57488834bafd97b570f2a8235db
* Revert "Move expensive TextClock operations to onAttach"Ian Pedowitz2017-03-221-46/+18
| | | | | | | This reverts commit dffe6fdfe1e25e3bad52c00ff6c978deb0327852. Bug: 36472151 Change-Id: I98ba047bd4225d82414425a40e9a2e50c4473bf9
* Move expensive TextClock operations to onAttachIan Lake2017-03-101-18/+46
| | | | | | | | | | | | | | | Registering and unregistering are expensive operations that should not be done when the visibility of the TextClock changes. However, we want to ensure that a non-visible TextClock does not consume extra resources or cause layout/redraw passes. By keeping the TextClock registered but avoiding the side effects of onTimeChanged, we can get the best of both worlds. Test: manual testing BUG: 33960344 Change-Id: I3e76246d820363766b78130231d665989fdb4265
* Fix import statements in android.widget package.Aurimas Liutikas2016-10-111-5/+5
| | | | | | | Additionally this CL removes spaces at the end of the line. Test: code still compiles. Change-Id: I1ce98b4e70aa3ae614f87966c3bc6181fa4389a4
* Do not listen for clock ticks, time changes, timezone changes, or time ↵Erik Wolsheimer2016-10-051-18/+9
|\ | | | | | | | | | | | | | | format changes when TextClock is not visible am: e12cd3bb3b am: 4d855f15ab Change-Id: I9bebe0ea19701dcdb924c20534a418f7ad19440a
| * Do not listen for clock ticks, time changes, timezone changes, or time ↵Erik Wolsheimer2016-10-051-18/+9
| | | | | | | | | | | | | | format changes when TextClock is not visible BUG: 31840153 Change-Id: I11adf1036fb25b28aee5caba6daa1ab0d9d1f23a
* | Add missing @Deprecated annotations.Aurimas Liutikas2016-05-241-0/+2
|/ | | | | | | Add missing @Deprecated annotations for methods with @deprecated tag in javadoc. Change-Id: I35b78ccb97832d86b914c21a300444ba29e33844
* Fixed cross profile usage of TextClock.Oleksandr Peletskyi2016-04-111-1/+9
| | | | | | | | Fixed crash of a widget that uses TextClock and belongs to a work profile when is being added to the dash board. BUG:27035203 Change-Id: I70c66cb792d159d2527050db820e7154784148a2
* Fix a few view ctors to not call Looper.myLooperJohn Reck2015-10-201-10/+23
| | | | | Bug: 25116730 Change-Id: I4e394c281feef6f7987433298d66f2df11352416
* Accessibility: Read the time correctly in quick settings.Dan Sandler2015-07-291-0/+29
| | | | | | | | | | | | | | | | | | | The problem is that, for 12-hour locales, we cut the "a" part of the time format out to show it in a separate TextView so it can be animated independently of the actual time. Unfortunately, while TTS is smart enough to pronounce "1:15 AM" as /wʌn fɪftin eɪ ɛm/, "AM" on its own looks like the English word "am" and is pronounced /æm/. To fix this, a TextClock must be able to accept separate formats for its content description than its presentation. With this capability we can place the complete 12-hour time format (including am/pm) in one of the views and suppress the other one, so that the utterance creates an identical experience to visual inspection: "1:15 AM" for all users. Bug: 21718000 Change-Id: Ic9920d71ae4d4ad41ba86d7bd96f9a19b07e2108
* Use new hierarchy viewer protocol in all View subclassesSiva Velusamy2015-05-071-0/+16
| | | | | | | | | A previous CL introduced a new way of encoding view properties for use by heirarchy viewer. This CL updates all views using the old @ExportedProperty annotation to use this new method. The older mechanism will be removed in a subsequent CL. Change-Id: I6cc23b90cd9da1c6ce89b4caffe54874db203452
* resolved conflicts for merge of f0fc23a1 to lmp-mr1-dev-plus-aospJorim Jaggi2014-11-251-2/+32
|\ | | | | | | Change-Id: I8f1dbae2ecd14ae4e51a9e86eb6d36dd56a48be1
| * Fixed several time related states for secondary usersSelim Cinek2014-11-211-2/+32
| | | | | | | | | | | | | | | | | | The 24 hour setting was not respected correctly. Also fixed a bug where the next alarm would not display itself in the QS panel. Bug: 16239208 Change-Id: I89734f783912dead5831db49db53fba04dbf54ee
* | am ced7ebdb: Merge "Migrate off timeFormat12 and timeFormat24."Elliott Hughes2014-10-281-4/+4
|\ \ | |/ |/| | | | | * commit 'ced7ebdb1d522b4206e2048b278554ca841aeaba': Migrate off timeFormat12 and timeFormat24.
| * Migrate off timeFormat12 and timeFormat24.Elliott Hughes2014-10-231-4/+4
| | | | | | | | | | | | | | | | | | | | libcore now offers a wider variety of 12-/24-hour time formats, so be more specific about which one we want here. (cherry-pick of 85f60d3a03b5b5d9a0e8b8a138eb85a6b53a1eca.) Bug: 10361358 Change-Id: I846ab7a6f84cd49e876ad21e9366aff1600e0530
* | Revert "Ensure all RemoteViews use myUserId rather than context."Kenny Guy2014-09-041-19/+2
| | | | | | | | | | | | | | | | | | 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-2/+19
| | | | | | | | | | | | | | | | | | 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
* | Add View constructor that supplies a default style resourceAlan Viverette2013-09-091-7/+11
|/ | | | | | | Also updates the constructor of every class that extends View. BUG: 10676369 Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3
* Fix TextClock documentationRomain Guy2013-04-301-18/+28
| | | | | | Bug #8670351 Change-Id: I87a906b85b51f44d9dcecb6f137db53886323ad7
* am eda35cb7: am a8974d3f: Merge "Clean up (some of) our many clocks to use H ↵Elliott Hughes2013-03-191-49/+62
|\ | | | | | | | | | | | | instead of k." * commit 'eda35cb7c5781a32b038f1ef76b8e50f26f9bfaf': Clean up (some of) our many clocks to use H instead of k.
| * Clean up (some of) our many clocks to use H instead of k.Elliott Hughes2013-03-181-49/+62
| | | | | | | | | | Bug: 8359981 Change-Id: I3c0c38c2bf5adc4b5bdc11c3d10cf41dd8fb6462
* | Examine widget hierarchy to find clocks.Jeff Sharkey2013-01-111-0/+10
|/ | | | | | | | | When switching to a widget, examine its hierarchy to determine if it contains TextClocks that show hour and minute for the local timezone. If so, hide the status bar clock. Doesn't fix closing walls. Bug: 7667638 Change-Id: I1e2c40345c9e5eb0193efd70838c7ca9f779190b
* Respond to ticks when a timezone is set and it doesn't display secondsRomain Guy2012-11-061-11/+7
| | | | | | | | | Bug #7489774 This change also fixes a crash if you programmatically set the time formats from code before the widget is attached to the window. Change-Id: I73ead93f5866d9059a4b3823c4304aeca8e419b6
* Add programmatic access to setters in TextClockRomain Guy2012-11-051-0/+4
| | | | | | | | Bug #7478328 Add missing annotation to let appwidgets change values programmatically Change-Id: I6e9b095e93e4e90bd96e127344354c0dfa46cd86
* A new clock widget to create lock screen appwidgetsRomain Guy2012-10-311-0/+482
This new widget replaces DigitalClock. It listens to all the correct system events and offer the ability to customize the formatting patterns in 12-hour and 24-hour modes. It also supports fixed time zones to create world clocks. One more step towards becoming ClockOS! Change-Id: I677e5dfca8cd8c8d1f8c49e54d7507f4d1885bf4