Skip to content

Commit 07b6a5e

Browse files
committed
fix: app not restarted in error activity
1 parent b6646b3 commit 07b6a5e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test-app/app/src/debug/java/com/tns/NativeScriptSyncServiceSocketIml.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ private class LiveSyncWorker implements Runnable {
105105
public static final int CREATE_FILE_OPERATION = 8;
106106
public static final int DO_SYNC_OPERATION = 9;
107107
public static final int ERROR_REPORT_CODE = 1;
108+
public static final int OPERATION_END_NO_REFRESH_REPORT_CODE = 3;
108109
public static final int OPERATION_END_REPORT_CODE = 2;
109110
public static final int REPORT_CODE_SIZE = 1;
110111
public static final String FILE_NAME = "fileName";
@@ -157,13 +158,17 @@ public void run() {
157158

158159
} else if (operation == DO_SYNC_OPERATION) {
159160
byte[] operationUid = readNextBytes(OPERATION_ID_BYTE_SIZE);
161+
int operationReportCode;
160162

161163
validateData();
162164
if(runtime != null) {
163165
runtime.runScript(new File(NativeScriptSyncServiceSocketIml.this.context.getFilesDir(), "internal/livesync.js"));
166+
operationReportCode = OPERATION_END_REPORT_CODE;
167+
} else {
168+
operationReportCode = OPERATION_END_NO_REFRESH_REPORT_CODE;
164169
}
165170

166-
output.write(getReportMessageBytes(OPERATION_END_REPORT_CODE, operationUid));
171+
output.write(getReportMessageBytes(operationReportCode, operationUid));
167172
output.flush();
168173

169174
} else if (operation == DEFAULT_OPERATION) {

0 commit comments

Comments
 (0)