File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
cmds/monkey/src/com/android/commands/monkey Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 28
28
import android .os .Process ;
29
29
import android .os .RemoteException ;
30
30
import android .os .ServiceManager ;
31
+ import android .os .SystemProperties ;
31
32
import android .view .IWindowManager ;
32
33
33
34
import java .io .BufferedReader ;
@@ -336,6 +337,15 @@ private void commandLineReport(String reportName, String command) {
336
337
* @param args The command-line arguments
337
338
*/
338
339
public static void main (String [] args ) {
340
+ // Tell the system that Monkey is running.
341
+ SystemProperties .set ("monkey.running" , "true" );
342
+ // Add a hook to tell the system that Monkey has finished running.
343
+ Runtime .getRuntime ().addShutdownHook (new Thread () {
344
+ public void run () {
345
+ SystemProperties .set ("monkey.running" , null );
346
+ }
347
+ });
348
+
339
349
int resultCode = (new Monkey ()).run (args );
340
350
System .exit (resultCode );
341
351
}
You can’t perform that action at this time.
0 commit comments