am 9c1a73ba: Update Monkey to new StrictMode API.
Merge commit '9c1a73ba8a6b6cee05f235ef71975c427a9f3a3c' into gingerbread-plus-aosp * commit '9c1a73ba8a6b6cee05f235ef71975c427a9f3a3c': Update Monkey to new StrictMode API.
This commit is contained in:
@@ -243,7 +243,7 @@ public class Monkey {
|
|||||||
// redirected to a file?) So we allow disk writes
|
// redirected to a file?) So we allow disk writes
|
||||||
// around this region for the monkey to minimize
|
// around this region for the monkey to minimize
|
||||||
// harmless dropbox uploads from monkeys.
|
// harmless dropbox uploads from monkeys.
|
||||||
int savedPolicy = StrictMode.allowThreadDiskWrites();
|
StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskWrites();
|
||||||
System.out.println(" // " + (allow ? "Allowing" : "Rejecting") + " start of "
|
System.out.println(" // " + (allow ? "Allowing" : "Rejecting") + " start of "
|
||||||
+ intent + " in package " + pkg);
|
+ intent + " in package " + pkg);
|
||||||
StrictMode.setThreadPolicy(savedPolicy);
|
StrictMode.setThreadPolicy(savedPolicy);
|
||||||
@@ -254,7 +254,7 @@ public class Monkey {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean activityResuming(String pkg) {
|
public boolean activityResuming(String pkg) {
|
||||||
int savedPolicy = StrictMode.allowThreadDiskWrites();
|
StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskWrites();
|
||||||
System.out.println(" // activityResuming(" + pkg + ")");
|
System.out.println(" // activityResuming(" + pkg + ")");
|
||||||
boolean allow = checkEnteringPackage(pkg) || (DEBUG_ALLOW_ANY_RESTARTS != 0);
|
boolean allow = checkEnteringPackage(pkg) || (DEBUG_ALLOW_ANY_RESTARTS != 0);
|
||||||
if (!allow) {
|
if (!allow) {
|
||||||
@@ -271,7 +271,7 @@ public class Monkey {
|
|||||||
public boolean appCrashed(String processName, int pid,
|
public boolean appCrashed(String processName, int pid,
|
||||||
String shortMsg, String longMsg,
|
String shortMsg, String longMsg,
|
||||||
long timeMillis, String stackTrace) {
|
long timeMillis, String stackTrace) {
|
||||||
int savedPolicy = StrictMode.allowThreadDiskWrites();
|
StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskWrites();
|
||||||
System.err.println("// CRASH: " + processName + " (pid " + pid + ")");
|
System.err.println("// CRASH: " + processName + " (pid " + pid + ")");
|
||||||
System.err.println("// Short Msg: " + shortMsg);
|
System.err.println("// Short Msg: " + shortMsg);
|
||||||
System.err.println("// Long Msg: " + longMsg);
|
System.err.println("// Long Msg: " + longMsg);
|
||||||
@@ -296,7 +296,7 @@ public class Monkey {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int appNotResponding(String processName, int pid, String processStats) {
|
public int appNotResponding(String processName, int pid, String processStats) {
|
||||||
int savedPolicy = StrictMode.allowThreadDiskWrites();
|
StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskWrites();
|
||||||
System.err.println("// NOT RESPONDING: " + processName + " (pid " + pid + ")");
|
System.err.println("// NOT RESPONDING: " + processName + " (pid " + pid + ")");
|
||||||
System.err.println(processStats);
|
System.err.println(processStats);
|
||||||
StrictMode.setThreadPolicy(savedPolicy);
|
StrictMode.setThreadPolicy(savedPolicy);
|
||||||
@@ -1200,4 +1200,3 @@ public class Monkey {
|
|||||||
System.err.println(usage.toString());
|
System.err.println(usage.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user