Skip to content

Commit f0c4ca6

Browse files
committed
change type background service
1 parent b05a73d commit f0c4ca6

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

qasdk/src/main/java/co/astrnt/qasdk/upload/SingleVideoUploadService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public void doUploadVideo() {
259259
} catch (Exception exc) {
260260
LogUtil.addNewLog(interviewApiDao.getInterviewCode(),
261261
new LogDao("Background Upload (Exc)",
262-
exc.getMessage())
262+
exc.getMessage() + " (Exc)")
263263
);
264264
stopService();
265265
}

qasdk/src/main/java/co/astrnt/qasdk/videocompressor/OutputSurface.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public void awaitNewImage() {
150150
try {
151151
mFrameSyncObject.wait(TIMEOUT_MS);
152152
if (!mFrameAvailable) {
153-
Timber.i("urface frame wait timed out");
153+
Timber.i("Surface frame wait timed out");
154154
}
155155
} catch (InterruptedException ie) {
156156
throw new RuntimeException(ie);

qasdk/src/main/java/co/astrnt/qasdk/videocompressor/services/VideoCompressService.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,15 @@ public static void start(Context context, String inputPath, long questionId, Str
6464
Intent intent = new Intent(context, VideoCompressService.class)
6565
.putExtra(EXT_PATH, inputPath)
6666
.putExtra(EXT_QUESTION_ID, questionId);
67-
ContextCompat.startForegroundService(context, intent);
67+
if (context != null && intent != null && inputPath != null) {
68+
ContextCompat.startForegroundService(context, intent);
69+
} else {
70+
LogUtil.addNewLog(interviewCode,
71+
new LogDao("Failed to start compress",
72+
"Null parsing data"
73+
)
74+
);
75+
}
6876
} catch (Exception e){
6977
LogUtil.addNewLog(interviewCode,
7078
new LogDao("Failed to start compress",
@@ -85,7 +93,7 @@ public int onStartCommand(Intent intent, int flags, int startId) {
8593
currentInterview = astrntSDK.getCurrentInterview();
8694
currentQuestion = astrntSDK.searchQuestionById(questionId);
8795
}
88-
return START_STICKY;
96+
return START_REDELIVER_INTENT;
8997
}
9098

9199
@Override

0 commit comments

Comments
 (0)