bypass android notification updates rate limits

This commit is contained in:
aliveoutside
2022-09-16 00:37:08 +03:00
parent 22e12b6422
commit 24c41e5a6d
@@ -50,11 +50,23 @@ public class AudioDownloader {
var downloadPath = musicPath + File.separator + tempId;
var notification = buildDownloadNotification(track, tempId);
downloadM3U8(track, downloadPath, new Callback() {
long startTime = 0;
long elapsedTime = 0;
@Override
public void onProgress(int progress) {
notification.setProgress(100, progress, false);
notificationManager.notify(tempId, notification.build());
if (elapsedTime > 1000) {
notification.setProgress(100, progress, false);
notificationManager.notify(tempId, notification.build());
startTime = System.currentTimeMillis();
elapsedTime = 0;
} else {
elapsedTime = System.currentTimeMillis() - startTime;
}
}
@Override