Gingerbread cursor patch

414 views
Skip to first unread message

Gregoire Gentil

unread,
Jan 5, 2011, 3:48:50 PM1/5/11
to Android-x86
Androidx-86 wrote a nice cursor patch for Froyo and it has been
floating and used by a lot of projects which want to have a cursor on
Android. Unfortunately, the patch doesn't apply at all to Gingerbread.
The framework has changed too much. Has anyone tried to port the
patch?

Grégoire

Al Sutton

unread,
Jan 6, 2011, 4:38:30 AM1/6/11
to andro...@googlegroups.com
Work on the Gingerbread-x86 branch is in it's early days and nothings been made available, but if you want to do the forward porting work please let the list know to avoid duplication of effort.

Al.

> --
> You received this message because you are subscribed to the Google Groups "Android-x86" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-x86...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.
>

summer

unread,
Jan 12, 2011, 8:37:42 AM1/12/11
to Android-x86
The event mechanism had been change in gingerbread.
Anybody know how to get motion event in WindowManagerService?

On Jan 6, 5:38 pm, Al Sutton <a...@funkyandroid.com> wrote:
> Work on theGingerbread-x86 branch is in it's early days and nothings been made available, but if you want to do the forward porting work please let the list know to avoid duplication of effort.

Gregoire Gentil

unread,
Jan 13, 2011, 1:40:31 PM1/13/11
to Android-x86
@AI Sutton, if I was asking, it meant that I do not prefer to do the
porting myself ;-)

What I have discovered is that the mouse is now natively supported by
Gingerbread but it works like a trackball. It works like the arrow
keys of the keyboard. That's definitely interesting but getting a
cursor is still something more useful to my mind.

@summer, if the mouse is working as a trackball on Gingerbread, I
guess that the events are already managed by Android,

Grégoire

summer

unread,
Jan 14, 2011, 1:24:34 AM1/14/11
to Android-x86
Yes, i also found mouse can work as traceball.
The thing i want to do is adding a cursor on screen.
In gingerbread, the events are handled and dispatch by ViewRoot, not
Windowmanagerservice. But the cursor was draw in windowsmanagerservice
in froyo-x86.
So if the cursor in windowsmanagerservice can not respond to the mouse
move.

I am trying to handle event in windowsmanagerserver. But it is too
hard for me.

sawyer jim

unread,
Jan 16, 2011, 10:11:17 PM1/16/11
to Android-x86
Hi Summer, I'm doing the same thing.
Firstly the WindowManagerService new a class InputManager which is a
wrap of the native class InputManager.
And then it call native function nativeStart( ) to launch two threads
to respectively read and dispatch events.
So the process of events is in native layer.
The ViewRoot have registered the InputChannel, so it can receive and
dispatch events in Java Layer.
Maybe we could regiset InputChannel in WindowManagerService like
ViewRoot doing, then the WindowManagerService also can receive the
input events.
But there are a great lot work to do for this way and maybe it would
lower the input system efficiency.
The simplest way is ViewRoot is still responsible for processing
events, after get mouse move events, notify the windowmanagerservice
to update surface.
But I can't find a proper notify function.
Do you get any progress ?

summer

unread,
Jan 17, 2011, 2:19:32 AM1/17/11
to Android-x86
Hi, sawyer jim

I had tried to send event from ViewRoot to WindowManagerService. It
seems impossible to do that. The ViewRoot is the base of UI, but
WindowManagerService belongs to Service, I can not set up
communication between them.

So I am trying to add a InputHandle in WindowManagerServicce, then
register the Handle to InputChannel. If it works, we can dispatch the
event in HandleMotion function.

But Unfortunately, it have not work up to now.

Amit Pundir

unread,
Feb 14, 2011, 7:30:01 AM2/14/11
to Android-x86
Hi there!!

Any update on this? I tried to look into it today and frankly it went
way above my head. I couldn't trace the input-event flow yet.

Looking for a head-start.

Regards,
Amit Pundir

Gregoire Gentil

unread,
Feb 14, 2011, 8:15:33 PM2/14/11
to Android-x86
Ah ah, Rowboat is interested by the patch now! No, unfortunately,
nothing on my front. The mouse works as a trackball on Gingerbread,
which makes complex how to port the patch but works OK...

Grégoire

Gregoire Gentil

unread,
Mar 25, 2011, 12:07:28 PM3/25/11
to Android-x86
For archiving in this thread, here is the patch that we have done at
Always Innovating. It works great on Gingerbread.

From a721f7e2ab6e680257cc9cb5ecaee6238e615ff2 Mon Sep 17 00:00:00 2001
From: Gregoire Gentil <gregoire@gregoire-laptop.(none)>
Date: Tue, 15 Mar 2011 22:00:26 +0000
Subject: Adding support of cursor on Gingerbread

