@@ -313,9 +313,14 @@ public void run()
313313
314314 int getDebuggerPortFromEnvironment ()
315315 {
316+ Log .d (Platform .DEFAULT_LOG_TAG , "getDebuggerPortFromEnvironment" );
316317 int port = INVALID_PORT ;
318+
319+ boolean shouldEnableDebuggingFlag = shouldEnableDebugging (context );
320+
321+ if (Platform .IsLogEnabled ) Log .d (Platform .DEFAULT_LOG_TAG , "getDebuggerPortFromEnvironment:: shouldEnableDebuggingFlag=" + shouldEnableDebuggingFlag );
317322
318- if (shouldEnableDebugging ( context ) )
323+ if (shouldEnableDebuggingFlag )
319324 {
320325 File baseDir = context .getExternalFilesDir (null );
321326 File envOutFile = new File (baseDir , portEnvOutputFile );
@@ -346,8 +351,13 @@ int getDebuggerPortFromEnvironment()
346351 w = null ;
347352 }
348353
349- if (shouldDebugBreak (context ))
354+ boolean shouldDebugBreakFlag = shouldDebugBreak (context );
355+
356+ if (Platform .IsLogEnabled ) Log .d (Platform .DEFAULT_LOG_TAG , "shouldDebugBreakFlag=" + shouldDebugBreakFlag );
357+
358+ if (shouldDebugBreakFlag )
350359 {
360+
351361 try
352362 {
353363 Thread .sleep (3 * 1000 );
@@ -359,7 +369,12 @@ int getDebuggerPortFromEnvironment()
359369 }
360370
361371 File envInFile = new File (baseDir , portEnvInputFile );
362- if (envInFile .exists ())
372+
373+ boolean envInFileFlag = envInFile .exists ();
374+
375+ if (Platform .IsLogEnabled ) Log .d (Platform .DEFAULT_LOG_TAG , "envInFileFlag=" + envInFileFlag );
376+
377+ if (envInFileFlag )
363378 {
364379 BufferedReader reader = null ;
365380 try
@@ -420,6 +435,9 @@ int getDebuggerPortFromEnvironment()
420435 }
421436 }
422437 }
438+
439+ Log .d (Platform .DEFAULT_LOG_TAG , "port=" + port );
440+
423441 return port ;
424442 }
425443
@@ -553,8 +571,8 @@ public static boolean shouldDebugBreak(Context context)
553571 return false ;
554572 }
555573
556- String appRoot = context .getFilesDir (). getPath () + File . separator ;
557- File debugBreakFile = new File (appRoot , DEBUG_BREAK_FILENAME );
574+ File baseDir = context .getExternalFilesDir ( null ) ;
575+ File debugBreakFile = new File (baseDir , DEBUG_BREAK_FILENAME );
558576 if (debugBreakFile .exists ())
559577 {
560578 debugBreakFile .delete ();
0 commit comments