Permalink
Browse files

eclair snapshot

  • Loading branch information...
1 parent 85b3fcc commit 4b29fe640ae852c04d5d87d0f9527bdc32177ad1 Jean-Baptiste Queru committed Nov 13, 2009
Showing with 17,392 additions and 1,598 deletions.
  1. +1 −0 .gitignore
  2. 0 adb/MODULE_LICENSE_APACHE2
  3. +191 −0 adb/NOTICE
  4. +72 −6 adb/adb.c
  5. +16 −7 adb/adb.h
  6. +32 −29 adb/commandline.c
  7. +53 −17 adb/framebuffer_service.c
  8. +0 −1 adb/get_my_path_darwin.c
  9. +1 −1 adb/jdwp_service.c
  10. +66 −86 adb/services.c
  11. +8 −0 adb/sysdeps.h
  12. +14 −0 adb/sysdeps_win32.c
  13. +87 −31 adb/transport.c
  14. +11 −9 adb/transport_local.c
  15. +2 −2 adb/transport_usb.c
  16. +96 −91 adb/usb_linux.c
  17. +1 −1 adb/usb_linux_client.c
  18. +49 −25 adb/usb_osx.c
  19. +12 −0 adb/usb_vendors.c
  20. +1 −1 adb/usb_windows.c
  21. +95 −105 debuggerd/debuggerd.c
  22. +4 −2 fastboot/fastboot.c
  23. +17 −11 fastboot/usb_linux.c
  24. +0 −1 fastboot/util_osx.c
  25. +92 −0 include/acc/acc.h
  26. +16 −3 include/arch/darwin-x86/AndroidConfig.h
  27. +332 −0 include/arch/freebsd-x86/AndroidConfig.h
  28. +15 −0 include/arch/linux-arm/AndroidConfig.h
  29. +15 −0 include/arch/linux-x86/AndroidConfig.h
  30. +15 −0 include/arch/target_linux-x86/AndroidConfig.h
  31. +15 −0 include/arch/windows/AndroidConfig.h
  32. +103 −0 include/cutils/abort_socket.h
  33. +2 −0 include/cutils/ashmem.h
  34. +32 −0 include/cutils/compiler.h
  35. +36 −0 include/cutils/sched_policy.h
  36. +7 −0 include/cutils/tztime.h
  37. +17 −10 include/mincrypt/sha.h
  38. +2 −2 include/private/android_filesystem_config.h
  39. +1 −1 include/private/pixelflinger/ggl_context.h
  40. +1 −1 include/sysutils/SocketListener.h
  41. +125 −7 init/builtins.c
  42. +27 −3 init/devices.c
  43. +5 −3 init/init.c
  44. +2 −0 init/keywords.h
  45. +1 −0 init/parser.c
  46. +43 −35 init/property_service.c
  47. +31 −0 libacc/Android.mk
  48. +83 −0 libacc/FEATURES
  49. +21 −0 libacc/LICENSE
  50. 0 libacc/MODULE_LICENSE_BSD_LIKE
  51. +6,241 −0 libacc/acc.cpp
  52. +2 −0 libacc/tests/.gitignore
  53. +66 −0 libacc/tests/Android.mk
  54. +69 −0 libacc/tests/accarm
  55. +300 −0 libacc/tests/armreg.h
  56. +31 −0 libacc/tests/data/addressOf.c
  57. +107 −0 libacc/tests/data/array.c
  58. +9 −0 libacc/tests/data/assignment.c
  59. +62 −0 libacc/tests/data/assignmentop.c
  60. +9 −0 libacc/tests/data/b2071670.c
  61. +126 −0 libacc/tests/data/bellard.otccex.c
  62. +61 −0 libacc/tests/data/brackets.c
  63. +85 −0 libacc/tests/data/casts.c
  64. +13 −0 libacc/tests/data/char.c
  65. +35 −0 libacc/tests/data/comma.c
  66. +30 −0 libacc/tests/data/constants.c
  67. +9 −0 libacc/tests/data/defines.c
  68. +7 −0 libacc/tests/data/double.c
  69. +2 −0 libacc/tests/data/error.c
  70. +60 −0 libacc/tests/data/expr-ansi.c
  71. +60 −0 libacc/tests/data/expr.c
  72. +6 −0 libacc/tests/data/expr2.c
  73. +53 −0 libacc/tests/data/film.c
  74. +57 −0 libacc/tests/data/float.c
  75. +9 −0 libacc/tests/data/floatdouble.c
  76. +158 −0 libacc/tests/data/flops.c
  77. +8 −0 libacc/tests/data/funcargs.c
  78. +3 −0 libacc/tests/data/hello.c
  79. +14 −0 libacc/tests/data/inc.c
  80. +23 −0 libacc/tests/data/iops.c
  81. +71 −0 libacc/tests/data/locals.c
  82. +4 −0 libacc/tests/data/missing-main.c
  83. +466 −0 libacc/tests/data/otcc-ansi.c
  84. +446 −0 libacc/tests/data/otcc-noinclude.c
  85. +448 −0 libacc/tests/data/otcc.c
  86. +15 −0 libacc/tests/data/pointers.c
  87. +35 −0 libacc/tests/data/pointers2.c
  88. +8 −0 libacc/tests/data/returnval-ansi.c
  89. +4 −0 libacc/tests/data/returnval.c
  90. +9 −0 libacc/tests/data/rollo3.c
  91. +6 −0 libacc/tests/data/short.c
  92. +1 −0 libacc/tests/data/simplest.c
  93. +95 −0 libacc/tests/data/structs.c
  94. +4 −0 libacc/tests/data/testStringConcat.c
  95. +711 −0 libacc/tests/disassem.cpp
  96. +65 −0 libacc/tests/disassem.h
  97. +207 −0 libacc/tests/main.cpp
  98. +118 −0 libacc/tests/runtimeTest.cpp
  99. +6 −0 libacc/tests/test
  100. +493 −0 libacc/tests/test.py
  101. +17 −10 libcutils/Android.mk
  102. +293 −0 libcutils/abort_socket.c
  103. +20 −17 libcutils/atomic-android-arm.S
  104. +2 −5 libcutils/atomic-android-armv6.S
  105. +14 −1 libcutils/process_name.c
  106. +221 −0 libcutils/sched_policy.c
  107. +86 −22 libcutils/strdup16to8.c
  108. +53 −18 libcutils/tztime.c
  109. +1 −5 liblog/logd_write.c
  110. +0 −1 liblog/logprint.c
  111. +179 −14 libmincrypt/sha.c
  112. +10 −0 libnetutils/ifc_utils.c
  113. +2 −0 libpixelflinger/Android.mk
  114. +1 −11 libpixelflinger/codeflinger/blending.cpp
  115. +48 −17 libpixelflinger/t32cb16blend.S
  116. +67 −14 libsysutils/src/FrameworkListener.cpp
  117. +36 −2 libsysutils/src/SocketListener.cpp
  118. +7 −10 libzipfile/centraldir.c
  119. +4 −4 libzipfile/zipfile.c
  120. +101 −57 logcat/event-log-tags
  121. +13 −11 nexus/Android.mk
  122. +23 −19 nexus/CommandListener.cpp
  123. +1 −12 nexus/Controller.cpp
  124. +2 −7 nexus/Controller.h
  125. +65 −10 nexus/DhcpClient.cpp
  126. +14 −1 nexus/DhcpClient.h
  127. +56 −0 nexus/DhcpEvent.cpp
  128. +11 −11 nexus/{IPropertyProvider.h → DhcpEvent.h}
  129. +77 −3 nexus/DhcpListener.cpp
  130. +3 −1 nexus/DhcpListener.h
  131. +80 −0 nexus/DhcpState.cpp
  132. +17 −5 nexus/DhcpState.h
  133. +5 −2 nexus/IControllerHandler.h
  134. +8 −0 nexus/IDhcpEventHandlers.h
  135. +1 −0 nexus/ISupplicantEventHandler.h
  136. +26 −0 nexus/IWifiStatusPollerHandler.h
  137. +47 −122 nexus/InterfaceConfig.cpp
  138. +34 −29 nexus/InterfaceConfig.h
  139. +1 −10 nexus/LoopController.cpp
  140. +118 −34 nexus/NetworkManager.cpp
  141. +38 −7 nexus/NetworkManager.h
  142. +203 −0 nexus/Property.cpp
  143. +117 −1 nexus/Property.h
  144. +203 −46 nexus/PropertyManager.cpp
  145. +14 −22 nexus/PropertyManager.h
  146. +8 −3 nexus/{ErrorCode.h → ResponseCode.h}
  147. +232 −26 nexus/Supplicant.cpp
  148. +17 −2 nexus/Supplicant.h
  149. +10 −10 nexus/SupplicantState.cpp
  150. +29 −11 nexus/TiwlanWifiController.cpp
  151. +46 −36 nexus/VpnController.cpp
  152. +53 −5 nexus/VpnController.h
  153. +468 −62 nexus/WifiController.cpp
  154. +198 −25 nexus/WifiController.h
  155. +605 −271 nexus/WifiNetwork.cpp
  156. +173 −29 nexus/WifiNetwork.h
  157. +104 −0 nexus/WifiStatusPoller.cpp
  158. +47 −0 nexus/WifiStatusPoller.h
  159. +15 −2 rootdir/Android.mk
  160. +10 −0 rootdir/etc/vold.conf
  161. +60 −7 rootdir/init.rc
  162. +56 −21 toolbox/ls.c
  163. +5 −2 toolbox/mount.c
  164. +23 −3 toolbox/ps.c
  165. +1 −0 toolbox/smd.c
  166. +28 −6 toolbox/top.c
  167. +7 −1 vold/blkdev.c
  168. +12 −10 vold/format.c
  169. +6 −0 vold/media.h
  170. +1 −1 vold/mmc.c
  171. +4 −1 vold/uevent.c
  172. +17 −5 vold/volmgr.c
  173. +23 −7 vold/volmgr_vfat.c