---
diff --git a/preprocess/gingerbread/patches/cursor.patch b/preprocess/
gingerbread/patches/cursor.patch
new file mode 100644
index 0000000..09c2673
--- a/dev/null
+++ b/preprocess/gingerbread/patches/cursor.patch
@@ -0,0 +1,518 @@
+--- a/frameworks/base/libs/ui/EventHub.cpp 2011-02-23
18:28:26.856910001 -0800
++++ b/frameworks/base/libs/ui/EventHub.cpp 2011-02-23
18:30:09.006909999 -0800
+@@ -719,7 +719,10 @@
+ LOGV("Getting relative controllers...");
+ if (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(rel_bitmask)),
rel_bitmask) >= 0) {
+ if (test_bit(REL_X, rel_bitmask) && test_bit(REL_Y,
rel_bitmask)) {
+- device->classes |= INPUT_DEVICE_CLASS_TRACKBALL;
++ if (test_bit(BTN_LEFT, key_bitmask) &&
test_bit(BTN_RIGHT, key_bitmask))
++ device->classes |= INPUT_DEVICE_CLASS_MOUSE;
++ else
++ device->classes |= INPUT_DEVICE_CLASS_TRACKBALL;
+ }
+ }
+ }
+--- a/frameworks/base/include/ui/EventHub.h 2011-02-23
18:28:18.846910002 -0800
++++ b/frameworks/base/include/ui/EventHub.h 2011-02-25
19:27:08.626910002 -0800
+@@ -119,6 +119,9 @@
+
+ /* The input device has switches. */
+ INPUT_DEVICE_CLASS_SWITCH = 0x00000080,
++
++ /* The input device is a mouse. */
++ INPUT_DEVICE_CLASS_MOUSE = 0x00000100,
+ };
+
+ /*
+--- a/frameworks/base/libs/ui/InputReader.cpp 2011-02-23
18:43:07.506909997 -0800
++++ b/frameworks/base/libs/ui/InputReader.cpp 2011-02-28
19:12:15.754663005 -0800
+@@ -340,6 +340,11 @@
+ device->addMapper(new TrackballInputMapper(device,
associatedDisplayId));
+ }
+
++ // Mouse-like devices.
++ if (classes & INPUT_DEVICE_CLASS_MOUSE) {
++ device->addMapper(new MouseInputMapper(device,
associatedDisplayId));
++ }
++
+ // Touchscreen-like devices.
+ if (classes & INPUT_DEVICE_CLASS_TOUCHSCREEN_MT) {
+ device->addMapper(new MultiTouchInputMapper(device,
associatedDisplayId));
+@@ -3128,6 +3133,207 @@
+ }
+
+
++// --- MouseInputMapper ---
++
++MouseInputMapper::MouseInputMapper(InputDevice* device, int32_t
associatedDisplayId) :
++ InputMapper(device),
mAssociatedDisplayId(associatedDisplayId) {
++ initializeLocked();
++}
++
++MouseInputMapper::~MouseInputMapper() {
++}
++
++uint32_t MouseInputMapper::getSources() {
++ return AINPUT_SOURCE_MOUSE;
++}
++
++void MouseInputMapper::populateDeviceInfo(InputDeviceInfo* info) {
++ InputMapper::populateDeviceInfo(info);
++}
++
++void MouseInputMapper::dump(String8& dump) {
++ { // acquire lock
++ AutoMutex _l(mLock);
++ dump.append(INDENT2 "Mouse Input Mapper:\n");
++ dump.appendFormat(INDENT3 "AssociatedDisplayId: %d\n",
mAssociatedDisplayId);
++ dump.appendFormat(INDENT3 "Down: %s\n",
toString(mLocked.down));
++ dump.appendFormat(INDENT3 "DownTime: %lld\n",
mLocked.downTime);
++ } // release lock
++}
++
++void MouseInputMapper::initializeLocked() {
++ mAccumulator.clear();
++
++ mLocked.down = false;
++ mLocked.downTime = 0;
++
++ int32_t screenWidth;
++ int32_t screenHeight;
++ if (mAssociatedDisplayId < 0 || ! getPolicy()-
>getDisplayInfo(mAssociatedDisplayId, &screenWidth, &screenHeight,
NULL)) {
++ mAccumulator.absX = 0;
++ mAccumulator.absY = 0;
++ }else{
++ mAccumulator.absX = screenWidth/2;
++ mAccumulator.absY = screenHeight/2;
++ }
++}
++
++void MouseInputMapper::reset() {
++ for (;;) {
++ { // acquire lock
++ AutoMutex _l(mLock);
++
++ if (! mLocked.down) {
++ initializeLocked();
++ break; // done
++ }
++ } // release lock
++
++ // Synthesize trackball button up event on reset.
++ nsecs_t when = systemTime(SYSTEM_TIME_MONOTONIC);
++ mAccumulator.fields = Accumulator::FIELD_BTN_MOUSE;
++ mAccumulator.btnMouse = false;
++ sync(when);
++ }
++
++ InputMapper::reset();
++}
++
++void MouseInputMapper::process(const RawEvent* rawEvent) {
++ switch (rawEvent->type) {
++ case EV_KEY:
++ switch (rawEvent->scanCode) {
++ case BTN_MOUSE:
++ mAccumulator.fields |= Accumulator::FIELD_BTN_MOUSE;
++ mAccumulator.btnMouse = rawEvent->value != 0;
++ sync(rawEvent->when);
++ break;
++ case BTN_RIGHT:
++ // Not handled.
++ break;
++ case BTN_MIDDLE:
++ // Not handled.
++ break;
++ }
++ break;
++
++ case EV_REL:
++ switch (rawEvent->scanCode) {
++ case REL_X:
++ mAccumulator.fields |= Accumulator::FIELD_REL_X;
++ mAccumulator.relX = rawEvent->value;
++ break;
++ case REL_Y:
++ mAccumulator.fields |= Accumulator::FIELD_REL_Y;
++ mAccumulator.relY = rawEvent->value;
++ break;
++ }
++ break;
++
++ case EV_SYN:
++ switch (rawEvent->scanCode) {
++ case SYN_REPORT:
++ sync(rawEvent->when);
++ break;
++ }
++ break;
++ }
++}
++
++void MouseInputMapper::sync(nsecs_t when) {
++ uint32_t fields = mAccumulator.fields;
++ if (fields == 0) {
++ return; // no new state changes, so nothing to do
++ }
++
++ int motionEventAction;
++ PointerCoords pointerCoords;
++ nsecs_t downTime;
++ { // acquire lock
++ AutoMutex _l(mLock);
++
++ bool downChanged = fields & Accumulator::FIELD_BTN_MOUSE;
++ if (downChanged) {
++ if (mAccumulator.btnMouse) {
++ mLocked.down = true;
++ mLocked.downTime = when;
++ } else {
++ mLocked.down = false;
++ }
++ motionEventAction = mLocked.down ?
AMOTION_EVENT_ACTION_DOWN : AMOTION_EVENT_ACTION_UP;
++ } else {
++ motionEventAction = AMOTION_EVENT_ACTION_MOVE;
++ }
++
++ downTime = mLocked.downTime;
++
++ float x = fields & Accumulator::FIELD_REL_X ?
mAccumulator.relX : 0.0f;
++ float y = fields & Accumulator::FIELD_REL_Y ?
mAccumulator.relY : 0.0f;
++
++ int32_t screenWidth;
++ int32_t screenHeight;
++ int32_t orientation;
++ if (mAssociatedDisplayId < 0 || ! getPolicy()-
>getDisplayInfo(mAssociatedDisplayId, &screenWidth, &screenHeight,
&orientation)) {
++ return;
++ }
++
++ float temp;
++ switch (orientation) {
++ case InputReaderPolicyInterface::ROTATION_90:
++ temp = x;
++ x = y;
++ y = - temp;
++ temp = screenHeight;
++ screenHeight = screenWidth;
++ screenWidth = temp;
++ break;
++
++ case InputReaderPolicyInterface::ROTATION_180:
++ x = - x;
++ y = - y;
++ break;
++
++ case InputReaderPolicyInterface::ROTATION_270:
++ temp = x;
++ x = - y;
++ y = temp;
++ temp = screenHeight;
++ screenHeight = screenWidth;
++ screenWidth = temp;
++ break;
++ }
++
++ mAccumulator.absX = (mAccumulator.absX + x) > screenWidth ?
screenWidth -1 : ((mAccumulator.absX + x) < 0 ? 0 : mAccumulator.absX
+ x);
++ mAccumulator.absY = (mAccumulator.absY + y) > screenHeight ?
screenHeight -1 : ((mAccumulator.absY + y) < 0 ? 0 : mAccumulator.absY
+ y);
++ pointerCoords.x = mAccumulator.absX;
++ pointerCoords.y = mAccumulator.absY;
++ pointerCoords.pressure = mLocked.down ? 1.0f : 0.0f;
++ pointerCoords.size = 0;
++ pointerCoords.touchMajor = 0;
++ pointerCoords.touchMinor = 0;
++ pointerCoords.toolMajor = 0;
++ pointerCoords.toolMinor = 0;
++ pointerCoords.orientation = 0;
++
++ } // release lock
++
++ int32_t metaState = mContext->getGlobalMetaState();
++ int32_t pointerId = 0;
++ getDispatcher()->notifyMotion(when, getDeviceId(),
AINPUT_SOURCE_MOUSE, 0,
++ motionEventAction, 0, metaState,
AMOTION_EVENT_EDGE_FLAG_NONE,
++ 1, &pointerId, &pointerCoords, 1, 1, downTime);
++ mAccumulator.clear();
++}
++
++int32_t MouseInputMapper::getScanCodeState(uint32_t sourceMask,
int32_t scanCode) {
++ if (scanCode >= BTN_MOUSE && scanCode < BTN_JOYSTICK) {
++ return getEventHub()->getScanCodeState(getDeviceId(),
scanCode);
++ } else {
++ return AKEY_STATE_UNKNOWN;
++ }
++}
++
++
+ // --- SingleTouchInputMapper ---
+
+ SingleTouchInputMapper::SingleTouchInputMapper(InputDevice* device,
int32_t associatedDisplayId) :
+--- a/frameworks/base/include/ui/InputReader.h 2011-02-23
18:52:36.096910001 -0800
++++ b/frameworks/base/include/ui/InputReader.h 2011-02-28
13:00:02.434663005 -0800
+@@ -489,6 +489,53 @@
+ void sync(nsecs_t when);
+ };
+
++class MouseInputMapper : public InputMapper {
++public:
++ MouseInputMapper(InputDevice* device, int32_t
associatedDisplayId);
++ virtual ~MouseInputMapper();
++
++ virtual uint32_t getSources();
++ virtual void populateDeviceInfo(InputDeviceInfo* deviceInfo);
++ virtual void dump(String8& dump);
++ virtual void reset();
++ virtual void process(const RawEvent* rawEvent);
++
++ virtual int32_t getScanCodeState(uint32_t sourceMask, int32_t
scanCode);
++
++private:
++ Mutex mLock;
++
++ int32_t mAssociatedDisplayId;
++
++ struct Accumulator {
++ enum {
++ FIELD_BTN_MOUSE = 1,
++ FIELD_REL_X = 2,
++ FIELD_REL_Y = 4,
++ };
++
++ uint32_t fields;
++
++ bool btnMouse;
++ int32_t relX;
++ int32_t relY;
++ int32_t absX;
++ int32_t absY;
++
++ inline void clear() {
++ fields = 0;
++ }
++ } mAccumulator;
++
++ struct LockedState {
++ bool down;
++ nsecs_t downTime;
++ } mLocked;
++
++ void initializeLocked();
++
++ void sync(nsecs_t when);
++};
+
+ class TouchInputMapper : public InputMapper {
+ public:
+--- a/frameworks/base/libs/ui/InputDispatcher.cpp 2011-02-24
14:02:25.786910001 -0800
++++ b/frameworks/base/libs/ui/InputDispatcher.cpp 2011-02-28
18:03:27.134662999 -0800
+@@ -731,17 +731,19 @@
+ return true;
+ }
+
+- bool isPointerEvent = entry->source &
AINPUT_SOURCE_CLASS_POINTER;
++ bool isTouchEvent = ! ((entry->source &
AINPUT_SOURCE_TOUCHSCREEN) ^ AINPUT_SOURCE_TOUCHSCREEN);
++ bool isMouseEvent = ! ((entry->source & AINPUT_SOURCE_MOUSE) ^
AINPUT_SOURCE_MOUSE);
++ bool isDownEvent = (entry->action & AMOTION_EVENT_ACTION_MASK)
== AMOTION_EVENT_ACTION_DOWN;
+
+ // Identify targets.
+ if (! mCurrentInputTargetsValid) {
+ int32_t injectionResult;
+- if (isPointerEvent) {
+- // Pointer event. (eg. touchscreen)
++ if (isTouchEvent || (isMouseEvent && (isDownEvent ||
mTouchState.down))) {
++ // Touch-like event. (eg. touchscreen or mouse drag-n-
drop )
+ injectionResult =
findTouchedWindowTargetsLocked(currentTime,
+ entry, nextWakeupTime);
+ } else {
+- // Non touch event. (eg. trackball)
++ // Non touch event. (eg. trackball or mouse simple
move)
+ injectionResult =
findFocusedWindowTargetsLocked(currentTime,
+ entry, nextWakeupTime);
+ }
+--- a/frameworks/base/core/java/android/view/ViewRoot.java 2011-02-23
11:33:20.516910002 -0800
++++ b/frameworks/base/core/java/android/view/ViewRoot.java 2011-02-28
18:16:23.994663005 -0800
+@@ -215,6 +215,8 @@
+
+ final ViewConfiguration mViewConfiguration;
+
++ static IWindowManager wm;
++
+ /**
+ * see {@link #playSoundEffect(int)}
+ */
+@@ -227,9 +229,8 @@
+ if (!mInitialized) {
+ try {
+ InputMethodManager imm =
InputMethodManager.getInstance(mainLooper);
+- sWindowSession =
IWindowManager.Stub.asInterface(
+- ServiceManager.getService("window"))
+- .openSession(imm.getClient(),
imm.getInputContext());
++ wm =
IWindowManager.Stub.asInterface(ServiceManager.getService("window"));
++ sWindowSession = wm.openSession(imm.getClient(),
imm.getInputContext());
+ mInitialized = true;
+ } catch (RemoteException e) {
+ }
+@@ -2174,6 +2175,7 @@
+ mTranslator.translateEventInScreenToAppWindow(event);
+ }
+
++ boolean isMouse = ((event.getSource() &
InputDevice.SOURCE_MOUSE) ^ InputDevice.SOURCE_MOUSE) == 0;
+ boolean handled;
+ if (mView != null && mAdded) {
+
+@@ -2837,7 +2839,15 @@
+
+ private void dispatchMotion(MotionEvent event, boolean sendDone)
{
+ int source = event.getSource();
+- if ((source & InputDevice.SOURCE_CLASS_POINTER) != 0) {
++ if (((source & InputDevice.SOURCE_MOUSE) ^
InputDevice.SOURCE_MOUSE) == 0) {
++ try{
++ wm.moveMouseSurface((int)event.getX() -
(int)event.getXOffset(),
++ (int)event.getY() -
(int)event.getYOffset());
++ }catch (RemoteException e){
++ Log.e(TAG,"RemoteException thrown in
moveMouseSurface");
++ }
++ dispatchPointer(event, sendDone);
++ }else if ((source & InputDevice.SOURCE_CLASS_POINTER) != 0)
{
+ dispatchPointer(event, sendDone);
+ } else if ((source & InputDevice.SOURCE_CLASS_TRACKBALL) !=
0) {
+ dispatchTrackball(event, sendDone);
+--- a/frameworks/base/services/java/com/android/server/
WindowManagerService.java 2011-02-28 18:24:48.934663006 -0800
++++ b/frameworks/base/services/java/com/android/server/
WindowManagerService.java 2011-02-28 18:38:17.594662998 -0800
+@@ -60,6 +60,7 @@
+ import android.graphics.Canvas;
+ import android.graphics.Matrix;
+ import android.graphics.Paint;
++import android.graphics.Path;
+ import android.graphics.PixelFormat;
+ import android.graphics.Rect;
+ import android.graphics.Region;
+@@ -372,6 +373,13 @@
+ boolean mBlurShown;
+ Watermark mWatermark;
+
++ Surface mMouseSurface;
++ int mShowMouse = 0;
++ private int mMlx;
++ private int mMly;
++ int mMlw;
++ int mMlh;
++
+ int mTransactionSequence = 0;
+
+ final float[] mTmpFloats = new float[9];
+@@ -5400,6 +5408,31 @@
+ }
+ }
+
++ public boolean moveMouseSurface(int x, int y){
++ if (mMouseSurface != null && (x != 0 || y != 0)) {
++ synchronized(mWindowMap) {
++ Surface.openTransaction();
++ WindowState top =
++ (WindowState)mWindows.get(mWindows.size() - 1);
++ try {
++ int mDisplayWidth = mDisplay.getWidth();
++ mMlx = x;
++ mMly = y;
++ mMouseSurface.setPosition(mMlx, mMly);
++ mMouseSurface.setLayer(top.mAnimLayer + 1);
++ if (mShowMouse != 1) {
++ mMouseSurface.show();
++ mShowMouse = 1;
++ }
++ } catch ( RuntimeException e) {
++ Slog.e(TAG, "Failure showing mouse surface",e);
++ }
++ Surface.closeTransaction();
++ }
++ }
++ return true;
++ }
++
+ /**
+ * Injects a keystroke event into the UI.
+ * Even when sync is false, this method may block while waiting
for current
+@@ -8487,6 +8520,54 @@
+ createWatermark = true;
+ }
+
++ if (mMouseSurface == null) {
++ int mMx, mMy, mMw, mMh;
++ Canvas mCanvas;
++ Path mPath = new Path();
++ mMw = 12;
++ mMh = 20;
++ mMx = (mDisplay.getWidth() - mMw) / 2;
++ mMy = (mDisplay.getHeight() - mMh) / 2;
++ try {
++ /*
++ *First Mouse event, create Surface
++ */
++ mMouseSurface =
++ new Surface(mFxSession,
++ 0, -1, mMw, mMh,
++ PixelFormat.TRANSPARENT,
++ Surface.FX_SURFACE_NORMAL);
++ mCanvas = mMouseSurface.lockCanvas(null);
++ Paint tPaint = new Paint();
++ tPaint.setStyle(Paint.Style.STROKE);
++ tPaint.setStrokeWidth(2);
++ tPaint.setColor(0xffffffff);
++ mPath.moveTo(0.0f, 0.0f);
++ mPath.lineTo(12.0f, 12.0f);
++ mPath.lineTo(7.0f, 12.0f);
++ mPath.lineTo(11.0f, 20.0f);
++ mPath.lineTo(8.0f, 21.0f);
++ mPath.lineTo(4.0f, 13.0f);
++ mPath.lineTo(0.0f, 17.0f);
++ mPath.close();
++ mCanvas.clipPath(mPath);
++ mCanvas.drawColor(0xff000000);
++ mCanvas.drawPath(mPath, tPaint);
++
++ mMouseSurface.unlockCanvasAndPost(mCanvas);
++ mMouseSurface.openTransaction();
++ mMouseSurface.setSize(mMw, mMh);
++ mMouseSurface.closeTransaction();
++
++ } catch (Exception e) {
++ Slog.e(TAG, "Exception creating mouse surface",e);
++ }
++ mMlx = mMx;
++ mMly = mMy;
++ mMlw = mMw;
++ mMlh = mMh;
++ }
++
+ if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION");
+
+ Surface.openTransaction();
+--- a/frameworks/base/core/java/android/view/IWindowManager.aidl
2011-02-24 18:01:12.656910000 -0800
++++ b/frameworks/base/core/java/android/view/IWindowManager.aidl
2011-02-28 18:18:05.344663002 -0800
+@@ -52,6 +52,9 @@
+ in IInputContext inputContext);
+ boolean inputMethodClientHasFocus(IInputMethodClient client);
+
++ // Draws the mouse cursor on the screen
++ boolean moveMouseSurface(int dx, int dy);
++
+ // These can only be called when injecting events to your own
window,
+ // or by holding the INJECT_EVENTS permission. These methods
may block
+ // until pending input events are finished being dispatched even
when 'sync' is false.
+--- a/frameworks/base/core/java/android/view/MotionEvent.java
2011-03-01 09:18:40.494662998 -0800
++++ b/frameworks/base/core/java/android/view/MotionEvent.java
2011-03-01 09:42:35.764663005 -0800
+@@ -781,6 +781,14 @@
+ return mDataSamples[mLastDataSampleIndex + SAMPLE_Y] +
mYOffset;
+ }
+
++ public final float getXOffset() {
++ return mXOffset;
++ }
++
++ public final float getYOffset() {
++ return mYOffset;
++ }
++
+ /**
+ * {@link #getPressure(int)} for the first pointer index (may be
an
+ * arbitrary pointer identifier).
--
cgit v0.8.3
> > > > > The thing i want to do is adding acursoron screen.
> > > > > In gingerbread, the events are handled and dispatch by ViewRoot, not
> > > > > Windowmanagerservice. But thecursorwas draw in windowsmanagerservice
> > > > > in froyo-x86.
> > > > > So if thecursorin windowsmanagerservice can not respond to the mouse
> > > > > move.
>
> > > > > I am trying to handle event in windowsmanagerserver. But it is too
> > > > > hard for me.
>
> > > > > On Jan 14, 2:40 am, Gregoire Gentil <grego...@gentil.com> wrote:
>
> > > > > > @AI Sutton, if I was asking, it meant that I do not prefer to do the
> > > > > > porting myself ;-)
>
> > > > > > What I have discovered is that the mouse is now natively supported by
> > > > > > Gingerbread but it works like a trackball. It works like the arrow
> > > > > > keys of the keyboard. That's definitely interesting but getting a
> > > > > >cursoris still something more useful to my mind.
>
> > > > > > @summer, if the mouse is working as a trackball on Gingerbread, I
> > > > > > guess that the events are already managed by Android,
>
> > > > > > Grégoire
>
> > > > > > On Jan 12, 5:37 am, summer <xiahui1...@gmail.com> wrote:
>
> > > > > > > The event mechanism had been change in gingerbread.
> > > > > > > Anybody know how to get motion event in WindowManagerService?
>
> > > > > > > On Jan 6, 5:38 pm, Al Sutton <a...@funkyandroid.com> wrote:
>
> > > > > > > > Work on theGingerbread-x86 branch is in it's early days and nothings been made available, but if you want to do the forward porting work please let the list know to avoid duplication of effort.
>
> > > > > > > > Al.
>
> > > > > > > > On 5 Jan 2011, at 20:48, Gregoire Gentil wrote:
>
> > > > > > > > > Androidx-86 wrote a nicecursorpatch for Froyo and it has been

Arobase40

unread,
Mar 25, 2011, 12:24:40 PM3/25/11
to Android-x86
He he he

Is this some sort of competition between Rowboat and Always
Innovating ??? ;-)

I'll test that patch too... :D

Anyone of you both could add some support for video playback
codecs ???

Thanks Gregoire.

Arobase
> ...
>
> plus de détails »

Gregoire Gentil

unread,
Mar 25, 2011, 3:51:20 PM3/25/11
to Android-x86
It's not competition, it's community collaboration. They take some of
our patches, we take some of their patches. And that's better for the
maturity of the Android open source projects,

Grégoire
> ...
>
> read more »

Arobase40

unread,
Mar 25, 2011, 7:19:59 PM3/25/11
to Android-x86
This could also be called a positive collaborative competition, as you
published the patch just after they announced the next publication of
their version... ;-)

Anyway, thanks to both of you ! :-D

Had not tested the patch yet, as I had to resize my linux partition :
too small to host both froyo and gingerbread at the same time with the
build results.
> ...
>
> plus de détails »

Joel Dillon

unread,
Mar 26, 2011, 10:26:35 AM3/26/11
to andro...@googlegroups.com
I had to hand-apply the patch (probably my inexperience with git patches
rather than any fault of the patch) and it works. It's a little sluggish,
but I'm more inclined to blame that on my hardware than anything else (eee 701).
Thanks :)
 

Arobase40

unread,
Mar 26, 2011, 2:36:36 PM3/26/11
to Android-x86
Did not test it yet as my gingerbread-x86 won't compile a stock target
at present time...

Hmmm... Sight... ^^
> ...
>
> plus de détails »

may may

unread,
Mar 26, 2011, 9:29:20 PM3/26/11
to andro...@googlegroups.com
I test this  patch curror mouse  isn't  complete . Left and Arrow is work but Right click  and Trackball isn't work ,mouse 
present 
  My patch Ethenet  is work 

> ...
>
> plus de détails »

Arobase40

unread,
Mar 27, 2011, 1:08:27 AM3/27/11
to Android-x86
Damnit

Hope this is worth the download : 58.4 MB ! ^_^ ;-)



On 27 mar, 03:29, may may <greatma...@gmail.com> wrote:
> I test this  patch curror mouse  isn't  complete . Left and Arrow is work
> but Right click  and Trackball isn't work ,mouse
> present
>   My patch Ethenet  is work
> My  testing  Imagehttp://gingerbread-beagleboard.googlecode.com/files/vm_addmouse_eth.rar
> ...
>
> plus de détails »

Gregoire Gentil

unread,
Mar 27, 2011, 12:38:43 PM3/27/11
to Android-x86
may may,

instead of complaining, what about you participate and improve the
patch? That would be much more helpful,

Grégoire


On Mar 26, 6:29 pm, may may <greatma...@gmail.com> wrote:
> I test this  patch curror mouse  isn't  complete . Left and Arrow is work
> but Right click  and Trackball isn't work ,mouse
> present
>   My patch Ethenet  is work
> My  testing  Imagehttp://gingerbread-beagleboard.googlecode.com/files/vm_addmouse_eth.rar
> ...
>
> read more »

may may

unread,
Mar 27, 2011, 1:16:05 PM3/27/11
to andro...@googlegroups.com
I  use  the Ethernet patch from  this link
http://git.android-x86.org/?p=platform/frameworks/base.git;a=commit;h=f41d44192abea03423772a959365dd365272fa99

 statusbarpolicy.java  is changed location  in android 2.3   
It is in /framework/base/package/systemui/
insert your new logo  on / systemui/res/drawable-hdpi or mdpi

apply Patch  statuspolicy.java 

my patch 
--- android2.3.3/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java 2011-03-14 12:44:01.000000000 +0700

+++ androidx86/android2.3/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java 2011-03-27 22:30:26.000000000 +0700

@@ -40,11 +40,14 @@

 import android.net.NetworkInfo;

 import android.net.Uri;

 import android.net.wifi.WifiManager;

+import android.net.ethernet.EthernetManager;

+import android.net.ethernet.EthernetStateTracker;

 import android.os.Binder;

 import android.os.Handler;

 import android.os.Message;

 import android.os.RemoteException;

 import android.os.storage.StorageManager;

+import android.os.SystemProperties;

 import android.provider.Settings;

 import android.telephony.PhoneStateListener;

 import android.telephony.ServiceState;

@@ -343,7 +346,12 @@

 

     // state of inet connection - 0 not connected, 100 connected

     private int mInetCondition = 0;

-

+//ethernet 

+private static final int[] sEthImages = {

+          R.drawable.connect_established,

+            R.drawable.connect_no,

+            R.drawable.connect_creating

+        };

     // sync state

     // If sync is active the SyncActive icon is displayed. If sync is not active but

     // sync is failing the SyncFailing icon is displayed. Otherwise neither are displayed.

@@ -379,6 +387,9 @@

                     action.equals(WifiManager.RSSI_CHANGED_ACTION)) {

                 updateWifi(intent);

             }

+           else if (action.equals(EthernetManager.ETHERNET_STATE_CHANGED_ACTION)) {

+                updateEth(intent);

+             }

             else if (action.equals(LocationManager.GPS_ENABLED_CHANGE_ACTION) ||

                     action.equals(LocationManager.GPS_FIX_CHANGE_ACTION)) {

                 updateGps(intent);

@@ -437,7 +448,9 @@

         mService.setIcon("wifi", sWifiSignalImages[0][0], 0);

         mService.setIconVisibility("wifi", false);

         // wifi will get updated by the sticky intents

-

+         //ethernet

+         mService.setIcon("ethernet",sEthImages[0],0);

+        mService.setIconVisibility("ethernet", false);

         // TTY status

         mService.setIcon("tty",  R.drawable.stat_sys_tty_mode, 0);

         mService.setIconVisibility("tty", false);

@@ -497,6 +510,7 @@

         filter.addAction(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION);

         filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);

         filter.addAction(WifiManager.RSSI_CHANGED_ACTION);

+        filter.addAction(EthernetManager.ETHERNET_STATE_CHANGED_ACTION);

         filter.addAction(LocationManager.GPS_ENABLED_CHANGE_ACTION);

         filter.addAction(LocationManager.GPS_FIX_CHANGE_ACTION);

         filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);

@@ -1088,8 +1102,30 @@

         mService.setIcon("bluetooth", iconId, 0);

         mService.setIconVisibility("bluetooth", mBluetoothEnabled);

     }

-

-    private final void updateWifi(Intent intent) {

+ private final void updateEth(Intent intent) {

+        final int event = intent.getIntExtra(EthernetManager.EXTRA_ETHERNET_STATE, EthernetManager.ETHERNET_STATE_UNKNOWN);

+         int iconId;

+        switch (event) {

+            case EthernetStateTracker.EVENT_HW_CONNECTED:

+            case EthernetStateTracker.EVENT_INTERFACE_CONFIGURATION_SUCCEEDED:

+            mService.setIconVisibility("ethernet", false);

+             iconId = sEthImages[2];

+            mService.setIcon("ethernet", iconId, 0); 

+             break; 

+            case EthernetStateTracker.EVENT_HW_DISCONNECTED:           

+            case EthernetStateTracker.EVENT_INTERFACE_CONFIGURATION_FAILED:  

+            mService.setIconVisibility("ethernet", false);

+             iconId = sEthImages[1];

+            mService.setIcon("ethernet", iconId, 0); 

+             break; 

+            default:

+            mService.setIconVisibility("ethernet", false);

+             iconId = sEthImages[0];

+            mService.setIcon("ethernet", iconId, 0);  

+            }                            

+}

+      

+private final void updateWifi(Intent intent) {

         final String action = intent.getAction();

         if (action.equals(WifiManager.WIFI_STATE_CHANGED_ACTION)) {

 

--

Amit Pundir

unread,
Mar 28, 2011, 6:13:15 AM3/28/11
to andro...@googlegroups.com, Gregoire Gentil
Raw code snippet for handling RightButton(Back operation) and
MiddleButton(Menu operation). Keycodes and Scancodes are hardcoded as
of now since I couldn't lookup the corresponding ENUMs if there are
any. Also couldn't create a proper patch since my sources are not
clean enough at the moment.

Modifications in frameworks/base/include/ui/InputReader.h file:

class MouseInputMapper : public InputMapper {
.....
private:
.....
struct Accumulator {
enum {
FIELD_BTN_MOUSE = 1,
FIELD_REL_X = 2,
FIELD_REL_Y = 4,
+ FIELD_BTN_RIGHT = 8,
+ FIELD_BTN_MIDDLE = 16,
};

uint32_t fields;

bool btnMouse;
+ bool btnRight;
+ bool btnMiddle;
int32_t relX;
int32_t relY;
int32_t absX;
int32_t absY;

inline void clear() {
fields = 0;
}
} mAccumulator;
.....
}

Modifications in frameworks/base/libs/ui/InputReader.cpp file:

void MouseInputMapper::process(const RawEvent* rawEvent) {
.....
case BTN_RIGHT:
- // Not handled.
+ // Back Button
+ mAccumulator.fields |= Accumulator::FIELD_BTN_RIGHT;
+ mAccumulator.btnRight = rawEvent->value != 0;
+ sync(rawEvent->when);
break;
case BTN_MIDDLE:
- // Not handled.
+ // Menu Button
+ mAccumulator.fields |= Accumulator::FIELD_BTN_MIDDLE;
+ mAccumulator.btnMiddle = rawEvent->value != 0;
+ sync(rawEvent->when);
break;
.....
}

void MouseInputMapper::sync(nsecs_t when) {
.....
{ // acquire lock
AutoMutex _l(mLock);

+ if (fields & Accumulator::FIELD_BTN_RIGHT) {
+ getDispatcher()->notifyKey(when, getDeviceId(),
AINPUT_SOURCE_DPAD, 0,
+ mAccumulator.btnRight ?
AKEY_EVENT_ACTION_DOWN : AKEY_EVENT_ACTION_UP,
+ AKEY_EVENT_FLAG_FROM_SYSTEM, 0x4
/*Keycode for back key*/, 0x18 /*Scancode*/,
mContext->getGlobalMetaState(), when);
+ }
+
+ if (fields & Accumulator::FIELD_BTN_MIDDLE) {
+ getDispatcher()->notifyKey(when, getDeviceId(),
AINPUT_SOURCE_DPAD, 0,
+ mAccumulator.btnMiddle ?
AKEY_EVENT_ACTION_DOWN : AKEY_EVENT_ACTION_UP,
+ AKEY_EVENT_FLAG_FROM_SYSTEM, 0x52
/*Keycode for menu key*/, 0x19 /*Scancode*/,
mContext->getGlobalMetaState(), when);
+ }
+


