2 project frameworks/base/
3 diff --git a/frameworks/base/libs/ui/InputReader.cpp b/frameworks/base/libs/ui/InputReader.cpp
4 index 79cb87a..d8cd717 100644
5 --- a/frameworks/base/libs/ui/InputReader.cpp
6 +++ b/frameworks/base/libs/ui/InputReader.cpp
7 @@ -1668,12 +1668,36 @@ bool TouchInputMapper::configureSurfaceLocked() {
9 // Configure X and Y factors.
10 if (mRawAxes.x.valid && mRawAxes.y.valid) {
11 - mLocked.xOrigin = mRawAxes.x.minValue;
12 - mLocked.yOrigin = mRawAxes.y.minValue;
13 - mLocked.xScale = float(width) / mRawAxes.x.getRange();
14 - mLocked.yScale = float(height) / mRawAxes.y.getRange();
15 - mLocked.xPrecision = 1.0f / mLocked.xScale;
16 - mLocked.yPrecision = 1.0f / mLocked.yScale;
17 + int a[7], have_pointercal = 0;
18 + const char *fname = "/vendor/pointercal";
19 + FILE *f = fopen(fname, "r");
22 + ret = fscanf(f, "%d %d %d %d %d %d %d",
23 + &a[0], &a[1], &a[2], &a[3], &a[4], &a[5], &a[6]);
25 + have_pointercal = 1;
27 + LOGW("Failed to parse %s", fname);
31 + LOGW("Failed to open %s", fname);
33 + if (have_pointercal) {
34 + mLocked.xScale = float(a[0]) / float(a[6]);
35 + mLocked.yScale = float(a[4]) / float(a[6]);
36 + // a[2] / mLocked.xScale / a[6]
37 + mLocked.xOrigin = -a[2] / a[0];
38 + mLocked.yOrigin = -a[5] / a[4];
40 + mLocked.xOrigin = mRawAxes.x.minValue;
41 + mLocked.yOrigin = mRawAxes.y.minValue;
42 + mLocked.xScale = float(width) / mRawAxes.x.getRange();
43 + mLocked.yScale = float(height) / mRawAxes.y.getRange();
45 + mLocked.xPrecision = fabsf(1.0f / mLocked.xScale);
46 + mLocked.yPrecision = fabsf(1.0f / mLocked.yScale);
48 configureVirtualKeysLocked();
50 @@ -1689,7 +1713,7 @@ bool TouchInputMapper::configureSurfaceLocked() {
51 // Scale factor for terms that are not oriented in a particular axis.
52 // If the pixels are square then xScale == yScale otherwise we fake it
53 // by choosing an average.
54 - mLocked.geometricScale = avg(mLocked.xScale, mLocked.yScale);
55 + mLocked.geometricScale = avg(fabsf(mLocked.xScale), fabsf(mLocked.yScale));
57 // Size of diagonal axis.
58 float diagonalSize = pythag(width, height);
60 project hardware/libhardware/
61 diff --git a/hardware/libhardware/modules/gralloc/framebuffer.cpp b/hardware/libhardware/modules/gralloc/framebuffer.cpp
62 index fe57a8a..b5465e4 100644
63 --- a/hardware/libhardware/modules/gralloc/framebuffer.cpp
64 +++ b/hardware/libhardware/modules/gralloc/framebuffer.cpp
65 @@ -109,6 +109,12 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
67 m->currentBuffer = buffer;
69 +#ifndef FBIO_WAITFORVSYNC
70 +#define FBIO_WAITFORVSYNC _IOW ('F', 32, unsigned int)
73 + ioctl(m->framebuffer->fd, FBIO_WAITFORVSYNC, &mode);
76 // If we can't do the page_flip, just copy the buffer to the front
77 // FIXME: use copybit HAL instead of memcpy
80 diff --git a/system/core/libsysutils/src/NetlinkListener.cpp b/system/core/libsysutils/src/NetlinkListener.cpp
81 index fb088e1..f99227c 100644
82 --- a/system/core/libsysutils/src/NetlinkListener.cpp
83 +++ b/system/core/libsysutils/src/NetlinkListener.cpp
84 @@ -45,21 +45,21 @@ bool NetlinkListener::onDataAvailable(SocketClient *cli)
87 if ((snl.nl_groups != 1) || (snl.nl_pid != 0)) {
88 - SLOGE("ignoring non-kernel netlink multicast message");
90 + //SLOGE("ignoring non-kernel netlink multicast message");
94 struct cmsghdr * cmsg = CMSG_FIRSTHDR(&hdr);
96 if (cmsg == NULL || cmsg->cmsg_type != SCM_CREDENTIALS) {
97 SLOGE("ignoring message with no sender credentials");
102 struct ucred * cred = (struct ucred *)CMSG_DATA(cmsg);
103 if (cred->uid != 0) {
104 SLOGE("ignoring message from non-root UID %d", cred->uid);
109 NetlinkEvent *evt = new NetlinkEvent();
111 project system/extras/
112 diff --git a/system/extras/su/su.c b/system/extras/su/su.c
113 index b87cece..bddc37d 100644
114 --- a/system/extras/su/su.c
115 +++ b/system/extras/su/su.c
116 @@ -59,10 +59,12 @@ int main(int argc, char **argv)
118 /* Until we have something better, only root and the shell can use su. */
121 if (myuid != AID_ROOT && myuid != AID_SHELL) {
122 fprintf(stderr,"su: uid %d not allowed to su\n", myuid);
127 if(setgid(gid) || setuid(uid)) {
128 fprintf(stderr,"su: permission denied\n");