summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/NativeDaemonConnector.java
Commit message (Collapse)AuthorAgeFilesLines
* Move some system services to separate directoriesAmith Yamasani2013-12-191-598/+0
| | | | | | | | 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
* Add a simple test for NetworkManagementService.Lorenzo Colitti2013-08-231-2/+14
| | | | | | | | | | For now, this only tests network observers. It works by starting NetworkManagementService with a fake netd socket, feeding it inputs, and seeing if the appropriate observer methods are called. Bug: 10232006 Change-Id: I827681575642a4ee13ae48b81272521544b676bd
* am b8292830: resolved conflicts for merge of a920f25f to jb-mr2-dev-plus-aospElliott Hughes2013-06-281-4/+4
|\ | | | | | | | | * commit 'b8292830f79fc76ffb9a1be5cd316212ac494d03': Switch frameworks/base over from @hidden Charsets to public StandardCharsets.
| * resolved conflicts for merge of a920f25f to jb-mr2-dev-plus-aospElliott Hughes2013-06-281-4/+4
| |\ | | | | | | | | | Change-Id: I3349f8d2e6715171e2677c1385122ceb2810c1f6
| | * resolved conflicts for merge of fca0f92e to stage-aosp-masterElliott Hughes2013-06-281-4/+4
| | |\ | | | | | | | | | | | | Change-Id: I4791f0ffa324a313b8390fbde6d8f82f716ecf74
| | | * Switch frameworks/base over from @hidden Charsets to public StandardCharsets.Elliott Hughes2013-06-281-4/+4
| | | | | | | | | | | | | | | | | | | | Bug: 3484927 Change-Id: I5d136d2ee629588538602766a182ae14ce5fc63c
* | | | resolved conflicts for merge of e96a8207 to masterKenny Root2013-06-101-21/+55
|\| | | | | | | | | | | | | | | Change-Id: I90801b35ed0c00078a47faadc7fbb05d2e5fe381
| * | | Avoid logging sensitive data.Jeff Sharkey2013-06-071-21/+55
| |/ / | | | | | | | | | | | | | | | | | | | | | When building commands to send across NativeDaemonConnector, scrub sensitive arguments to prevent them from being logged. Bug: 8609800 Change-Id: I84b16791749264a010f7e59f9918f68d71bac6b9
* / / Start combining threads in system process.Dianne Hackborn2013-05-021-4/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* / Require command and argument separation, cleanup.Jeff Sharkey2013-02-251-57/+17
|/ | | | | | | | When invoking NativeDaemonCommands, require that base command and arguments are separate. Clean up reverse tethering commands, and remove deprecated throttle events. Change-Id: I302a74130b4f7c3f3045815a56d566e89c8969f6
* Useful annotations for code documentation.Jeff Sharkey2012-11-121-1/+2
| | | | | Bug: 6537978 Change-Id: I806c3c09e3255f8789455f13bf37c1dde2a93f1f
* Fix a sync problem in NativeDaemonConnector.Robert Greenwalt2012-06-071-60/+69
| | | | | | | | | | We had a gap in sync coverage between doing a check and waiting and a matching gap between setting a condition and notifying. It was possible to get context switched just so and have the notify hit before the waiter had started waiting. bug:6492166 Change-Id: Idc876cf85b35902a79fae932547957ed5ef00e4f
* Modify logging to debug this issueRobert Greenwalt2012-05-241-2/+7
| | | | | | | | | Logging exec time on startUsingNetworkFeature as we've had some reports suggesting it's causing ANRs. Remove some logging from NDC so it's local log is more useful. bug:6492166 Change-Id: I258ff6c59bff2c65935242d50496d84720c5d493
* Add some logging to NDC.Robert Greenwalt2012-05-151-0/+3
| | | | | bug:6492166 Change-Id: Ib7c7a0927d3e920f6c041f7252f3f24c8e597bc7
* Allow quoted strings from NativeDaemonConnectorRobert Greenwalt2012-04-201-1/+1
| | | | | | | | | | Previously we'd only handled quoted strings going into NDC. This change auto-handles quoted strings in broadcasts and allows protocol handlers to request de-quoted elements when needed instead of using the generic split(" "). bug: 6353048 Change-Id: I8a07be86411063ed1b402294edc399b4cc076da5
* Record the trimmed cmd string for logsRobert Greenwalt2012-03-131-40/+31
| | | | | | | The over the wire command includes a \0 that mangles log messages. bug:6149176 Change-Id: I77d4e443f1966bff060f1b97570851f7549fee8e
* Make NDC not block forever and handle restart.Robert Greenwalt2012-02-291-52/+181
| | | | | | | | | | Still possible for netd to get wedged but system won't die because of it. Leads the way to having forking netd - then only individual commands would wedge, promoting stability. bug:5864209 bug:6019952 Change-Id: I43e4c5072863b8b812d4fe24d30d92eb1a11651a
* Revert "Make NDC not block forever and handle restart."Guang Zhu2012-02-071-175/+52
| | | | | | | | Reverting because it seems to break `adb reboot` This reverts commit 813af8d46467f41ed2d492917cbb9f9f45d2a3d7. Change-Id: I75d827664a08799de15369c24c84cc3f49a8f297
* Make NDC not block forever and handle restart.Robert Greenwalt2012-02-071-52/+175
| | | | | | | | | | | Need changes in core. Still possible for netd to get wedged but system won't die because of it. Leads the way to having forking netd - then only individual commands would wedge, promoting stability. bug:5864209 Change-Id: Ifcd37511c8239fe3df7e9070869b63a9c5649bd2
* Add some logging to NDC.Robert Greenwalt2012-02-021-1/+9
| | | | | | | | We're getting some lockups of netd and this can help point us in the right direction. bug:5864209 Change-Id: Id8bdb0a758c5b161e0143de61b5f39c3a982e329
* Log netd traffic nicely.Robert Greenwalt2012-01-201-4/+18
| | | | | | | | | Create a LocalLog class for logging within a service for dumping in dumps. Use it in the NativeDaemonConnector so we can get some insight into what is happening in these lockups. bug:5864209 Change-Id: I68ddc58847f3c8de613be9528570f8c3157d8274
* Move native netd calls to varargs.Jeff Sharkey2011-12-021-6/+83
| | | | | | | | | Uses argument escaping inside NativeDaemonConnector, using varargs to separate boundaries. Also introduces Command object to help build argument lists. Bug: 5472606 Change-Id: I357979fc19bb0171a056e690064e01b5a7119501
* Move NativeDaemonConnector to varargs.Jeff Sharkey2011-11-291-132/+159
| | | | | | | | | Perform uniform argument escaping inside NativeDaemonConnector, using varargs to separate boundaries. Also move to parsed NativeDaemonEvent instances instead of raw Strings. Bug: 5472606 Change-Id: I1270733e2b2eeb2f6b810240df82ab24d38ebf40
* Validate commands and arguments.Jeff Sharkey2011-10-171-0/+7
| | | | | Bug: 5465176 Change-Id: I9402054c20ea6cae42781c35bfc2ade90aac31ce
* Add NativeDaemonConnector users to watchdog.Jeff Sharkey2011-08-101-34/+38
| | | | | | | | | To catch instances where NativeDaemonConnector hangs while executing commands, add users to system_server watchdog. Also moved qtaguid enabler to separate thread to prevent blocking systemReady(). Bug: 5145437 Change-Id: I4c6c1dc09864a1c05f9486a31faa1b366548e911
* NativeDaemonConnector: offload callbacks to another thread.Chia-chi Yeh2011-08-031-11/+27
| | | | | | | | Now callbacks can communicate to the same daemon without causing a deadlock. This also improves the latency of calls because they no longer need to wait for the callbacks for the pending events. Change-Id: I153fcf16bd64de79ee1c1a57d3cfdb12b354cf47
* am 9204644d: Merge "Fix a race condition in NativeDaemonConnector"Brad Fitzpatrick2011-02-071-1/+2
|\ | | | | | | | | * commit '9204644d9e8fc2a3d05ff386b14b349f7a117694': Fix a race condition in NativeDaemonConnector
| * Fix a race condition in NativeDaemonConnectoranga2011-02-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | Fixes a race between the onDaemonConnected callback and setting the mOutputStream in NativeDaemonConnector. MountService connects to vold using the NativeDaemonConnector. Throws a “NativeDaemonConnectorException: No output stream!” when the onDaemonConnected callback in MountService calls the doListCommand. Change-Id: Ib895bab37f7df680e4362df6366198c0a673c5e9
* | Do not add unsolicited events to queueIrfan Sheriff2011-01-161-5/+7
|/ | | | | | | | | | | Adding unsolicited events to response queue results in doCommand() returning the wrong result. Pulling this change from master. Bug: 3258529 Change-Id: I2a4b0bd8bb30b31682d7d61ee94a0d246bf10de2
* Cleanup Netd to prevent getting hung.Robert Greenwalt2010-09-221-2/+6
| | | | | | | | | | If the sending of the command fails we should note it and not wait forever for the response. We should also not say we're ready until we actually are. bug:2993205 Change-Id: I380f0312ac4693ad184a526b330fdfa23f6ac558
* Fix buffer compacting in NativeDaemonConnectorKenny Root2010-09-021-0/+7
| | | | | | | | The buffer was being compacted in the read loop, but the start offset on the compacted buffer wasn't being considered after the next read. Bug: 2501075 Change-Id: I163297d751cf800d0bbc66df66b1a0fa0785de49
* Add more error checking for ndcKenny Root2010-06-011-6/+5
| | | | | | | | | In NativeDaemonConnector.doCommand() calls, there was inconsistent error checking. This change adds error checking for every call and makes it so that any call to .doCommand() that gets an error code won't cause the code to hang forever. Change-Id: I4584953a759a48ad16adfe8ee9e564b5f5796680
* Compact when NativeDaemonConnector hits buffer limitKenny Root2010-03-221-4/+13
| | | | | | | | If NativeDaemonConnector hits its buffer limit, it would truncate the data and lose some information. This change compacts the buffer and then retries to read the rest of the data. Change-Id: I0d5fee097bdd6808212ef3ad6fb4abbc6310fd4a
* Switch the services library to using the new SlogJoe Onorato2010-03-011-18/+18
|
* NativeDaemonConnector: Improve bad list IPC diagnosticsSan Mehat2010-02-171-2/+6
| | | | Signed-off-by: San Mehat <san@google.com>
* NativeDaemonConnector: Improve error reporting and debug formattingSan Mehat2010-02-081-5/+10
| | | | | | | Updated: NativeDaemonConnector: Put debugging behind a conditional Signed-off-by: San Mehat <san@google.com>
* NativeDaemonConnector: Improve NativeDaemonException reporting to include ↵San Mehat2010-02-031-5/+9
| | | | | | the actual error response Signed-off-by: San Mehat <san@google.com>
* NativeDaemonConnector: Cleanup socket code and use a proper exceptionSan Mehat2010-01-291-31/+28
| | | | Signed-off-by: San Mehat <san@google.com>
* NativeDaemonConnector: fix doListCommand() to return *all* list elementsSan Mehat2010-01-261-5/+1
| | | | Signed-off-by: San Mehat <san@google.com>
* NativeDaemonConnector: Add a convenience method for obtaining listsSan Mehat2010-01-201-0/+37
| | | | Signed-off-by: San Mehat <san@google.com>
* services: Introduce NativeDaemonConnector classSan Mehat2010-01-121-0/+239
This class provides an interface to communicate with native daemons using the libsysutils framework communication code. Signed-off-by: San Mehat <san@google.com> NativeDaemonConnector: fix whitespace Signed-off-by: San Mehat <san@google.com> NativeDaemonConnector: Fix review comments Signed-off-by: San Mehat <san@google.com> NativeDaemonConnector: On an error, re-try the connection Signed-off-by: San Mehat <san@google.com>