bool downChanged = fields & Accumulator::FIELD_BTN_MOUSE;

.....
}

Regards,
Amit Pundir

Gregoire Gentil

unread,
Mar 28, 2011, 11:50:20 AM3/28/11
to Amit Pundir, andro...@googlegroups.com
Thanks Amit. Sounds good and cool! We will test too...

Grégoire

may may

unread,
Mar 28, 2011, 1:19:31 PM3/28/11
to andro...@googlegroups.com
Thank  you Amit 

I test it .  result tracebox scrolling isn't work  Right click back  action  and press traceball menu action is ok!

Amit Pundir

unread,
Mar 29, 2011, 2:03:07 AM3/29/11
to andro...@googlegroups.com
What is tracebox scrolling?

Regards,
Amit Pundir

may may

unread,
Mar 29, 2011, 3:53:16 AM3/29/11
to andro...@googlegroups.com
example   it is the this  picture
mousetest.png

Amit Pundir

unread,
Mar 29, 2011, 4:45:34 AM3/29/11
to andro...@googlegroups.com
If this is called tracebox scrolling then yes I have not looked into this.

Regards,
Amit Pundir

2011/3/29 may may <great...@gmail.com>:

may may

unread,
Mar 29, 2011, 5:06:48 AM3/29/11
to andro...@googlegroups.com
 I'm sorry if my english  isn't  very well .In fact  It is mouse wheel or scroll wheel

