am 688e62cd: Monkey: Changes to release lock before reporting ANR and meminfo
Merge commit '688e62cd116d0bc17ad162915908764c67dd6045' into gingerbread-plus-aosp * commit '688e62cd116d0bc17ad162915908764c67dd6045': Monkey: Changes to release lock before reporting ANR and meminfo
This commit is contained in:
committed by
Android Git Automerger
commit
474fe56acc
@@ -857,6 +857,9 @@ public class Monkey {
|
||||
int eventCounter = 0;
|
||||
int cycleCounter = 0;
|
||||
|
||||
boolean shouldReportAnrTraces = false;
|
||||
boolean shouldReportDumpsysMemInfo = false;
|
||||
boolean shouldAbort = false;
|
||||
boolean systemCrashed = false;
|
||||
|
||||
while (!systemCrashed && cycleCounter < mCount) {
|
||||
@@ -866,12 +869,12 @@ public class Monkey {
|
||||
mRequestProcRank = false;
|
||||
}
|
||||
if (mRequestAnrTraces) {
|
||||
reportAnrTraces();
|
||||
mRequestAnrTraces = false;
|
||||
shouldReportAnrTraces = true;
|
||||
}
|
||||
if (mRequestDumpsysMemInfo) {
|
||||
reportDumpsysMemInfo();
|
||||
mRequestDumpsysMemInfo = false;
|
||||
shouldReportDumpsysMemInfo = true;
|
||||
}
|
||||
if (mMonitorNativeCrashes) {
|
||||
// first time through, when eventCounter == 0, just set up
|
||||
@@ -882,12 +885,29 @@ public class Monkey {
|
||||
}
|
||||
}
|
||||
if (mAbort) {
|
||||
System.out.println("** Monkey aborted due to error.");
|
||||
System.out.println("Events injected: " + eventCounter);
|
||||
return eventCounter;
|
||||
shouldAbort = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Report ANR, dumpsys after releasing lock on this.
|
||||
// This ensures the availability of the lock to Activity controller's appNotResponding
|
||||
if (shouldReportAnrTraces) {
|
||||
shouldReportAnrTraces = false;
|
||||
reportAnrTraces();
|
||||
}
|
||||
|
||||
if (shouldReportDumpsysMemInfo) {
|
||||
shouldReportDumpsysMemInfo = false;
|
||||
reportDumpsysMemInfo();
|
||||
}
|
||||
|
||||
if (shouldAbort) {
|
||||
shouldAbort = false;
|
||||
System.out.println("** Monkey aborted due to error.");
|
||||
System.out.println("Events injected: " + eventCounter);
|
||||
return eventCounter;
|
||||
}
|
||||
|
||||
// In this debugging mode, we never send any events. This is
|
||||
// primarily here so you can manually test the package or category
|
||||
// limits, while manually exercising the system.
|
||||
|
||||
Reference in New Issue
Block a user