Skip to content

Commit

Permalink
Merge pull request #50 from apivideo/bugfix/android_service_test
Browse files Browse the repository at this point in the history
fix(java): fix Android service test
  • Loading branch information
bot-api-video authored Sep 1, 2022
2 parents 1e43e38 + e8154a4 commit 05bda8a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CustomUploaderService : UploadService(
/**
* You can override each of [UploadService] notification methods to customize notifications.
*/
override fun onUploadSuccessNotification(video: Video): Notification {
override fun onUploadSuccessNotification(id: String, video: Video): Notification {
// Return your custom the notification
return NotificationCompat.Builder(this, channelId)
.setStyle(notificationIconResourceId, notificationColorResourceId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void onLastUpload() {
}

@Override
public void onUploadComplete(@NonNull Video video) {
public void onUploadComplete(@NonNull String id, @NonNull Video video) {
successLatch.countDown();
}

Expand Down Expand Up @@ -138,7 +138,7 @@ public void onLastUpload() {
}

@Override
public void onUploadComplete(@NonNull Video video) {
public void onUploadComplete(@NonNull String id, @NonNull Video video) {
successLatch.countDown();
}

Expand Down Expand Up @@ -186,7 +186,7 @@ public void onLastUpload() {
}

@Override
public void onUploadComplete(@NonNull Video video) {
public void onUploadComplete(@NonNull String id, @NonNull Video video) {
successLatch.countDown();
}

Expand Down Expand Up @@ -261,7 +261,7 @@ public void onLastUpload() {
}

@Override
public void onUploadComplete(@NonNull Video video) {
public void onUploadComplete(@NonNull String id, @NonNull Video video) {
successLatch.countDown();
}

Expand Down Expand Up @@ -335,7 +335,7 @@ public void onLastUpload() {
}

@Override
public void onUploadComplete(@NonNull Video video) {
public void onUploadComplete(@NonNull String id, @NonNull Video video) {
successLatch.countDown();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public Notification onUploadStartedNotification(@NonNull String id) {

@Nullable
@Override
public Notification onUploadSuccessNotification(@NonNull Video video) {
public Notification onUploadSuccessNotification(@NonNull String id, @NonNull Video video) {
return null;
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/video/api/client/api/services/UploadService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ open class UploadService(

override fun onUploadComplete(id: String, video: Video) {
_numOfUploaded++
onUploadSuccessNotification(video)?.let { notify(it) }
onUploadSuccessNotification(id, video)?.let { notify(it) }
listeners.forEach { it.onUploadComplete(id, video) }

if (!hasRemaining) {
Expand Down Expand Up @@ -274,7 +274,7 @@ open class UploadService(
* @param video The video instance (contains info incl. the video id)
* @return The notification to be displayed or null
*/
open fun onUploadSuccessNotification(video: Video): Notification? = null
open fun onUploadSuccessNotification(id: String, video: Video): Notification? = null

/**
* Called when the queue has no more file to upload
Expand Down

0 comments on commit 05bda8a

Please sign in to comment.