View
@@ -0,0 +1 @@
+*~
No changes.
View
@@ -0,0 +1,191 @@
+
+ Copyright (c) 2006-2009, The Android Open Source Project
+ Copyright 2006, Brian Swetland <swetland@frotz.net>
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
View
@@ -832,6 +832,7 @@ int adb_main(int is_daemon)
{
#if !ADB_HOST
int secure = 0;
+ int port;
char value[PROPERTY_VALUE_MAX];
#endif
@@ -850,7 +851,7 @@ int adb_main(int is_daemon)
HOST = 1;
usb_vendors_init();
usb_init();
- local_init();
+ local_init(ADB_LOCAL_TRANSPORT_PORT);
if(install_listener("tcp:5037", "*smartsocket*", NULL)) {
exit(1);
@@ -918,14 +919,19 @@ int adb_main(int is_daemon)
}
/* for the device, start the usb transport if the
- ** android usb device exists, otherwise start the
- ** network transport.
+ ** android usb device exists and "service.adb.tcp"
+ ** is not set, otherwise start the network transport.
*/
- if(access("/dev/android_adb", F_OK) == 0 ||
- access("/dev/android", F_OK) == 0) {
+ property_get("service.adb.tcp.port", value, "0");
+ if (sscanf(value, "%d", &port) == 1 && port > 0) {
+ // listen on TCP port specified by service.adb.tcp.port property
+ local_init(port);
+ } else if (access("/dev/android_adb", F_OK) == 0) {
+ // listen on USB
usb_init();
} else {
- local_init();
+ // listen on default port
+ local_init(ADB_LOCAL_TRANSPORT_PORT);
}
init_jdwp();
#endif
@@ -1006,6 +1012,66 @@ int handle_host_request(char *service, transport_type ttype, char* serial, int r
return 0;
}
+ // add a new TCP transport
+ if (!strncmp(service, "connect:", 8)) {
+ char buffer[4096];
+ int port, fd;
+ char* host = service + 8;
+ char* portstr = strchr(host, ':');
+
+ if (!portstr) {
+ snprintf(buffer, sizeof(buffer), "unable to parse %s as <host>:<port>", host);
+ goto done;
+ }
+ if (find_transport(host)) {
+ snprintf(buffer, sizeof(buffer), "Already connected to %s", host);
+ goto done;
+ }
+
+ // zero terminate host by overwriting the ':'
+ *portstr++ = 0;
+ if (sscanf(portstr, "%d", &port) == 0) {
+ snprintf(buffer, sizeof(buffer), "bad port number %s", portstr);
+ goto done;
+ }
+
+ fd = socket_network_client(host, port, SOCK_STREAM);
+ if (fd < 0) {
+ snprintf(buffer, sizeof(buffer), "unable to connect to %s:%d", host, port);
+ goto done;
+ }
+
+ D("client: connected on remote on fd %d\n", fd);
+ close_on_exec(fd);
+ disable_tcp_nagle(fd);
+ snprintf(buf, sizeof buf, "%s:%d", host, port);
+ register_socket_transport(fd, buf, port, 0);
+ snprintf(buffer, sizeof(buffer), "connected to %s:%d", host, port);
+
+done:
+ snprintf(buf, sizeof(buf), "OKAY%04x%s",(unsigned)strlen(buffer), buffer);
+ writex(reply_fd, buf, strlen(buf));
+ return 0;
+ }
+
+ // remove TCP transport
+ if (!strncmp(service, "disconnect:", 11)) {
+ char buffer[4096];
+ memset(buffer, 0, sizeof(buffer));
+ char* serial = service + 11;
+ atransport *t = find_transport(serial);
+
+ if (t) {
+ unregister_transport(t);
+ } else {
+ snprintf(buffer, sizeof(buffer), "No such device %s", serial);
+ }
+
+ snprintf(buf, sizeof(buf), "OKAY%04x%s",(unsigned)strlen(buffer), buffer);
+ writex(reply_fd, buf, strlen(buf));
+ return 0;
+ }
+
// returns our value for ADB_SERVER_VERSION
if (!strcmp(service, "version")) {
char version[12];
View
@@ -33,7 +33,7 @@
#define ADB_VERSION_MAJOR 1 // Used for help/version information
#define ADB_VERSION_MINOR 0 // Used for help/version information
-#define ADB_SERVER_VERSION 22 // Increment this when we want to force users to start a new adb server
+#define ADB_SERVER_VERSION 25 // Increment this when we want to force users to start a new adb server
typedef struct amessage amessage;
typedef struct apacket apacket;
@@ -262,15 +262,24 @@ void run_transport_disconnects( atransport* t );
void kick_transport( atransport* t );
/* initialize a transport object's func pointers and state */
-int init_socket_transport(atransport *t, int s, int port);
-void init_usb_transport(atransport *t, usb_handle *usb);
+int init_socket_transport(atransport *t, int s, int port, int local);
+void init_usb_transport(atransport *t, usb_handle *usb, int state);
/* for MacOS X cleanup */
void close_usb_devices();
/* cause new transports to be init'd and added to the list */
-void register_socket_transport(int s, const char *serial, int port);
-void register_usb_transport(usb_handle *h, const char *serial);
+void register_socket_transport(int s, const char *serial, int port, int local);
+
+/* this should only be used for the "adb disconnect" command */
+void unregister_transport(atransport *t);
+
+void register_usb_transport(usb_handle *h, const char *serial, unsigned writeable);
+
+/* this should only be used for transports with connection_state == CS_NOPERM */
+void unregister_usb_transport(usb_handle *usb);
+
+atransport *find_transport(const char *serial);
int service_to_fd(const char *name);
#if ADB_HOST
@@ -357,7 +366,7 @@ typedef enum {
#define ADB_PROTOCOL 0x1
-void local_init();
+void local_init(int port);
int local_connect(int port);
/* usb host/client interface */
@@ -384,7 +393,7 @@ int connection_state(atransport *t);
#define CS_DEVICE 2
#define CS_HOST 3
#define CS_RECOVERY 4
-#define CS_ERROR 5
+#define CS_NOPERM 5 /* Insufficient permissions to communicate with the device */
extern int HOST;
Oops, something went wrong.

0 comments on commit 4b29fe6

Please sign in to comment.