James.Eitzen

unread,
Apr 4, 2011, 5:13:36 PM4/4/11
to Android-x86
Hello All,

I am new to Android Dev an extreme novice.

I would like to get the code compiled, so I can apply the Mouse Cursor
patch. I would love to help out with it as much as I can.

Yi Sun

unread,
Apr 4, 2011, 5:15:56 PM4/4/11
to andro...@googlegroups.com, James.Eitzen
If you are having issue to build gingerbread, check the download
section of the android-x86.org. It should have the fix.
Yi

> --
> You received this message because you are subscribed to the Google Groups "Android-x86" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-x86...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.
>
>

--
Android-x86
http://www.android-x86.org

Arobase40

unread,
Apr 4, 2011, 6:37:08 PM4/4/11
to Android-x86
Does that mean that if we do a repo sync, we should have both the
cursor and ethernet patches applied in the main code ?


On 4 avr, 23:15, Yi Sun <beyo...@gmail.com> wrote:
> If you are having issue to build gingerbread, check the download
> section of the android-x86.org. It should have the fix.
> Yi
>

Yi Sun

unread,
Apr 4, 2011, 7:05:10 PM4/4/11
to andro...@googlegroups.com
No, that is not what I meant. At least the cursor does not work for me
on my AMD device with the code checked out last Tuesday. What I have
suggested is for you to build the gingerbread image. I suspect that
there are some out of sync between the google app packages and the
android-x86 gingerbread frameworks repo. I think Chih-wei is checking
on that. So before it get fixed, you can use the patch mentioned by me
to build gingerbread image. For the cursor, I think someone has
mentioned some fixes in the list, but I don't know the status for the
repo push.
Yi

