diff options
| -rw-r--r-- | core/java/com/android/internal/os/WrapperInit.java | 6 | ||||
| -rw-r--r-- | core/java/com/android/internal/os/ZygoteInit.java | 8 | ||||
| -rw-r--r-- | services/input/EventHub.cpp | 1 | ||||
| -rw-r--r-- | services/input/EventHub.h | 35 | ||||
| -rw-r--r-- | services/input/InputReader.cpp | 9 | ||||
| -rw-r--r-- | services/input/tests/InputReader_test.cpp | 3 |
6 files changed, 22 insertions, 40 deletions
diff --git a/core/java/com/android/internal/os/WrapperInit.java b/core/java/com/android/internal/os/WrapperInit.java index 18d6caa710a8..860a08c3e538 100644 --- a/core/java/com/android/internal/os/WrapperInit.java +++ b/core/java/com/android/internal/os/WrapperInit.java @@ -54,6 +54,8 @@ public class WrapperInit { */ public static void main(String[] args) { try { + // Tell the Zygote what our actual PID is (since it only knows about the + // wrapper that it directly forked). int fdNum = Integer.parseInt(args[0], 10); if (fdNum != 0) { try { @@ -67,6 +69,10 @@ public class WrapperInit { } } + // Mimic Zygote preloading. + ZygoteInit.preload(); + + // Launch the application. String[] runtimeArgs = new String[args.length - 1]; System.arraycopy(args, 1, runtimeArgs, 0, runtimeArgs.length); RuntimeInit.wrapperInit(runtimeArgs); diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index 157c0bf0ec13..b4a7e52c6bb3 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -228,6 +228,11 @@ public class ZygoteInit { } } + static void preload() { + preloadClasses(); + preloadResources(); + } + /** * Performs Zygote process initialization. Loads and initializes * commonly used classes. @@ -509,8 +514,7 @@ public class ZygoteInit { registerZygoteSocket(); EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_START, SystemClock.uptimeMillis()); - preloadClasses(); - preloadResources(); + preload(); EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_END, SystemClock.uptimeMillis()); diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp index 29add52c8af2..6e803a441356 100644 --- a/services/input/EventHub.cpp +++ b/services/input/EventHub.cpp @@ -192,6 +192,7 @@ status_t EventHub::getAbsoluteAxisInfo(int32_t deviceId, int axis, outAxisInfo->maxValue = info.maximum; outAxisInfo->flat = info.flat; outAxisInfo->fuzz = info.fuzz; + outAxisInfo->resolution = info.resolution; } return OK; } diff --git a/services/input/EventHub.h b/services/input/EventHub.h index 558959b1a968..abe1318206ff 100644 --- a/services/input/EventHub.h +++ b/services/input/EventHub.h @@ -34,39 +34,6 @@ #include <linux/input.h> -/* These constants are not defined in linux/input.h in the version of the kernel - * headers currently provided with Bionic. */ - -#define EVIOCGPROP(len) _IOC(_IOC_READ, 'E', 0x09, len) - -#define INPUT_PROP_POINTER 0x00 -#define INPUT_PROP_DIRECT 0x01 -#define INPUT_PROP_BUTTONPAD 0x02 -#define INPUT_PROP_SEMI_MT 0x03 -#define INPUT_PROP_MAX 0x1f -#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) - -#define ABS_MT_SLOT 0x2f -#define ABS_MT_TOUCH_MAJOR 0x30 -#define ABS_MT_TOUCH_MINOR 0x31 -#define ABS_MT_WIDTH_MAJOR 0x32 -#define ABS_MT_WIDTH_MINOR 0x33 -#define ABS_MT_ORIENTATION 0x34 -#define ABS_MT_POSITION_X 0x35 -#define ABS_MT_POSITION_Y 0x36 -#define ABS_MT_TOOL_TYPE 0x37 -#define ABS_MT_BLOB_ID 0x38 -#define ABS_MT_TRACKING_ID 0x39 -#define ABS_MT_PRESSURE 0x3a -#define ABS_MT_DISTANCE 0x3b - -#define MT_TOOL_FINGER 0 -#define MT_TOOL_PEN 1 - -#define SYN_MT_REPORT 2 -#define SYN_DROPPED 3 - - /* Convenience constants. */ #define BTN_FIRST 0x100 // first button scancode @@ -97,6 +64,7 @@ struct RawAbsoluteAxisInfo { int32_t maxValue; // maximum value int32_t flat; // center flat position, eg. flat == 8 means center is between -8 and 8 int32_t fuzz; // error tolerance, eg. fuzz == 4 means value is +/- 4 due to noise + int32_t resolution; // resolution in units per mm or radians per mm inline void clear() { valid = false; @@ -104,6 +72,7 @@ struct RawAbsoluteAxisInfo { maxValue = 0; flat = 0; fuzz = 0; + resolution = 0; } }; diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp index fcc619857c0a..15bb300d3bae 100644 --- a/services/input/InputReader.cpp +++ b/services/input/InputReader.cpp @@ -1044,8 +1044,8 @@ void InputMapper::fadePointer() { void InputMapper::dumpRawAbsoluteAxisInfo(String8& dump, const RawAbsoluteAxisInfo& axis, const char* name) { if (axis.valid) { - dump.appendFormat(INDENT4 "%s: min=%d, max=%d, flat=%d, fuzz=%d\n", - name, axis.minValue, axis.maxValue, axis.flat, axis.fuzz); + dump.appendFormat(INDENT4 "%s: min=%d, max=%d, flat=%d, fuzz=%d, resolution=%d\n", + name, axis.minValue, axis.maxValue, axis.flat, axis.fuzz, axis.resolution); } else { dump.appendFormat(INDENT4 "%s: unknown range\n", name); } @@ -5656,9 +5656,10 @@ void JoystickInputMapper::dump(String8& dump) { dump.appendFormat(INDENT4 " scale=%0.5f, offset=%0.5f, " "highScale=%0.5f, highOffset=%0.5f\n", axis.scale, axis.offset, axis.highScale, axis.highOffset); - dump.appendFormat(INDENT4 " rawAxis=%d, rawMin=%d, rawMax=%d, rawFlat=%d, rawFuzz=%d\n", + dump.appendFormat(INDENT4 " rawAxis=%d, rawMin=%d, rawMax=%d, " + "rawFlat=%d, rawFuzz=%d, rawResolution=%d\n", mAxes.keyAt(i), axis.rawAxisInfo.minValue, axis.rawAxisInfo.maxValue, - axis.rawAxisInfo.flat, axis.rawAxisInfo.fuzz); + axis.rawAxisInfo.flat, axis.rawAxisInfo.fuzz, axis.rawAxisInfo.resolution); } } diff --git a/services/input/tests/InputReader_test.cpp b/services/input/tests/InputReader_test.cpp index d04c9e7db145..acda86bc74fe 100644 --- a/services/input/tests/InputReader_test.cpp +++ b/services/input/tests/InputReader_test.cpp @@ -481,7 +481,7 @@ public: } void addAbsoluteAxis(int32_t deviceId, int axis, - int32_t minValue, int32_t maxValue, int flat, int fuzz) { + int32_t minValue, int32_t maxValue, int flat, int fuzz, int resolution = 0) { Device* device = getDevice(deviceId); RawAbsoluteAxisInfo info; @@ -490,6 +490,7 @@ public: info.maxValue = maxValue; info.flat = flat; info.fuzz = fuzz; + info.resolution = resolution; device->absoluteAxes.add(axis, info); } |