Merge branch 'master' into honeycomb-release
This commit is contained in:
@@ -367,7 +367,12 @@ public class SyncAdapterDriver extends Activity
|
|||||||
com.android.internal.R.styleable.SyncAdapter_userVisible, true);
|
com.android.internal.R.styleable.SyncAdapter_userVisible, true);
|
||||||
final boolean supportsUploading = sa.getBoolean(
|
final boolean supportsUploading = sa.getBoolean(
|
||||||
com.android.internal.R.styleable.SyncAdapter_supportsUploading, true);
|
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 {
|
} finally {
|
||||||
sa.recycle();
|
sa.recycle();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,5 +3,6 @@
|
|||||||
#
|
#
|
||||||
base=/system
|
base=/system
|
||||||
export CLASSPATH=$base/framework/monkey.jar
|
export CLASSPATH=$base/framework/monkey.jar
|
||||||
|
trap "" HUP
|
||||||
exec app_process $base/bin com.android.commands.monkey.Monkey $*
|
exec app_process $base/bin com.android.commands.monkey.Monkey $*
|
||||||
|
|
||||||
|
|||||||
@@ -597,41 +597,19 @@ public class MonkeySourceScript implements MonkeyEventSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adjust motion downtime and eventtime according to both recorded values
|
* Adjust motion downtime and eventtime according to current system time.
|
||||||
* and current system time.
|
|
||||||
*
|
*
|
||||||
* @param e A KeyEvent
|
* @param e A KeyEvent
|
||||||
*/
|
*/
|
||||||
private void adjustMotionEventTime(MonkeyMotionEvent e) {
|
private void adjustMotionEventTime(MonkeyMotionEvent e) {
|
||||||
|
long updatedDownTime = 0;
|
||||||
|
|
||||||
if (e.getEventTime() < 0) {
|
if (e.getEventTime() < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long thisDownTime = 0;
|
updatedDownTime = SystemClock.uptimeMillis();
|
||||||
long thisEventTime = 0;
|
e.setDownTime(updatedDownTime);
|
||||||
long expectedDelay = 0;
|
e.setEventTime(updatedDownTime);
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user