diff options
author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2012-05-15 09:05:37 -0700 |
---|---|---|
committer | Vladimir Chtchetkine <vchtchetkine@google.com> | 2012-05-15 09:05:37 -0700 |
commit | 0c77edd7499c1b296671c5cd9375dab502c381f7 (patch) | |
tree | b8f4025609f9a55325e0860b69053358973fc62d /apps/SdkController/src | |
parent | b28bfab68eb5df44079f7c3ca0801cee546460c1 (diff) | |
download | sdk-0c77edd7499c1b296671c5cd9375dab502c381f7.zip sdk-0c77edd7499c1b296671c5cd9375dab502c381f7.tar.gz sdk-0c77edd7499c1b296671c5cd9375dab502c381f7.tar.bz2 |
Send ACK messages to emulator on FB update events.
This is device-side improvement to FB update protocol. This change allows the emulator
not to send new FB update until device has fully processed the previous one.
Change-Id: Ib1aa66359e3c8b52e3ed00b037ced4adf59534dc
Diffstat (limited to 'apps/SdkController/src')
3 files changed, 6 insertions, 0 deletions
diff --git a/apps/SdkController/src/com/android/tools/sdkcontroller/activities/MultiTouchActivity.java b/apps/SdkController/src/com/android/tools/sdkcontroller/activities/MultiTouchActivity.java index 06b29f1..c0079d9 100755 --- a/apps/SdkController/src/com/android/tools/sdkcontroller/activities/MultiTouchActivity.java +++ b/apps/SdkController/src/com/android/tools/sdkcontroller/activities/MultiTouchActivity.java @@ -246,6 +246,7 @@ public class MultiTouchActivity extends BaseBindingActivity break;
case MultiTouchChannel.EVENT_FRAME_BUFFER:
onFrameBuffer(((ByteBuffer) msg.obj).array());
+ mHandler.postMessage(ProtocolConstants.MT_FB_HANDLED, (byte[]) null);
break;
}
return true; // we consumed this message
diff --git a/apps/SdkController/src/com/android/tools/sdkcontroller/handlers/MultiTouchChannel.java b/apps/SdkController/src/com/android/tools/sdkcontroller/handlers/MultiTouchChannel.java index fc70ae1..522a06e 100755 --- a/apps/SdkController/src/com/android/tools/sdkcontroller/handlers/MultiTouchChannel.java +++ b/apps/SdkController/src/com/android/tools/sdkcontroller/handlers/MultiTouchChannel.java @@ -109,6 +109,7 @@ public class MultiTouchChannel extends Channel { Message msg = Message.obtain();
msg.what = EVENT_FRAME_BUFFER;
msg.obj = msg_data;
+ postMessage(ProtocolConstants.MT_FB_ACK, (byte[]) null);
notifyUiHandlers(msg);
break;
diff --git a/apps/SdkController/src/com/android/tools/sdkcontroller/lib/ProtocolConstants.java b/apps/SdkController/src/com/android/tools/sdkcontroller/lib/ProtocolConstants.java index b4c6593..32abf2b 100644 --- a/apps/SdkController/src/com/android/tools/sdkcontroller/lib/ProtocolConstants.java +++ b/apps/SdkController/src/com/android/tools/sdkcontroller/lib/ProtocolConstants.java @@ -120,6 +120,10 @@ public final class ProtocolConstants { public static final int MT_POINTER_UP = 5; /** Sends framebuffer update. */ public static final int MT_FB_UPDATE = 6; + /** Frame buffer update has been received. */ + public static final int MT_FB_ACK = 7; + /** Frame buffer update has been handled. */ + public static final int MT_FB_HANDLED = 8; /** Size of an event entry in the touch event message to the emulator. */ public static final int MT_EVENT_ENTRY_SIZE = 16; |