Arobase40

unread,
Apr 5, 2011, 1:03:56 AM4/5/11
to Android-x86
What a pity... ;-)
At least for the Mouse Cursor and Ethernet...

Just did a repo sync, but not sure if there are real changes. I try to
do a build with an existing target to be sure...

Yi Sun

unread,
Apr 5, 2011, 1:16:49 AM4/5/11
to andro...@googlegroups.com
Hopefully, I could get more time to spend on the project ..............

Arobase40

unread,
Apr 5, 2011, 1:25:12 AM4/5/11
to Android-x86
Sorry, but same problem as before :

arobase@M51Vr-laptop:~/android-gingerbread-x86$ make -j2 iso_img
TARGET_PRODUCT=asus_laptop
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.1
TARGET_PRODUCT=asus_laptop
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=x86
TARGET_ARCH_VARIANT=x86-atom
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================
find: "ethernet/java": Aucun fichier ou dossier de ce type
find: "ethernet/java": Aucun fichier ou dossier de ce type
find: "frameworks/base/frameworks/base/docs/html": Aucun fichier ou
dossier de ce type
find: "out/target/common/docs/gen": Aucun fichier ou dossier de ce
type
find: "frameworks/base/frameworks/base/docs/html": Aucun fichier ou
dossier de ce type
find: "out/target/common/docs/gen": Aucun fichier ou dossier de ce
type
find: "frameworks/base/frameworks/base/docs/html": Aucun fichier ou
dossier de ce type
find: "out/target/common/docs/gen": Aucun fichier ou dossier de ce
type
find: "frameworks/base/frameworks/base/docs/html": Aucun fichier ou
dossier de ce type
find: "out/target/common/docs/gen": Aucun fichier ou dossier de ce
type
find: "frameworks/base/frameworks/base/docs/html": Aucun fichier ou
dossier de ce type
find: "out/target/common/docs/gen": Aucun fichier ou dossier de ce
type
Copying: out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/
noproguard.classes.dex
Copying: out/target/common/obj/APPS/QuickSearchBox_intermediates/
noproguard.classes.dex
target Strip: libpixelflinger (out/target/product/laptop/obj/lib/
libpixelflinger.so)
target Strip: libskia (out/target/product/laptop/obj/lib/libskia.so)
target SharedLib: libdvm (out/target/product/laptop/obj/
SHARED_LIBRARIES/libdvm_intermediates/LINKED/libdvm.so)
Install: out/target/product/laptop/system/lib/libgui.so
Install: out/target/product/laptop/system/lib/libskia.so
target Strip: libril (out/target/product/laptop/obj/lib/libril.so)
target Executable: skia_test (out/target/product/laptop/obj/
EXECUTABLES/skia_test_intermediates/LINKED/skia_test)
target SharedLib: libGLES_android (out/target/product/laptop/obj/
SHARED_LIBRARIES/libGLES_android_intermediates/LINKED/
libGLES_android.so)
target Strip: libexif (out/target/product/laptop/obj/lib/libexif.so)
target SharedLib: libreference-cdma-sms (out/target/product/laptop/obj/
SHARED_LIBRARIES/libreference-cdma-sms_intermediates/LINKED/
libreference-cdma-sms.so)
out/target/product/laptop/obj/SHARED_LIBRARIES/libdvm_intermediates/
mterp/out/InterpAsm-x86-atom.o: dans la fonction «
dvmAsmInstructionJmpTable »:
dalvik/vm/mterp/out/InterpAsm-x86-atom.S:17602: référence indéfinie
vers « .L_OP_UNUSED_E3 »
dalvik/vm/mterp/out/InterpAsm-x86-atom.S:17602: référence indéfinie
vers « .L_OP_UNUSED_E4 »
dalvik/vm/mterp/out/InterpAsm-x86-atom.S:17602: référence indéfinie
vers « .L_OP_UNUSED_E5 »
dalvik/vm/mterp/out/InterpAsm-x86-atom.S:17602: référence indéfinie
vers « .L_OP_UNUSED_E6 »
dalvik/vm/mterp/out/InterpAsm-x86-atom.S:17602: référence indéfinie
vers « .L_OP_UNUSED_E7 »
dalvik/vm/mterp/out/InterpAsm-x86-atom.S:17602: référence indéfinie
vers « .L_OP_UNUSED_FC »
dalvik/vm/mterp/out/InterpAsm-x86-atom.S:17602: référence indéfinie
vers « .L_OP_UNUSED_FD »
dalvik/vm/mterp/out/InterpAsm-x86-atom.S:17602: référence indéfinie
vers « .L_OP_UNUSED_FE »
collect2: ld returned 1 exit status
make: *** [out/target/product/laptop/obj/SHARED_LIBRARIES/
libdvm_intermediates/LINKED/libdvm.so] Erreur 1
make: *** Attente des tâches non terminées....
target SharedLib: libreference-ril (out/target/product/laptop/obj/
SHARED_LIBRARIES/libreference-ril_intermediates/LINKED/libreference-
ril.so)
arobase@M51Vr-laptop:~/android-gingerbread-x86$

