question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Continuous Notification tone while doing Binary Upload - Android SDK 26

See original GitHub issue

What did you expect?

No Notification tone while Upload is in progress

What happened instead?

Non-stop Notification tone while uploading is in progress

Version info

  • Android Upload Service version: 3.4
  • Android version and API version: 26
  • HTTP stack (e.g. HurlStack or OkHttpStack): As mentioned in the Wiki, OkHttpStack

Steps to reproduce (if applicable):

Library initialization code:

// the code you wrote in your Application subclass here
UploadService.NAMESPACE = BuildConfig.APPLICATION_ID;
UploadService.HTTP_STACK = new OkHttpStack();

Request code:

// the code you wrote to create the upload request

final String uploadId =
                    new BinaryUploadRequest(HomeActivity.this, getUploadUrlResponse.getUploadUrl())
                            .setMethod("PUT")
                            .setFileToUpload(file.getPath())
                            .addHeader("Content-Type", "video/mp4")
                            .setNotificationConfig(new UploadNotificationConfig())
                            .setMaxRetries(2)
                            .setDelegate(
                                    new UploadStatusDelegate() {
                                        @Override
                                        public void onProgress(Context context, UploadInfo uploadInfo) {
                                            Log.e("PROGRESS", uploadInfo.getProgressPercent()+"");
                                        }

                                        @Override
                                        public void onError(Context context, UploadInfo uploadInfo, ServerResponse serverResponse, Exception exception) {
                                            Log.e("error upload", exception.toString()+"");
                                        }

                                        @Override
                                        public void onCompleted(Context context, UploadInfo uploadInfo, ServerResponse serverResponse) {
                                            confirmUploadToAWS();
                                        }

                                        @Override
                                        public void onCancelled(Context context, UploadInfo uploadInfo) {

                                        }
                                    }
                            ).startUpload();

Where have you added the request code?

  • [Y] Activity
  • Service
  • Other class (add additional info about it)

LogCat output (please set log level to DEBUG first)

