@@ -313,9 +313,14 @@ public void run()
313
313
314
314
int getDebuggerPortFromEnvironment ()
315
315
{
316
+ Log .d (Platform .DEFAULT_LOG_TAG , "getDebuggerPortFromEnvironment" );
316
317
int port = INVALID_PORT ;
318
+
319
+ boolean shouldEnableDebuggingFlag = shouldEnableDebugging (context );
320
+
321
+ if (Platform .IsLogEnabled ) Log .d (Platform .DEFAULT_LOG_TAG , "getDebuggerPortFromEnvironment:: shouldEnableDebuggingFlag=" + shouldEnableDebuggingFlag );
317
322
318
- if (shouldEnableDebugging ( context ) )
323
+ if (shouldEnableDebuggingFlag )
319
324
{
320
325
File baseDir = context .getExternalFilesDir (null );
321
326
File envOutFile = new File (baseDir , portEnvOutputFile );
@@ -346,8 +351,13 @@ int getDebuggerPortFromEnvironment()
346
351
w = null ;
347
352
}
348
353
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 )
350
359
{
360
+
351
361
try
352
362
{
353
363
Thread .sleep (3 * 1000 );
@@ -359,7 +369,12 @@ int getDebuggerPortFromEnvironment()
359
369
}
360
370
361
371
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 )
363
378
{
364
379
BufferedReader reader = null ;
365
380
try
@@ -420,6 +435,9 @@ int getDebuggerPortFromEnvironment()
420
435
}
421
436
}
422
437
}
438
+
439
+ Log .d (Platform .DEFAULT_LOG_TAG , "port=" + port );
440
+
423
441
return port ;
424
442
}
425
443
@@ -553,8 +571,8 @@ public static boolean shouldDebugBreak(Context context)
553
571
return false ;
554
572
}
555
573
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 );
558
576
if (debugBreakFile .exists ())
559
577
{
560
578
debugBreakFile .delete ();
0 commit comments