Yi Sun

unread,
Apr 5, 2011, 2:05:06 AM4/5/11
to andro...@googlegroups.com
Ho,, this is a different problem. I was talking about the errors
happened during generic_x86 compile for the gingerbread-x86. I will
take a look, and send update if I find fix for this one.

Arobase40

unread,
Apr 5, 2011, 2:18:02 AM4/5/11
to Android-x86
This is the problem I was facing since 2 or 3 weeks, and I patiently
waited as I was thinking somebody was working on this part of the
source code... ^^ ;-)

Havn't got this problem before I crashed my linux system and did a
complete download of gingerbread again.

Chih-Wei Huang

unread,
Apr 5, 2011, 5:35:35 AM4/5/11
to andro...@googlegroups.com
2011/4/5 Arobase40 <arob...@gmail.com>:

> This is the problem I was facing since 2 or 3 weeks, and I patiently
> waited as I was thinking somebody was working on this part of the
> source code... ^^ ;-)
> Havn't got this problem before I crashed my linux system and did a
> complete download of gingerbread again.

This is a known issue. You're building a target with
TARGET_ARCH_VARIANT=x86-atom,
which is broken in gingerbread-x86.

A simple workaround is just remove
TARGET_ARCH_VARIANT=x86-atom.

A proper fix should already be put to AOSP.
But no time to merge it to gingerbread-x86 yet.

