summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/NativeDaemonConnector.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-08-23Add a simple test for NetworkManagementService.Lorenzo Colitti
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
2013-06-28am b8292830: resolved conflicts for merge of a920f25f to jb-mr2-dev-plus-aospElliott Hughes
* commit 'b8292830f79fc76ffb9a1be5cd316212ac494d03': Switch frameworks/base over from @hidden Charsets to public StandardCharsets.
2013-06-28resolved conflicts for merge of a920f25f to jb-mr2-dev-plus-aospElliott Hughes
Change-Id: I3349f8d2e6715171e2677c1385122ceb2810c1f6
2013-06-28resolved conflicts for merge of fca0f92e to stage-aosp-masterElliott Hughes
Change-Id: I4791f0ffa324a313b8390fbde6d8f82f716ecf74
2013-06-28Switch frameworks/base over from @hidden Charsets to public StandardCharsets.Elliott Hughes
Bug: 3484927 Change-Id: I5d136d2ee629588538602766a182ae14ce5fc63c
2013-06-10resolved conflicts for merge of e96a8207 to masterKenny Root
Change-Id: I90801b35ed0c00078a47faadc7fbb05d2e5fe381
2013-06-07Avoid logging sensitive data.Jeff Sharkey
When building commands to send across NativeDaemonConnector, scrub sensitive arguments to prevent them from being logged. Bug: 8609800 Change-Id: I84b16791749264a010f7e59f9918f68d71bac6b9
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
2013-02-25Require command and argument separation, cleanup.Jeff Sharkey
When invoking NativeDaemonCommands, require that base command and arguments are separate. Clean up reverse tethering commands, and remove deprecated throttle events. Change-Id: I302a74130b4f7c3f3045815a56d566e89c8969f6
2012-11-12Useful annotations for code documentation.Jeff Sharkey
Bug: 6537978 Change-Id: I806c3c09e3255f8789455f13bf37c1dde2a93f1f
2012-06-07Fix a sync problem in NativeDaemonConnector.Robert Greenwalt
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
2012-05-24Modify logging to debug this issueRobert Greenwalt
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
2012-05-15Add some logging to NDC.Robert Greenwalt
bug:6492166 Change-Id: Ib7c7a0927d3e920f6c041f7252f3f24c8e597bc7
2012-04-20Allow quoted strings from NativeDaemonConnectorRobert Greenwalt
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
2012-03-13Record the trimmed cmd string for logsRobert Greenwalt
The over the wire command includes a \0 that mangles log messages. bug:6149176 Change-Id: I77d4e443f1966bff060f1b97570851f7549fee8e
2012-02-29Make NDC not block forever and handle restart.Robert Greenwalt
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
2012-02-07Revert "Make NDC not block forever and handle restart."Guang Zhu
Reverting because it seems to break `adb reboot` This reverts commit 813af8d46467f41ed2d492917cbb9f9f45d2a3d7. Change-Id: I75d827664a08799de15369c24c84cc3f49a8f297
2012-02-07Make NDC not block forever and handle restart.Robert Greenwalt
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
2012-02-02Add some logging to NDC.Robert Greenwalt
We're getting some lockups of netd and this can help point us in the right direction. bug:5864209 Change-Id: Id8bdb0a758c5b161e0143de61b5f39c3a982e329
2012-01-20Log netd traffic nicely.Robert Greenwalt
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
2011-12-02Move native netd calls to varargs.Jeff Sharkey
Uses argument escaping inside NativeDaemonConnector, using varargs to separate boundaries. Also introduces Command object to help build argument lists. Bug: 5472606 Change-Id: I357979fc19bb0171a056e690064e01b5a7119501
2011-11-29Move NativeDaemonConnector to varargs.Jeff Sharkey
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
2011-10-17Validate commands and arguments.Jeff Sharkey
Bug: 5465176 Change-Id: I9402054c20ea6cae42781c35bfc2ade90aac31ce
2011-08-10Add NativeDaemonConnector users to watchdog.Jeff Sharkey
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
2011-08-03NativeDaemonConnector: offload callbacks to another thread.Chia-chi Yeh
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
2011-02-07am 9204644d: Merge "Fix a race condition in NativeDaemonConnector"Brad Fitzpatrick
* commit '9204644d9e8fc2a3d05ff386b14b349f7a117694': Fix a race condition in NativeDaemonConnector
2011-02-07Fix a race condition in NativeDaemonConnectoranga
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
2011-01-16Do not add unsolicited events to queueIrfan Sheriff
Adding unsolicited events to response queue results in doCommand() returning the wrong result. Pulling this change from master. Bug: 3258529 Change-Id: I2a4b0bd8bb30b31682d7d61ee94a0d246bf10de2
2010-09-22Cleanup Netd to prevent getting hung.Robert Greenwalt
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
2010-09-02Fix buffer compacting in NativeDaemonConnectorKenny Root
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
2010-06-01Add more error checking for ndcKenny Root
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
2010-03-22Compact when NativeDaemonConnector hits buffer limitKenny Root
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
2010-03-01Switch the services library to using the new SlogJoe Onorato
2010-02-17NativeDaemonConnector: Improve bad list IPC diagnosticsSan Mehat
Signed-off-by: San Mehat <san@google.com>
2010-02-08NativeDaemonConnector: Improve error reporting and debug formattingSan Mehat
Updated: NativeDaemonConnector: Put debugging behind a conditional Signed-off-by: San Mehat <san@google.com>
2010-02-03NativeDaemonConnector: Improve NativeDaemonException reporting to include ↵San Mehat
the actual error response Signed-off-by: San Mehat <san@google.com>
2010-01-29NativeDaemonConnector: Cleanup socket code and use a proper exceptionSan Mehat
Signed-off-by: San Mehat <san@google.com>
2010-01-26NativeDaemonConnector: fix doListCommand() to return *all* list elementsSan Mehat
Signed-off-by: San Mehat <san@google.com>
2010-01-20NativeDaemonConnector: Add a convenience method for obtaining listsSan Mehat
Signed-off-by: San Mehat <san@google.com>
2010-01-12services: Introduce NativeDaemonConnector classSan Mehat
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>