// your LogCat output here
0-16 21:21:21.154 23431-23431/ D/UploadService: UploadRequest - null or empty upload ID. Generating it
10-16 21:21:21.154 23431-23431/ D/UploadService: UploadRequest - Created new upload request to https://jwplatform-upload.s3-accelerate.amazonaws.com/va52k9rl?AWSAccessKeyId=AKIAJLA3WHIZCXPXC3NQ&Expires=1508255481&Signature=YvJ9UwykZk578V8Wdx8PmWJU6e8%3D with ID: 35f3e048-3358-49b4-831e-e1d80329d447
10-16 21:21:21.178 23431-23431/ I/UploadService: UploadService - Starting service with namespace: xxxxxx, upload pool size: 4, 5s idle thread keep alive time. Foreground execution is enabled
10-16 21:21:21.182 23431-23431/ D/UploadService: UploadService - Successfully created new task with class: net.gotev.uploadservice.BinaryUploadTask
10-16 21:21:21.187 23431-23928/ D/UploadService: UploadService - 35f3e048-3358-49b4-831e-e1d80329d447 now holds the foreground notification
10-16 21:21:21.191 23431-23928/ D/UploadService: HttpUploadTask - Starting upload task with ID 35f3e048-3358-49b4-831e-e1d80329d447
10-16 21:21:21.191 23431-23928/ D/UploadService: OkHttpStackConnection - creating new connection
10-16 21:21:21.668 23431-23928/ D/UploadService: UploadTask - Broadcasting upload progress for 35f3e048-3358-49b4-831e-e1d80329d447: 4096 bytes of 12022516
10-16 21:21:21.957 23431-23928/ D/UploadService: UploadTask - Broadcasting upload progress for 35f3e048-3358-49b4-831e-e1d80329d447: 684032 bytes of 12022516
10-16 21:21:22.123 23431-23928/ D/UploadService: UploadTask - Broadcasting upload progress for 35f3e048-3358-49b4-831e-e1d80329d447: 1814528 bytes of 12022516
10-16 21:21:22.604 23431-23928/ D/UploadService: UploadTask - Broadcasting upload progress for 35f3e048-3358-49b4-831e-e1d80329d447: 2834432 bytes of 12022516
10-16 21:21:23.295 23431-23928/ D/UploadService: UploadTask - Broadcasting upload progress for 35f3e048-3358-49b4-831e-e1d80329d447: 3739648 bytes of 12022516
10-16 21:21:24.327 23431-23928/ D/UploadService: UploadTask - Broadcasting upload progress for 35f3e048-3358-49b4-831e-e1d80329d447: 4952064 bytes of 12022516
10-16 21:21:25.330 23431-23928/ D/UploadService: UploadTask - Broadcasting upload progress for 35f3e048-3358-49b4-831e-e1d80329d447: 6475776 bytes of 12022516
10-16 21:21:25.997 23431-23928/ D/UploadService: UploadTask - Broadcasting upload progress for 35f3e048-3358-49b4-831e-e1d80329d447: 8167424 bytes of 12022516
10-16 21:21:26.629 23431-23928/ D/UploadService: UploadTask - Broadcasting upload progress for 35f3e048-3358-49b4-831e-e1d80329d447: 9400320 bytes of 12022516
10-16 21:21:27.230 23431-23928/ D/UploadService: UploadTask - Broadcasting upload progress for 35f3e048-3358-49b4-831e-e1d80329d447: 10473472 bytes of 12022516
10-16 21:21:27.829 23431-23928/ D/UploadService: UploadTask - Broadcasting upload progress for 35f3e048-3358-49b4-831e-e1d80329d447: 11546624 bytes of 12022516
10-16 21:21:29.661 23431-23928/ D/UploadService: HttpUploadTask - Server responded with HTTP 200 to upload with ID: 35f3e048-3358-49b4-831e-e1d80329d447
10-16 21:21:29.662 23431-23928/ D/UploadService: UploadTask - Broadcasting upload completed for 35f3e048-3358-49b4-831e-e1d80329d447
10-16 21:21:29.679 23431-23928/ D/UploadService: UploadService - 35f3e048-3358-49b4-831e-e1d80329d447 now un-holded the foreground notification
10-16 21:21:29.679 23431-23928/ D/UploadService: UploadService - All tasks completed, stopping foreground execution
10-16 21:21:29.700 23431-23928/ I/UploadService: UploadService - Service will be shut down in 10000ms if no new tasks are received
10-16 21:21:29.706 23431-23928/ D/UploadService: OkHttpStackConnection - closing connection
10-16 21:21:39.706 23431-24183/ I/UploadService: UploadService - Service is about to be stopped because idle timeout of 10000ms has been reached
10-16 21:21:39.717 23431-23431/ D/UploadService: UploadService - Stopping foreground execution
10-16 21:21:39.720 23431-23431/ D/UploadService: UploadService - UploadService destroyed

Server side

Which server did you use (e.g. node.js demo server provided in the examples, php script provided in the examples, own implementation)? Uploading to JW Player Server

// your server side script (if applicable)
// do not write any passwords or personal data here.
// If you need to show some code, replace sensible values

Server log (if applicable)

// your server side log here

Additional info

Write some additional information about the error here. Upload also screenshots or other information which may help to reproduce your error or spot a possible bug. Thank you 😃

Link to video https://drive.google.com/open?id=0B7HYEzXsjJJWeFFIWEtLRmJrdFE

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
adam9000commented, Nov 8, 2017

I have the same issue with HTTP multipart/form-data upload.

Only on SDK 26.

0reactions
haikkalantariancommented, Jan 18, 2018

I’m also experiencing this problem on API 27. Notification sound multiple-times per second during binary upload. I even use setRingToneEnabled(false) but no luck.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create and Manage Notification Channels - Android Developers
Starting in Android 8.0 (API level 26), all notifications must be assigned to a channel. For each channel, you can set the visual...
Read more >
Notifications - Expo Documentation
Handle notifications when the app is in foreground,; Imperatively dismiss notifications from Notification Center/tray,; Create, update, delete Android ...
Read more >
Why notification sound for API Level 26 and above not working?
I have this app where i want set custom notification sound,. i have this method that check android version and create notification accordingly.....
Read more >
How do I customize the Push Notification sound?
Push notifications for what? Mostly, people seem to mean email when they say that. If so, select Mail. If you mean something else, ......
Read more >
Android 13 changelog: A deep dive by Mishaal Rahman
In the Android 13 developer documentation, there's a new isAudioDescriptionRequested method in AccessibilityManager that apps can call to determine if the user ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found