--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Arobase40

unread,
Apr 5, 2011, 6:11:34 AM4/5/11
to Android-x86
Oh ok, I didn't know as I was able to compile few time after
gingerbread was released and just as this is your own target... ;-)

At least I will be able to test my own target against gingerbread...

Thanks


On 5 avr, 11:35, Chih-Wei Huang <cwhu...@android-x86.org> wrote:
> 2011/4/5 Arobase40 <arobas...@gmail.com>:

Arobase40

unread,
Apr 5, 2011, 6:50:26 AM4/5/11
to Android-x86
New problems, AGAIN ! :(


target Java: MagicSmokeWallpapers (out/target/common/obj/APPS/
MagicSmokeWallpapers_intermediates/classes)
target Java: MediaProvider (out/target/common/obj/APPS/
MediaProvider_intermediates/classes)
target Java: Mms (out/target/common/obj/APPS/Mms_intermediates/
classes)
packages/providers/MediaProvider/src/com/android/providers/media/
MediaProvider.java:1869: cannot find symbol
symbol : variable COMPILATION
location: class android.provider.MediaStore.Audio.Media
String compilation =
values.getAsString(MediaStore.Audio.Media.COMPILATION);

^
packages/providers/MediaProvider/src/com/android/providers/media/
MediaProvider.java:1870: cannot find symbol
symbol : variable COMPILATION
location: class android.provider.MediaStore.Audio.Media
values.remove(MediaStore.Audio.Media.COMPILATION);
^
packages/providers/MediaProvider/src/com/android/providers/media/
MediaProvider.java:2340: cannot find symbol
symbol : variable COMPILATION
location: class android.provider.MediaStore.Audio.Media
String compilation =
values.getAsString(MediaStore.Audio.Media.COMPILATION);

^
packages/providers/MediaProvider/src/com/android/providers/media/
MediaProvider.java:2341: cannot find symbol
symbol : variable COMPILATION
location: class android.provider.MediaStore.Audio.Media

values.remove(MediaStore.Audio.Media.COMPILATION);
^
Note: packages/providers/MediaProvider/src/com/android/providers/media/
MediaScannerService.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: packages/providers/MediaProvider/src/com/android/providers/media/
MediaProvider.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
make: *** [out/target/common/obj/APPS/MediaProvider_intermediates/
classes-full-debug.jar] Erreur 41
make: *** Attente des tâches non terminées....
packages/apps/Mms/src/com/android/mms/ui/VideoAttachmentView.java:107:
cannot find symbol
symbol : method getFrameAtTime(int)
location: class android.media.MediaMetadataRetriever
bitmap = retriever.getFrameAtTime(-1);
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
make: *** [out/target/common/obj/APPS/Mms_intermediates/classes-full-
debug.jar] Erreur 41

Yi Sun

unread,
Apr 5, 2011, 1:12:26 PM4/5/11
to andro...@googlegroups.com
This will be fixed by the patch I have mentioned before

> --
> You received this message because you are subscribed to the Google Groups "Android-x86" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-x86...@googlegroups.com.

Arobase40

unread,
Apr 5, 2011, 5:43:24 PM4/5/11
to Android-x86
Sorry Yi Sun, but I feel a bit lost and confused... ^^

Do you mean patches to come or the patches previously introduced
here ?

http://groups.google.com/group/android-x86/browse_thread/thread/9783bc3ffd07ec1b#

I Thought by the time, The git server had already applied the changes
or do we still need to do these changes ??? :p

Thanks

Arobase40

unread,
Apr 5, 2011, 9:26:33 PM4/5/11
to Android-x86
Ok, got the asus_laptop target compiled, building, and running in
VirtualBox !!!

Proof this is real Gingerbread : missing the mouse cursor. lol

So I'll try to modify it with with patches for Mouse Cursor and
Ethernet. Then I'll try to compile my own target with multitouch
patches either...

I have some more questions, but I'll create un new thread for them.

Thanks again Yi. :)



On 5 avr, 19:12, Yi Sun <beyo...@gmail.com> wrote:

Yi Sun

unread,
Apr 5, 2011, 9:45:53 PM4/5/11
to andro...@googlegroups.com, Android-x86
That is good news, let us know if u got any progress

Arobase40

unread,
Apr 5, 2011, 10:02:17 PM4/5/11
to Android-x86
I'm creating a backup of this directory before applying any
additionnal changes, first. ;-)

Hopefully I'll create my first Gingrebread beta 1 for the 1825ptz...
^^

On 6 avr, 03:45, Yi Sun <beyo...@gmail.com> wrote:
> That is good news, let us know if u got any progress
>

Arobase40

unread,
Apr 6, 2011, 6:03:08 AM4/6/11
to Android-x86
Re bonjour Grégoire,

Laissez tomber, je viens de me rendre compte que je n'ai surement pas
appliqué les patches au bon endroit et pas dans le corps de la bonne
fonction.
Je vais vérifier l'ensemble du code et refaire les corrections.

Merci encore,

