Skip to content

Commit 948cab3

Browse files
committed
forgotten file
1 parent 16c33c0 commit 948cab3

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

build-artifacts/project-template-gradle/src/main/java/com/tns/AndroidJsDebugger.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,16 +425,31 @@ private boolean getDebugBreakFlagAndClearIt()
425425
}
426426
catch (IOException e)
427427
{
428-
Log.e("TNS", "Debug break temp file can not be marked as used. Debug sessions may not work correctly. file: " + debugBreakFile.getAbsolutePath());
429428
e.printStackTrace();
430429
}
431-
432430
return true;
433431
}
434-
435432
return false;
436433
}
437434

435+
private void setDebuggerStartedFlag()
436+
{
437+
File debugBreakFile = new File("/data/local/tmp", context.getPackageName() + "-debugger-started");
438+
if (debugBreakFile.exists() && !debugBreakFile.isDirectory() && debugBreakFile.length() == 0)
439+
{
440+
try
441+
{
442+
java.io.FileWriter fileWriter = new java.io.FileWriter(debugBreakFile);
443+
fileWriter.write("started");
444+
fileWriter.close();
445+
}
446+
catch (IOException e)
447+
{
448+
e.printStackTrace();
449+
}
450+
}
451+
}
452+
438453
public void start()
439454
{
440455
AndroidJsDebugger.this.debugContext.enableAgent();
@@ -450,6 +465,8 @@ public void start()
450465
{
451466
AndroidJsDebugger.this.debugContext.debugBreak();
452467
}
468+
469+
setDebuggerStartedFlag();
453470
}
454471

455472

0 commit comments

Comments
 (0)