summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/NetworkTimeUpdateService.java
AgeCommit message (Collapse)Author
2013-12-19Move some system services to separate directoriesAmith Yamasani
Refactored the directory structure so that services can be optionally excluded. This is step 1. Will be followed by another change that makes it possible to remove services from the build. Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
2013-09-19Use a separate thread for services that do NTP lookupAmith Yamasani
Some services do periodic network time lookups and can wedge the other operations on BackgroundThread and IO Thread, causing Watchdog to kill the runtime. So best to put those handlers on separate threads. Going forward, should convert NTP lookups to be async with callbacks. Bug: 10646480 Change-Id: I8c7ba6052cb3539575712c2099a706b14ff60196
2013-07-16Refactoring of the print sub-system and API clean up.Svetoslav Ganov
1. Now a user state has ins own spooler since the spooler app is running per user. The user state registers an observer for the state of the spooler to get information needed to orchestrate unbinding from print serivces that have no work and eventually unbinding from the spooler when all no service has any work. 2. Abstracted a remote print service from the perspective of the system in a class that is transparently managing binding and unbinding to the remote instance. 3. Abstracted the remote print spooler to transparently manage binding and unbinding to the remote instance when there is work and when there is no work, respectively. 4. Cleaned up the print document adapter (ex-PrintAdapter) APIs to enable implementing the all callbacks on a thread of choice. If the document is really small, using the main thread makes sense. Now if an app that does not need the UI state to layout the printed content, it can schedule all the work for allocating resources, laying out, writing, and releasing resources on a dedicated thread. 5. Added info class for the printed document that is now propagated the the print services. A print service gets an instance of a new document class that encapsulates the document info and a method to access the document's data. 6. Added APIs for describing the type of a document to the new document info class. This allows a print service to do smarts based on the doc type. For now we have only photo and document types. 7. Renamed the systemReady method for system services that implement it with different semantics to systemRunning. Such methods assume the the service can run third-party code which is not the same as systemReady. 8. Cleaned up the print job configuration activity. 9. Sigh... code clean up here and there. Factoring out classes to improve readability. Change-Id: I637ba28412793166cbf519273fdf022241159a92
2013-05-02Start combining threads in system process.Dianne Hackborn
This introduces four generic thread that services can use in the system process: - Background: part of the framework for all processes, for work that is purely background (no timing constraint). - UI: for time-critical display of UI. - Foreground: normal foreground work. - IO: performing IO operations. I went through and moved services into these threads in the places I felt relatively comfortable about understanding what they are doing. There are still a bunch more we need to look at -- lots of networking stuff left, 3 or so different native daemon connectors which I didn't know how much would block, audio stuff, etc. Also updated Watchdog to be aware of and check these new threads, with a new API for other threads to also participate in this checking. Change-Id: Ie2f11061cebde5f018d7383b3a910fbbd11d5e11
2012-11-21Make NTP constants configurable.Jaewan Kim
Bug: 6943067 Change-Id: I0b0f9076fba99e9c457ef7180b9936c0d2a7d589
2012-09-25Update references to migrated global settings.Jeff Brown
Fixed one setting that was migrated but not marked deprecated. Removed a hidden setting that is no longer used by the new power manager service. Bug: 7231172 Change-Id: I332f020f876a18d519a1a20598a172f1c98036f7
2012-05-02On first boot and NTP lookup, set the time even if it's not off by 5+ secs.Amith Yamasani
This enables SetupWizard to get an ACTION_TIME_CHANGED event. Bug: 6432127 Change-Id: I42b8d6672372dc1aa4aa43128b5d801875ccf057
2012-02-10NetworkTimeUpdateService: Schedule NTP on ethernet connect as well as wifiMike Lockwood
Signed-off-by: Mike Lockwood <lockwood@android.com>
2012-01-30Move away from deprecated NetworkInfo extra.Jeff Sharkey
Because the NetworkInfo included in CONNECTIVITY_ACTION broadcast extra does not reflect the state applicable to the calling UID, and the last sticky broadcast may have stale state, transition to calling ConnectivityManager.getActiveNetworkInfo() directly. Change-Id: I86b316fbedd0273585ad5f1248b091bc3a3a5520
2011-07-10Cached NTP time for system services.Jeff Sharkey
Uses NTP server and timeout from secure settings, or fallback to defaults in resources. Update various system services to use cached NTP time when fresh enough, or force updates as needed. Bug: 4517273 Change-Id: Ie1c4c4883836013d02ca0bbd850cf8949f93b34b
2011-03-01Check for NTP time as soon as WIFI is connected.Amith Yamasani
Listen for connectivity changes. If WIFI is connected, check if we have recently checked for NTP time. If we haven't yet checked the time or it has been long enough (a day), then connect to the NTP server and get the latest time. Update the time if it is significantly out of sync. This doesn't poll the NTP server every time there is connectivity, only if it hasn't been checked since boot or has been a day. This fixes the problem that during SetupWizard, we try to contact the NTP server before there is connectivity and fail. Now, as soon as the user chooses a WiFi network to connect to, it will update the time before getting to the Date/Time step. Then as soon as the user corrects the TZ, the date/time should be correct. Bug: 3491920 Change-Id: I62664156616510b67ecd6a1c24dd838b98d5204f
2010-09-15Provide automatic date/time based on NTP lookup.Amith Yamasani
Do this on a periodic basis as well as when the AUTO_TIME setting changes to true. If we recently acquired NITZ time from the telephony provider, then don't override with NTP time.