aboutsummaryrefslogtreecommitdiffstats
path: root/android/utils
Commit message (Collapse)AuthorAgeFilesLines
* Fixed emulator fails to load lib*GL when launched from its own directoryAndrew Hsieh2012-05-021-1/+5
| | | | | | | | | When emulator is lunched from its own directory (ie. cd out/*/bin; ./emulator), emulator fails to locate shared libraries lib*GL at out/*/lib because utility function path_parent(".", 1) incorrectly returns NULL instead of "..". Fixed that case. Change-Id: I86f8e5d655107ae8cd2237d59518180ce6e69c53
* Enable multi-touch emulation with -gpu onVladimir Chtchetkine2012-04-112-6/+22
| | | | | | | | | | | | | | | | This CL implements a callback that gets invoked by OpenGLES emulator on it framebuffer updates. This allows transferring framebuffer changes to the supporting device. Proper implementation of this new callback also required changes to JPEG compression, addressing: 1. OpenGLES framebuffer format is RGBA8889, which required implementing line conversion for this format. 2. OpenGLES framebuffer is (or at least could be) bottom-up arranged. This requires changes to the compressor, so it compresses the FB starting from the bottom, so the resulting image is up-bottom. Change-Id: Icd4efbe4a251c838adfa3518decbfc43a7ef06c8
* Implements SDKCtlSocket that implements communication protocol wih SdkControllerVladimir Chtchetkine2012-04-061-0/+1
| | | | | | | In addition, this CL contains some minor tweaks to async-socket, and async-socket-connector that improve tracebility. Change-Id: Ib1309b19dcd02e96379155fea7015019d93160e7
* Implements asynchronous socket APIVladimir Chtchetkine2012-03-291-0/+1
| | | | | | | | | | | This is pretty basic API that allows to asynchronously connect to a socket, and perform asynchronous read from / write to the connected socket. Since all the operations (including connection) are asynchronous, all the operation results are reported back to the client of this API via set of callbacks that client supplied to this API. Change-Id: I2a18f5b9c575ab7825c9e5a086f4cd9fb6b130ec
* Implements an asynchronous socket connector with retriesVladimir Chtchetkine2012-03-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The typical usage of the API is as such: 1. The client creates an async connector instance by calling async_socket_connector_new routine, supplying there address of the socket to connect, and a callback to invoke on connection events. 2. The client then proceeds with calling async_socket_connector_connect that would initiate connection attempts. The main job on the client side falls on the client's callback routine that serves the connection events. Once connection has been initiated, the connector will invoke that callback to report current connection status. In general, there are three connection events passed to the callback: 1. Success. 2. Failure. 3. Retry. Typically, when client's callback is called for successful connection, the client will pull connected socket's FD from the connector, and then this FD will be used by the client for I/O on the connected socket. If socket's FD is pulled by the client, it must return ASC_CB_KEEP from the callback. When client's callback is invoked with an error (ASC_CONNECTION_FAILED event), the client has an opportunity to review the error (available in 'errno'), and either abort the connection by returning ASC_CB_ABORT, or schedule a retry by returning ASC_CB_RETRY from the callback. If client returns ASC_CB_ABORT from the callback, the connector will stop connection attempts, and will self-destruct. If ASC_CB_RETRY is returned from the callback, the connector will retry connection attempt after timeout that was set by the caller in the call to async_socket_connector_new routine. When client's callback is invoked with ASC_CONNECTION_RETRY, the client has an opportunity to cancel further connection attempts by returning ASC_CB_ABORT, or it can allow another connection attempt by returning ASC_CB_RETRY. The client has no control over the lifespan of initialized connector instance. It always self-destructs after client's cllback returns with a status other than ASC_CB_RETRY. Change-Id: I39b0057013e45ee10d1ef98905b8a5210656a26c
* 64-bit emulatorAndrew Hsieh2012-03-132-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch to allow emulator searches for emulator64-${ARCH} first on 64-bit OS. If none is found, the original behavior which searchs for 32-bit emulator-${ARCH} is performed as usual. 64-bit emulator (which still emulates Android built in 32-bit) offers up to 20% speedup compared to its 32-bit counterpart. Details: android/main-emulator.c 1) search emulator64 based on the OS 2) dlopen lib64OpenglRender in 64-bit Makefile.* 1) Rules to build 64-bit executable emulator64-{x86,arm} and libraries emulator64-{libui,libqemu,target-i386,target-arm,libelff,common} 2) remove -Wa,-32 3) Changes prebuit toolchain path android-configure.h android/build/common.h 1) no longer force 32-bit build (because now prebuilts/tools/gcc-sdk/gcc can now handle 64-bit 2) set ANDROID_PREBUILTS to correctly locate ccache android/config/*/config-host.h 1) Detect HOST_X86_64 and HOST_X86_64/HOST_I386 Misc 64-bit porting clean-up 1) use %zx to print variable of type size_t in hex 2) use %zu to print variable of type size_t in dec 3) Initialize query_parm to NULL 4) use PRIu64 to replace PDUd64 5) use PRId64/PRIu64/PRIX64 to print 64-bit 6) drop PRUx64 because PRIx64 does the same 7) cast pointer arith to intptr_t before casting to int 8) fixed 1ULL<<63 Change-Id: Ife62a20063a6ec38d4a9b23977e840af1fce149a
* Multi-touch emulation supportVladimir Chtchetkine2012-03-053-0/+292
| | | | Change-Id: I311dc55fe10f41637775baa330a7c732ff317f51
* Enables ADBD tracing in emulator.Vladimir Chtchetkine2012-02-271-0/+1
| | | | | | | | | | When running inside the emulator, guest's adbd can connect to 'adb-debug' qemud service that can display adb trace messages on condition that emulator has been started with '-debug adb' option. This CL contains emulator code that enables that. Change-Id: I6720deef0833fd02e2fe80deeaafbcf517de0c33
* Refactor camera parameters parsing routinesVladimir Chtchetkine2012-01-232-0/+177
| | | | | | | | | | Move routines that pulls values out of the parameter string from camera-service.c to misc.c Those are general purpose routines that are also used in multitouch emulation, so it's better to keep it an an general utility file. Change-Id: I02978075b64b42ff07f5042cda770bbef8939e24
* Respect HW configs when loading VM from snapshots.Vladimir Chtchetkine2012-01-132-7/+63
| | | | | | | | | | | | | | Changing HW configuration properties may cause emulator / guest system crash on condition that VM has been loaded from a snapshot. This CL addresses this issue in the following way: 1. Each time a snapshot is saved, a backup copy of HW config is saved with it. 2. Each time a snapshot is loaded, emulator finds an appropriate HW config backup, and compares current HW config with the one that was saved in the backup, and if configs are different, emulator exits with an appropriate error. Change-Id: I730bec0afbe166e88189fdcc4804b76e109e4422
* Implement ADB communication over QEMU pipeVladimir Chtchetkine2011-12-131-0/+2
| | | | Change-Id: I62ff5898c7a955aaaa8af8f7ee7ed018af860f80
* Implements double-linked circular list.Vladimir Chtchetkine2011-12-081-0/+112
| | | | | | | This is part of a bigger CL (coming later this week) that uses qemu pipes to hook up host ADB with ADBD daemon running on the guest system. Change-Id: I625b020531af636b9b9fa4e4aa52b7586749c693
* Implements sensors emulation using a connected Android deviceVladimir Chtchetkine2011-11-091-0/+2
| | | | | | | | | | | | | | There are three major things in this CL: 1. Abstract a connection with an Android device that is connected to the host via USB, and there is a TCP port forwarding to this device via 'adb forward' command. This abstraction is implemented in android/android-device.* 2. A client for android device API that talks to an app on the connected device that provides values for sensors available on the device. This is implemented in android/sensors-port.* 3. Changes to the sensor emulation code in android/hw-sensors.c to use sensors port (when available) for sensors emulation. Change-Id: I12901e8db6b6a6262fc1703ed96a9f714335d666
* Add hw.gpu.enabled hardware propertyDavid 'Digit' Turner2011-08-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new hardware property to enable GPU emulation (named hw.gpu.enabled). It is currently disabled by default. It also modifies the UI code to display the GL output properly inside the UI window. And sets the kernel parameter qemu.gles to either 0 or 1 to indicate to the guest system's GLES libraries whether to use GPU emulation or fallback to the software renderer. A future patch will also add auto-detection of desktop GL capabilities. For example, if the emulator is started on a headless server without an X11/GL display, hw.gpu.enabled will be forced to 'no', forcing the guest to use the software renderer. Another patch will allow to change the property from the command-line for debugging purpose. NOTE: If you want to test GPU emulation, change the default value of the property in android/avd/hardware-properties.ini from 'no' to 'yes'. You will need to run a ToT master AOSP tree with the following pending patches applied: https://review.source.android.com/25797 https://review.source.android.com/25154 https://review.source.android.com/25759 Change-Id: I1fa3512be24395244fd5068f2bf59ad54db5c7d5
* Add DLL-loading head <android/utils/dll.h>David 'Digit' Turner2011-08-244-0/+299
| | | | | | | | This patch adds several functions to make loading shared libraries dynamically easier. This will be used to load the GLES emulation libraries. Change-Id: Ib401af339530bc647bfa86fb23a2840fe0a201dd
* Video capturing code for Linux, and WindowsVladimir Chtchetkine2011-08-181-0/+1
| | | | | | | Contains API that connects to a camera device, and pulls video frames from it on request from the client. Change-Id: If1d80c57611afff637a7734ce5c3a2c874cfc85a
* Fix -audio <name> and -no-audio processing.David 'Digit' Turner2011-06-271-0/+18
| | | | | | | | | Turns out that the string passed to putenv() must not be modified :-/ We provide our own win32 implementation for emulator-ui that doesn't embed the os-win32.c QEMU-specific file. Change-Id: I7260fbc37d23a5340dab589dfde577ef5eb10005
* Dump hardware config. with -verbose option.David 'Digit' Turner2011-05-142-0/+300
| | | | | | | | | | | This patch dumps the content of the hardware configuration file when the -verbose option (or equivalent -debug-init) is used. This is useful to determine exactly what is launched when debugging emulator issues. Change-Id: I101b87cddb12c603b43420ea72bb357fc33f327d
* Merge "Add 'emulator' launcher program."David 'Digit' Turner2011-05-032-4/+91
|\
| * Add 'emulator' launcher program.David 'Digit' Turner2011-05-022-4/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch renames the current ARM-specific emulator binary to 'emulator-arm' and introduces a new tiny (less than 20KB) 'emulator' launcher program. The role of 'emulator' is to launch either 'emulator-arm' or 'emulator-x86' based on the target AVD or platform build being used. This program will be replaced in the future by what is currently known as 'emulator-ui', but is a good placeholder until this work is completed. + Move some utility functions from android/avd/info.[hc] to android/avd/util.[hc] so that 'emulator' can use them directly. IMPORTANT: For platform builds, the target architecture is detected automatically by parsing the build.prop file. For SDK AVDs however, there is no easy way to determine the target architecture, so the patch adds a new hw.cpu.arch property which can have value 'arm' or 'x86' Change-Id: I0084c196695a75c8b9230ba716b3cd2e12610ded
* | Use user-specific directory for temporary files.David 'Digit' Turner2011-05-021-2/+8
|/ | | | | | | Instead of use /tmp/android/, use /tmp/android-$USER/ so that several users can run the emulator easily on the same system. Change-Id: Ifda1b773cc87a9e0d4ff7e256b74a3f93377d73a
* <android/utils/assert.h>: Small refactoringDavid 'Digit' Turner2011-04-111-23/+73
| | | | Change-Id: If69874ace211e043d82ffd8349f54396fd334e94
* Add <android/utils/intmap.h> which implements an integer-keyed map of pointers.David 'Digit' Turner2011-04-112-0/+333
| | | | This will be used later to support QEMUD fast pipes.
* Fix write of disk sizes in ini files.David 'Digit' Turner2011-03-151-11/+14
| | | | | | | | The old implementation always expressed the size as multiples of kilobytes due to an improper order to size checks. For example, 66MB was written as '67584k' instead of '66m', which is correct but sub-optimal. Change-Id: I6365bf4c269ed7d213043182a8ae501713798b8f
* Move some serial ports initialization to the core.David 'Digit' Turner2011-03-012-1/+40
| | | | | | | | | | | This moves the initialization of the ports used by qemud and the "kmsg" component to the core. + Gets rid of the -old-system option used to suppot pre-1.4 Android system. We don't officially support anything before 1.5 anyway. Change-Id: Ied7e284d952adfd3419d96c39a7c48761f1b3f5c
* Minor cleanups for core/ui Makefile separation.David 'Digit' Turner2011-02-231-0/+6
| | | | | | | | | | | | | | | | This patch contains minor cleanups that will be needed by a few future patches that will improve the way core and ui sources are separated and built. - remove a few compiler warnings - formatting - remove the memcheck CONFIG_MEMCHECK checks (they later get in the way) - refine hw/hw.h inclusion's of cpu.h (this comes from upstream) - add missing definitions for PRUd64 and PRUx64 (used later) - remove CONFIG_SHAPER test, replace with CONFIG_ANDROID instead. - add missing strdup() calls. Change-Id: Ic7d6681a51af718c298f0ee4bd884b1d8750f28e
* Add hw.keyboard.lidDavid 'Digit' Turner2011-02-102-9/+9
| | | | | | | | | | | This is used to control the lid switch virtual device. + Add support for a "version <number>" field to the skin format. This will later be used for skin format #3. + Fix a bug where string hw properties didn't work/compile Change-Id: I678a0988d2cd24169dd0c2ece96e7ab0b2822104
* Revert "Build arm and x86 binaries at the same time."Xavier Ducrohet2011-02-091-6/+0
| | | | | | This fails to build on MacOS X This reverts commit a39b10bd2574825a815d6ad854499dd127cfa9cb.
* Build arm and x86 binaries at the same time.David 'Digit' Turner2011-02-101-0/+6
| | | | Change-Id: I105c5a097c988cb964b47b40b71c7a08af0d9210
* Generate temporary hardware.ini from configuration settings.David 'Digit' Turner2011-02-013-41/+134
| | | | | | | | | This patch generates a temporary hardware.ini from the hardware configuration. The idea is to move as much hw config info as possible to a single file that the core can read. Other patches will change how various config info is passed to the core, from command-line options to the generated hardware.ini.
* Sligh speedup for pixel conversion routines with Duff's device.David 'Digit' Turner2011-01-181-0/+71
| | | | Change-Id: If832bc5844945f7a2027b2f8d09393586545d8d5
* Allow safe deletion during iteration of an ARefSet.David 'Digit' Turner2010-11-182-11/+51
| | | | | | | + make AREFSET_FOREACH take the name of an existing type variable which avoids an annoying type-cast in each statement. Change-Id: Icf9d886601a9876fa29c15eb0e60a9bf6c8ec163
* Implementation of event loop abstraction.David 'Digit' Turner2010-11-182-0/+11
| | | | | | | | | | | | | | | This patch adds "android/looper.h" which provides an abstraction for event loops: - android/looper-qemu.c implements it on top of the QEMU main event loop. - android/looper-generic.c implements it on top of an IoLooper object. The main idea is to move the UI-related code to use the abstraction to handle timers and asynchronous (network) i/o. NOTE: Code compiles but has not been heavily tested. Change-Id: Ib6820c1b9a9950dc22449a332bc1b066a07af203
* Merge "Update android/utils/ with misc. new features."David 'Digit' Turner2010-11-1812-126/+925
|\
| * Update android/utils/ with misc. new features.David 'Digit' Turner2010-11-1712-126/+925
| | | | | | | | | | | | | | | | | | | | | | | | This introduces a few new features to android/utils/ that will be used in later patches. + <android/utils/assert.h> to handle assertions + <android/utils/vector.h> to handle dynamic arrays + <android/utils/reflist.h> slightly updated (more docs) + <android/utils/refset.h> implements a set of pointers Change-Id: Iebc14cfefd1c0e8aaecda9958a980d40f0be610a
* | Add env var ANDROID_TMP to override /tmp/android location.Raphael2010-11-161-1/+4
|/ | | | | | | | | | | | This is needed if there's already a /tmp/android which the current user can't access on the system. It would prevent the emulator from starting with a cryptic error message: NAND: could not create temp file for system NAND disk image: Permission deniedemulator: User-config was not changed. SDK Bug: 3154431 Change-Id: Iefe7fd6a5139da545aaef5670fb7f42d210d0edc
* Fix linux-x86_64 build.David 'Digit' Turner2010-10-214-8/+8
| | | | | | | | | Fix various 64-bitness issues in the source code to make the --try-64 option work again on Linux. Note that the generated binary is not faster than its 32-bit variant when it comes to benchmarking the boot sequence. Change-Id: Iad248e033757d4cd25524a438a5dbe1cf3aca6cf
* emulator-ui: Remove dependencies from qemu sources.David 'Digit' Turner2010-10-193-6/+7
| | | | | | This change removes some QEMU-specifics that crept into the UI code. Change-Id: Ib1974dc64e54a35dc0cd01aec1eb547a9263a0c8
* Remove compiler warnings when building the emulator.David 'Digit' Turner2010-09-222-6/+7
| | | | | | | This forces -Wall during the build. Note that this patch doesn't remove all warnings, but most of the remaining ones are from upstream anyway. Change-Id: I8808d8495e99866e156ce5780d2e3c305eab491f
* Changes to build Windows emulator under Linux/MinGWRaphael2010-04-141-1/+1
| | | | | | | | - Linux being case-sensitve, include "windows.h" instead of "Windows.h" is important. - Use MinGW's windres. - No pthread needed. Change-Id: Ib4ce944bb55a8b1d870e230f269c89cb7df0b3f2
* Move file I/O out of ELFF, abstracting them in platform-independent fasion.Vladimir Chtchetkine2010-03-252-0/+383
| | | | Change-Id: Ie8800dc96db810e352618bfea8243ab008ae9d2c
* Merge memory checking from sandboxVladimir Chtchetkine2010-02-182-1/+4
| | | | Change-id: Ibce845d0
* am e3c94626: am 39fd8497: Add two documentation files describing the format ↵David 'Digit' Turner2009-12-091-31/+1
|\ | | | | | | | | | | | | | | | | of config and skin files. Merge commit 'e3c94626074fd1331d1821fed5db043f6da02d2a' into eclair-mr2-plus-aosp * commit 'e3c94626074fd1331d1821fed5db043f6da02d2a': Add two documentation files describing the format of config and skin files.
| * Add two documentation files describing the format of config and skin files.David 'Digit' Turner2009-12-071-31/+1
| |
* | Allowed building on FreeBSD same timezone related code as for Linux.Alexey Tarasov2009-09-081-2/+2
|/
* Fix ANDROID_SDK_HOME handling on Unix (the env. var was ignored)David 'Digit' Turner2009-07-241-1/+3
| | | | | | | | Bump version number to 1.11 in android/android.h Update CHANGES.TXT to reflect SDK 1.5_r3 changes Update some comments in android/boot-properties.[hc] Add a --debug option to android-configure.sh (and android-rebuild.sh) to build a unoptimized debug version of the standalone emulator binary.
* Add our modified SDL sources under distrib/sdl-1.2.12David 'Digit' Turner2009-06-083-387/+0
| | | | | | Fix distrib/make-distrib.sh script to work with git Fix distrib/build-emulator.sh to accomodate for new SDL configure script Handle Tiger SDK usage in SDL configure script
* auto import from //branches/cupcake_rel/...@140373The Android Open Source Project2009-03-181-0/+1
|
* auto import from //depot/cupcake/@136594The Android Open Source Project2009-03-051-1/+8
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-0327-0/+5176
|