From 952cb1f15a004ee5407e3f0c4a5d5229f5e392db Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Fri, 26 Feb 2016 17:24:10 -0800 Subject: [PATCH] Fix issue #27385109: control activity behavior without triggering... ...isUserAMonkey for testing purpose Change-Id: If261bc860d3974796ec382dcd5f625d40ab093a5 --- .../src/com/android/development/BadBehaviorActivity.java | 6 +++--- cmds/monkey/src/com/android/commands/monkey/Monkey.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/Development/src/com/android/development/BadBehaviorActivity.java b/apps/Development/src/com/android/development/BadBehaviorActivity.java index d34c3132e..e33c758de 100644 --- a/apps/Development/src/com/android/development/BadBehaviorActivity.java +++ b/apps/Development/src/com/android/development/BadBehaviorActivity.java @@ -77,7 +77,7 @@ public class BadBehaviorActivity extends Activity { public boolean activityStarting(Intent intent, String pkg) { try { - ActivityManagerNative.getDefault().setActivityController(null); + ActivityManagerNative.getDefault().setActivityController(null, false); } catch (RemoteException e) { Log.e(TAG, "Can't call IActivityManager.setActivityController", e); } @@ -218,7 +218,7 @@ public class BadBehaviorActivity extends Activity { Log.i(TAG, "ANR system pressed -- about to engage"); try { ActivityManagerNative.getDefault().setActivityController( - new BadController(20000)); + new BadController(20000), false); } catch (RemoteException e) { Log.e(TAG, "Can't call IActivityManager.setActivityController", e); } @@ -233,7 +233,7 @@ public class BadBehaviorActivity extends Activity { Log.i(TAG, "Wedge system pressed -- about to engage"); try { ActivityManagerNative.getDefault().setActivityController( - new BadController(300000)); + new BadController(300000), false); } catch (RemoteException e) { Log.e(TAG, "Can't call IActivityManager.setActivityController", e); } diff --git a/cmds/monkey/src/com/android/commands/monkey/Monkey.java b/cmds/monkey/src/com/android/commands/monkey/Monkey.java index 93bfcf0bb..a7cacb368 100644 --- a/cmds/monkey/src/com/android/commands/monkey/Monkey.java +++ b/cmds/monkey/src/com/android/commands/monkey/Monkey.java @@ -669,7 +669,7 @@ public class Monkey { } try { - mAm.setActivityController(null); + mAm.setActivityController(null, true); mNetworkMonitor.unregister(mAm); } catch (RemoteException e) { // just in case this was latent (after mCount cycles), make sure @@ -952,7 +952,7 @@ public class Monkey { } try { - mAm.setActivityController(new ActivityController()); + mAm.setActivityController(new ActivityController(), true); mNetworkMonitor.register(mAm); } catch (RemoteException e) { System.err.println("** Failed talking with activity manager!");