summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorGuang Zhu <guangzhu@google.com>2012-02-27 14:35:49 -0800
committerGuang Zhu <guangzhu@google.com>2012-02-27 14:38:55 -0800
commit73421de1a007184cfef536966a6b7f3a3a2cdc91 (patch)
treef474d770f7524e4a08574bcc78e3ddcc840bc011 /cmds
parenta3b1c787672074f90807f57266c7044955813e38 (diff)
downloadandroid_development-73421de1a007184cfef536966a6b7f3a3a2cdc91.tar.gz
android_development-73421de1a007184cfef536966a6b7f3a3a2cdc91.tar.bz2
android_development-73421de1a007184cfef536966a6b7f3a3a2cdc91.zip
Update the intent that monkey uses to launch application
The purpose of the monkey event is to imitate user action of launching an app from launcher, and apparently launcher is using one extra flag FLAG_ACTIVITY_RESET_TASK_IF_NEEDED Bug: 6007633 Change-Id: Ie42cc84fd6235c9419b96bd9574056ed46687b25
Diffstat (limited to 'cmds')
-rw-r--r--cmds/monkey/src/com/android/commands/monkey/MonkeyActivityEvent.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeyActivityEvent.java b/cmds/monkey/src/com/android/commands/monkey/MonkeyActivityEvent.java
index 75c3a584a..751f4f261 100644
--- a/cmds/monkey/src/com/android/commands/monkey/MonkeyActivityEvent.java
+++ b/cmds/monkey/src/com/android/commands/monkey/MonkeyActivityEvent.java
@@ -26,10 +26,10 @@ import android.view.IWindowManager;
/**
* monkey activity event
*/
-public class MonkeyActivityEvent extends MonkeyEvent {
- private ComponentName mApp;
+public class MonkeyActivityEvent extends MonkeyEvent {
+ private ComponentName mApp;
long mAlarmTime = 0;
-
+
public MonkeyActivityEvent(ComponentName app) {
super(EVENT_TYPE_ACTIVITY);
mApp = app;
@@ -44,11 +44,11 @@ public class MonkeyActivityEvent extends MonkeyEvent {
/**
* @return Intent for the new activity
*/
- private Intent getEvent() {
+ private Intent getEvent() {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setComponent(mApp);
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
return intent;
}