summaryrefslogtreecommitdiff
path: root/src/com/android/deskclock/timer/TimerService.java
AgeCommit message (Collapse)Author
2021-10-09DeskClock: Squashed AOSP changes before java app was removed.Colin Marsch
* This includes all the java changes that were made to DeskClock during the conversion to kotlin. Squash of the following: AOSP/DeskClock - Add Kotlin code for alarmclock/ files Test: none currently, DeskClockKotlin target builds successfully, testing is a work in progress BUG: 157255731 Original-Change-Id: I4c245d209ac733c4fb5ec527bc9ed84444b8cbd6 AOSP/DeskClock - Add Kotlin file for DataModel Test: manual - Ran the following on Sargo phone. Tested all app interactions (alarms, stopwatch, timer, cities, settings). $ source build/envsetup.sh $ lunch aosp_sargo-userdebug $ make DeskClockKotlin -j $ adb install out/target/product/sargo/product/app/DeskClockKotlin/DeskClockKotlin.apk BUG: 157255731 Original-Change-Id: I2fe53bbdddc9f473ece01bacb386e9ad08efcdc7 AOSP/DeskClock - Add Kotlin file for RingtonePickerActivity Test: manual testing by running the following (1) on Sargo phone and testing the UI, also unit tests ran as follows (2) (1) $ source build/envsetup.sh $ lunch aosp_sargo-userdebug $ make DeskClockKotlin -j $ adb install out/target/product/sargo/product/app/DeskClockKotlin/DeskClockKotlin.apk (2) $ make DeskClockTests $ adb install out/target/product/sargo/testcases/DeskClockTests/arm64/DeskClockTests.apk $ adb shell am instrument -w com.android.deskclock.tests BUG: 157255731 Original-Change-Id: I1eff3fe6e19a19aa35c6fbda541bce72b369b6ae AOSP/DeskClock - Add Kotlin files for TimerService, SetupView, Receiver Additionally, a small bug was fixed in the TimerModel and DataModel Kotlin code (found by new unit tests). Test: manual, ensuring the DeskClock UI is correct, also unit tests were run as follows $ source build/envsetup.sh $ lunch aosp_sargo-userdebug $ make DeskClockKotlin -j $ adb install out/target/product/sargo/product/app/DeskClockKotlin/DeskClockKotlin.apk $ make DeskClockTests $ adb install out/target/product/sargo/testcases/DeskClockTests/arm64/DeskClockTests.apk $ adb shell am instrument -w com.android.deskclock.tests BUG: 157255731 Original-Change-Id: I82a4836ab55281a73168d35ea4f50d39279ce5da AOSP/DeskClock - Add Kotlin files for Timer classes Test: manual, ensuring the DeskClock UI and Timers function correctly, as well as unit tests, ran as follows $ source build/envsetup.sh $ lunch aosp_sargo-userdebug $ make DeskClockKotlin -j $ adb install out/target/product/sargo/product/app/DeskClockKotlin/DeskClockKotlin.apk $ make DeskClockTests $ adb install out/target/product/sargo/testcases/DeskClockTests/arm64/DeskClockTests.apk $ adb shell am instrument -w com.android.deskclock.tests BUG: 157255731 Original-Change-Id: Idb33290c6bf11ee6147f547c85b5f6e3859c17b7 AOSP/DeskClock - Add Kotlin file for ExpiredTimersActivity Test: manual, tested the DeskClock UI including running timers to expiration. Also ran the unit tests as follows $ source build/envsetup.sh $ lunch aosp_sargo-userdebug $ make DeskClockKotlin $ adb install out/target/product/sargo/product/app/DeskClockKotlin/DeskClockKotlin.apk $ make DeskClockTests $ adb install out/target/product/sargo/testcases/DeskClockTests/arm64/DeskClockTests.apk $ adb shell am instrument -w com.android.deskclock.tests BUG: 157255731 Original-Change-Id: I93ec96bae36dc353c0c252c0ef6769965a7172e7 AOSP/DeskClock - Add Kotlin file for TimerFragment Test: manual, tested the DeskClock UI and Timers specifically. As well, unit tests were ran as follows $ source build/envsetup.sh $ lunch aosp_sargo-userdebug $ make DeskClockKotlin $ adb install out/target/product/sargo/product/app/DeskClockKotlin/DeskClockKotlin.apk $ make DeskClockTests $ adb install out/target/product/sargo/testcases/DeskClockTests/arm64/DeskClockTests.apk $ adb shell am instrument -w com.android.deskclock.tests BUG: 157255731 Original-Change-Id: Ib3769584161d6e712a8eafde977f58b3c55f69e3 AOSP/DeskClock - Add Kotlin for FormattedStringModel, PeriodicCallbackModel Test: manual - Tested the DeskClock UI. As well, unit tests were ran as follows $ source build/envsetup.sh $ lunch aosp_sargo-userdebug $ make DeskClockKotlin $ adb install out/target/product/sargo/product/app/DeskClockKotlin/DeskClockKotlin.apk $ make DeskClockTests $ adb install out/target/product/sargo/testcases/DeskClockTests/arm64/DeskClockTests.apk $ adb shell am instrument -w com.android.deskclock.tests BUG: 157255731 Original-Change-Id: I7cc4fb5aa20cd32be51e65de1b2b6a12a7cfa795 AOSP/DeskClock - Add Kotlin for Tab related UI Data files Test: manual - Tested the DeskClock UI and tab interactions. As well, unit tests were run as follows $ source build/envsetup.sh $ lunch aosp_sargo-userdebug $ make DeskClockKotlin $ adb install out/target/product/sargo/product/app/DeskClockKotlin/DeskClockKotlin.apk $ make DeskClockTests $ adb install out/target/product/sargo/testcases/DeskClockTests/arm64/DeskClockTests.apk $ adb shell am instrument -w com.android.deskclock.tests` BUG: 157255731 Original-Change-Id: Ibd7871edf20e548a1cd548246f0a6be88f5cfb88 AOSP/DeskClock - Add Kotlin file for CitySelectionActivity Test: manual - tested DeskClock UI. As well, tests were run as follows $ source build/envsetup.sh $ lunch aosp_sargo-userdebug $ make DeskClockKotlin $ adb install out/target/product/sargo/product/app/DeskClockKotlin/DeskClockKotlin.apk $ atest DeskClockTests BUG: 157255731 Original-Change-Id: I3bd0952f753130e655d1b9f3c911863f34e6e41a AOSP/DeskClock - Add Kotlin files for BaseActivity, CircleButtonsLayout Test: manual - Tested the DeskClock UI. As well, tests were run as follows $ source build/envsetup.sh $ lunch aosp_sargo-userdebug $ make DeskClockKotlin $ adb install out/target/product/sargo/product/app/DeskClockKotlin/DeskClockKotlin.apk $ atest DeskClockTests BUG: 157255731 Original-Change-Id: I019825f173305756633389a26a0bb0e973f2172c AOSP/DeskClock - Add Kotlin file for DeskClock class The onNewIntent call in TimerFragmentTest was changed to setIntent since the visibility of the protected onNewIntent method in Kotlin was more restrictive than before. Test: manual - Tested the DeskClock UI. As well tests were ran as follows $ source build/envsetup.sh $ lunch aosp_sargo-userdebug $ make DeskClockKotlin $ adb install out/target/product/sargo/product/app/DeskClockKotlin/DeskClockKotlin.apk $ atest DeskClockTests BUG: 157255731 Original-Change-Id: I9711dd8068a29fc0a25ee1f364ecb1b6ef326d6a Change-Id: I3d63f95cffc257734f803683d477bf3ecf88f208
2017-11-17Handle ACTION_DISMISS_TIMER intentChristine Franks
Bug: 38475809 Test: adb shell am start -a android.intent.action.DISMISS_TIMER Change-Id: Ifa0b3caa9b021334d573f8d312acbb4236273e4e
2016-09-12Tapping Timer/Stopwatch notifications doesn't crash on KK.Sean Stout
Bug: 31381487 Test: manual - Tap notifications on KitKat Change-Id: I1ae5ecf91c0079fea95620de764fd520ee560ec7
2016-09-01Fixes from merge of ab6a8e1 - DO NOT MERGEJustin Klaassen
Bug: 30076796 Change-Id: I88f075b4c6fc95e54a92d11328e4258521c7054e
2016-08-30Cleanup exported APIsJustin Klaassen
Bug: 30076796 - Removed preliminary support for deeplinks since Clock doesn't have a public content provider. - Removed unnecessarily exported intent actions since Intents specifying explicit components don't need to register specific actions. - Removed unused strings and resources. Change-Id: Ifbee006dbd752ecdcfe0125cabe19ffda40ea659
2016-07-13Negative time timers expire if you resume themSean Stout
Bug: 30066072 Though it is still possible for a timer to go negative and not fire, if the user pauses a negative time timer and then resumes it, it will immediately fire. Change-Id: I27945febbbf8ee10ada6e523261738024b7c2e80
2016-06-14Stopwatches and timers continue to work after device reboot.Sean Stout
Bug: 8101723 Upon device shutdown and reboot, the stopwatch will resume state. If the stopwatch was running, it will continue to run as well as account for the time that the device was off. Additionally, all timers that are on the device will resume state. If the timer was running, it will continue to run on device reboot. If the timer was missed by less than 1 minute, the timer will still go off. If the timer was missed by more than 1 minute, the timer will go to a new "missed" state and give the user a notification that a timer has been missed. Change-Id: Ib7f199ef5be4714b831450933c574f39824d15dc Stopwatches and timers continue to work after device reboot. Bug: 8101723 Upon device shutdown and reboot, the stopwatch will resume state. If the stopwatch was running, it will continue to run as well as account for the time that the device was off. Additionally, all timers that are on the device will resume state. If the timer was running, it will continue to run on device reboot. If the timer was missed by less than 1 minute, the timer will still go off. If the timer was missed by more than 1 minute, the timer will go to a new "missed" state and give the user a notification that a timer has been missed. Change-Id: I831d7a5172a3cede595db1b62e503ecc8c4c55c2
2016-01-11Promote TimerService to the foreground while expired timers existJames Lemieux
Bug: 26471891 This makes the clock app unlikely to be killed in memory pressure situations while expired timers are ringing. Change-Id: I89f141a835e3de67a58671d6c5b381de52be5c18
2015-11-12Simplify HandleDeskClockApiCalls, TimerService and StopwatchServiceJames Lemieux
HandleDeskClockApiCalls used to pass through all timer and stopwatch mutations to the corresponding Service to complete. This complicated the logging of the corresponding event unnecessarily. After this change: - StopwatchService is only invoked from stopwatch notifications and may now assume the event label - TimerService is only invoked from timer notifications and AlarmManager and may now assume the event label - HandleDeskClockApiCalls.EXTRA_FROM_NOTIFICATION has been replaced with HandleDeskClockApiCalls.EXTRA_EVENT_LABEL which explicitly identifies the label of the event Change-Id: Ic9796c43e826f82138ee431d3abb02524c0146ba
2015-11-10Refactor Timers to use new unified DataModelJames Lemieux
Bug: 24816218 Bug: 25494722 This refactoring introduces a Timer domain object. Instances of these domain objects are fetched via a DataModel class that is the single point of reference for all timer data. This allows the data to be shared across the entire application. In particular, the timer notifications, TimerFragment and ExpiredTimersActivity all draw upon the same model to determine what the state of the timers are. IMPORTANT: The public intent com.android.deskclock.action.STOP_TIMER has been renamed to com.android.deskclock.action.PAUSE_TIMER to be more accurate. Change-Id: Ib904e80a25c6de1861de2b395bec27db16ff0e66