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 eventCounter = 0;
|
||||||
int cycleCounter = 0;
|
int cycleCounter = 0;
|
||||||
|
|
||||||
|
boolean shouldReportAnrTraces = false;
|
||||||
|
boolean shouldReportDumpsysMemInfo = false;
|
||||||
|
boolean shouldAbort = false;
|
||||||
boolean systemCrashed = false;
|
boolean systemCrashed = false;
|
||||||
|
|
||||||
while (!systemCrashed && cycleCounter < mCount) {
|
while (!systemCrashed && cycleCounter < mCount) {
|
||||||
@@ -866,12 +869,12 @@ public class Monkey {
|
|||||||
mRequestProcRank = false;
|
mRequestProcRank = false;
|
||||||
}
|
}
|
||||||
if (mRequestAnrTraces) {
|
if (mRequestAnrTraces) {
|
||||||
reportAnrTraces();
|
|
||||||
mRequestAnrTraces = false;
|
mRequestAnrTraces = false;
|
||||||
|
shouldReportAnrTraces = true;
|
||||||
}
|
}
|
||||||
if (mRequestDumpsysMemInfo) {
|
if (mRequestDumpsysMemInfo) {
|
||||||
reportDumpsysMemInfo();
|
|
||||||
mRequestDumpsysMemInfo = false;
|
mRequestDumpsysMemInfo = false;
|
||||||
|
shouldReportDumpsysMemInfo = true;
|
||||||
}
|
}
|
||||||
if (mMonitorNativeCrashes) {
|
if (mMonitorNativeCrashes) {
|
||||||
// first time through, when eventCounter == 0, just set up
|
// first time through, when eventCounter == 0, just set up
|
||||||
@@ -882,11 +885,28 @@ public class Monkey {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mAbort) {
|
if (mAbort) {
|
||||||
|
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("** Monkey aborted due to error.");
|
||||||
System.out.println("Events injected: " + eventCounter);
|
System.out.println("Events injected: " + eventCounter);
|
||||||
return eventCounter;
|
return eventCounter;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// In this debugging mode, we never send any events. This is
|
// In this debugging mode, we never send any events. This is
|
||||||
// primarily here so you can manually test the package or category
|
// primarily here so you can manually test the package or category
|
||||||
|
|||||||
Reference in New Issue
Block a user