Arobase
> ...
>
> plus de détails »

Arobase40

unread,
Apr 6, 2011, 6:06:36 AM4/6/11
to Android-x86
Sorry, I made a mistake as I wanted to post privately to Gregoire
Gentil... :-D

Scott

unread,
Apr 26, 2011, 6:35:47 PM4/26/11
to Android-x86
Hi, here is how I added scroll wheel support as up and down keys.

in /include/ui/InputReader.h

In the mouse input mapper Accumulator I added the following under enum
{

FIELD_REL_WHEEL = 32,

and these two booleans

bool btnScrollUp;
bool btnScrollDown;


in /libs/ui/InputReader.cpp

Under the mouse input mapper::process add this in the EV_REL section
under case REL_WHEEL

case REL_WHEEL:
mAccumulator.fields |= Accumulator::FIELD_REL_WHEEL;
mAccumulator.btnScrollUp = rawEvent->value == 1;
mAccumulator.btnScrollDown = rawEvent->value == -1;
break;

and this in the sync section with the other button input

bool scrollChanged = fields & Accumulator::FIELD_REL_WHEEL;
if (mAccumulator.btnScrollUp && scrollChanged) {
getDispatcher()->notifyKey(when, getDeviceId(),
AINPUT_SOURCE_DPAD, 0, AKEY_EVENT_ACTION_DOWN,
AKEY_EVENT_FLAG_FROM_SYSTEM,
0x13/*Keycode for up key*/, 0x24 /*Scancode*/,
mContext->getGlobalMetaState(), when);
getDispatcher()->notifyKey(when, getDeviceId(),
AINPUT_SOURCE_DPAD, 0, AKEY_EVENT_ACTION_UP,
AKEY_EVENT_FLAG_FROM_SYSTEM,
0x13/*Keycode for up key*/, 0x24 /*Scancode*/,
mContext->getGlobalMetaState(), when);
}
else if (mAccumulator.btnScrollDown && scrollChanged) {
getDispatcher()->notifyKey(when, getDeviceId(),
AINPUT_SOURCE_DPAD, 0, AKEY_EVENT_ACTION_DOWN,
AKEY_EVENT_FLAG_FROM_SYSTEM,
0x14/*Keycode for down key*/, 0x25 /*Scancode*/,
mContext->getGlobalMetaState(), when);
getDispatcher()->notifyKey(when, getDeviceId(),
AINPUT_SOURCE_DPAD, 0, AKEY_EVENT_ACTION_UP,
AKEY_EVENT_FLAG_FROM_SYSTEM,
0x14/*Keycode for down key*/, 0x25 /*Scancode*/,
mContext->getGlobalMetaState(), when);
}

I also changed the middle (or scroll button) to select highlighted
fields and changed the menu to be activated by pressing the right
button while holding down the left button.

if (fields & Accumulator::FIELD_BTN_RIGHT && mLocked.down) {
getDispatcher()->notifyKey(when, getDeviceId(),
AINPUT_SOURCE_DPAD, 0, mAccumulator.btnRight ?
AKEY_EVENT_ACTION_DOWN : AKEY_EVENT_ACTION_UP,
AKEY_EVENT_FLAG_FROM_SYSTEM,
0x52/*Keycode for menu key*/, 0x19 /*Scancode*/,
mContext->getGlobalMetaState(), when);
}
else if (fields & Accumulator::FIELD_BTN_RIGHT) {
getDispatcher()->notifyKey(when, getDeviceId(),
AINPUT_SOURCE_DPAD, 0, mAccumulator.btnRight ?
AKEY_EVENT_ACTION_DOWN : AKEY_EVENT_ACTION_UP,
AKEY_EVENT_FLAG_FROM_SYSTEM,
0x04 /*Keycode for back key*/, 0x18 /*Scancode*/,
mContext->getGlobalMetaState(), when);
}

if (fields & Accumulator::FIELD_BTN_MIDDLE) {
getDispatcher()->notifyKey(when, getDeviceId(),
AINPUT_SOURCE_DPAD, 0, mAccumulator.btnMiddle ?
AKEY_EVENT_ACTION_DOWN : AKEY_EVENT_ACTION_UP,
AKEY_EVENT_FLAG_FROM_SYSTEM,
0x42/*Keycode for enter key*/, 0x26 /*Scancode*/,
mContext->getGlobalMetaState(), when);
}

Hope this helps.

may may

unread,
Apr 28, 2011, 3:04:37 AM4/28/11
to andro...@googlegroups.com
Thank you very much   patch work!


--

jay

unread,
May 9, 2011, 11:03:09 PM5/9/11
to Android-x86
Hi,

I tried this patch with hwrotation = 270, it is magic that mouse still
works fine?
Why the mouse doesn't need to consider the case?

Of course, it is wrong when hwrotation = 270 and rotate again..

On 3月29日, 下午4時45分, Amit Pundir <pundira...@gmail.com> wrote:
> If this is called tracebox scrolling then yes I have not looked into this.
>
> Regards,
> Amit Pundir
>
> 2011/3/29 may may <greatma...@gmail.com>:
>
>
>
>
>
>
>
> > example   it is the this  picture
> > On Tue, Mar 29, 2011 at 1:03 PM, Amit Pundir <pundira...@gmail.com> wrote:
>
> >> What is tracebox scrolling?
>
> >> Regards,
> >> Amit Pundir
>
> >> On Mon, Mar 28, 2011 at 10:49 PM, may may <greatma...@gmail.com> wrote:
> >> > Thank  you Amit
> >> > I test it .  result tracebox scrolling isn't work  Right click back
> >> >  action
> >> >  and press traceball menu action is ok!
>
> >> > On Mon, Mar 28, 2011 at 10:50 PM, Gregoire Gentil <grego...@gentil.com>
> >> >> > <grego...@gentil.com>
> >> >> > > ++    /* The input device is amouse. */
> >> >> > > ++    INPUT_DEVICE_CLASS_MOUSE         = 0x00000100,
> >> >> > > + };
> >> >> > > +
> >> >> > > + /*
> >> >> > > +--- a/frameworks/base/libs/ui/InputReader.cpp  2011-02-23
> >> >> > > 18:43:07.506909997 -0800
> >> >> > > ++++ b/frameworks/base/libs/ui/InputReader.cpp  2011-02-28
> >> >> > > 19:12:15.754663005 -0800
> >> >> > > +@@ -340,6 +340,11 @@
> >> >> > > +         device->addMapper(new TrackballInputMapper(device,
> >> >> > > associatedDisplayId));
> >> >> > > +     }
> >> >> > > +
> >> >> > > ++    //Mouse-like devices.
> >> >> > > ++        dump.append(INDENT2 "MouseInput Mapper:\n");
> >> >> > > ++...
>
> 閱讀更多 »

Amit Pundir

unread,
May 11, 2011, 2:55:16 AM5/11/11
to andro...@googlegroups.com
Because this part of the mouse cursor patch takes care of orientation:

+        switch (orientation) {
+        case InputReaderPolicyInterface::ROTATION_90:
+            temp = x;
+            x = y;
+            y = - temp;
+            temp = screenHeight;
+            screenHeight = screenWidth;
+            screenWidth = temp;
+            break;
+
+        case InputReaderPolicyInterface::ROTATION_180:
+            x = - x;
+            y = - y;
+            break;
+
+        case InputReaderPolicyInterface::ROTATION_270:
+            temp = x;
+            x = - y;
+            y = temp;
+            temp = screenHeight;
+            screenHeight = screenWidth;
+            screenWidth = temp;
+            break;
+        }

Regards,
Amit Pundir


--
Reply all
Reply to author
Forward
0 new messages