From b751cd535f8b81bf45d765c1f9232e6d05e2cfd3 Mon Sep 17 00:00:00 2001 From: Fred Quintana Date: Thu, 4 Nov 2010 10:56:35 -0700 Subject: [PATCH 1/3] support the changes to the SyncAdapter definition that allow specifying allowParallelSyncs and isAlwaysSyncable Change-Id: Ifdeddbdd6d5a6e2edb5c340d5ebd3f75ce7d9e18 --- .../src/com/android/development/SyncAdapterDriver.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/Development/src/com/android/development/SyncAdapterDriver.java b/apps/Development/src/com/android/development/SyncAdapterDriver.java index a91e0ed99..0fde732a1 100644 --- a/apps/Development/src/com/android/development/SyncAdapterDriver.java +++ b/apps/Development/src/com/android/development/SyncAdapterDriver.java @@ -367,7 +367,12 @@ public class SyncAdapterDriver extends Activity com.android.internal.R.styleable.SyncAdapter_userVisible, true); final boolean supportsUploading = sa.getBoolean( com.android.internal.R.styleable.SyncAdapter_supportsUploading, true); - return new SyncAdapterType(authority, accountType, userVisible, supportsUploading); + final boolean isAlwaysSyncable = sa.getBoolean( + com.android.internal.R.styleable.SyncAdapter_isAlwaysSyncable, false); + final boolean allowParallelSyncs = sa.getBoolean( + com.android.internal.R.styleable.SyncAdapter_allowParallelSyncs, false); + return new SyncAdapterType(authority, accountType, userVisible, supportsUploading, + isAlwaysSyncable, allowParallelSyncs); } finally { sa.recycle(); } From 9f8e7b45b2126b19dd3456f7dcb2b8981cc7c388 Mon Sep 17 00:00:00 2001 From: Dima Zavin Date: Thu, 9 Dec 2010 14:22:07 -0800 Subject: [PATCH 2/3] monkey: trap SIGHUP in shell before launching Change-Id: Ia79361858baa72970ba15d2d1ce0290d0bd38967 Signed-off-by: Dima Zavin --- cmds/monkey/monkey | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds/monkey/monkey b/cmds/monkey/monkey index 45f43a45c..bbe27f6af 100755 --- a/cmds/monkey/monkey +++ b/cmds/monkey/monkey @@ -3,5 +3,6 @@ # base=/system export CLASSPATH=$base/framework/monkey.jar +trap "" HUP exec app_process $base/bin com.android.commands.monkey.Monkey $* From af2fc1a4e2d99c99243f54edaf3e4f7216daf0d2 Mon Sep 17 00:00:00 2001 From: Yu Shan Emily Lau Date: Thu, 9 Dec 2010 18:26:10 -0800 Subject: [PATCH 3/3] Adjusted the motionEvent time to the acutal time when then event is send out to the queue. Change-Id: I722508829c79028a7345a4dea0517fc1117b8fa5 --- .../commands/monkey/MonkeySourceScript.java | 36 ++++--------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java index 6defcb001..799b8af4b 100644 --- a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java +++ b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java @@ -597,41 +597,19 @@ public class MonkeySourceScript implements MonkeyEventSource { } /** - * Adjust motion downtime and eventtime according to both recorded values - * and current system time. + * Adjust motion downtime and eventtime according to current system time. * * @param e A KeyEvent */ private void adjustMotionEventTime(MonkeyMotionEvent e) { + long updatedDownTime = 0; + if (e.getEventTime() < 0) { return; - } - long thisDownTime = 0; - long thisEventTime = 0; - long expectedDelay = 0; - - if (mLastRecordedEventTime <= 0) { - // first time event - thisDownTime = SystemClock.uptimeMillis(); - thisEventTime = thisDownTime; - } else { - if (e.getDownTime() != mLastRecordedDownTimeMotion) { - thisDownTime = e.getDownTime(); - } else { - thisDownTime = mLastExportDownTimeMotion; - } - expectedDelay = (long) ((e.getEventTime() - mLastRecordedEventTime) * mSpeed); - thisEventTime = mLastExportEventTime + expectedDelay; - // add sleep to simulate everything in recording - needSleep(expectedDelay - SLEEP_COMPENSATE_DIFF); - } - - mLastRecordedDownTimeMotion = e.getDownTime(); - mLastRecordedEventTime = e.getEventTime(); - e.setDownTime(thisDownTime); - e.setEventTime(thisEventTime); - mLastExportDownTimeMotion = thisDownTime; - mLastExportEventTime = thisEventTime; + } + updatedDownTime = SystemClock.uptimeMillis(); + e.setDownTime(updatedDownTime); + e.setEventTime(updatedDownTime); } /**