mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-17 12:10:41 +01:00
Merge pull request #268 from nitehu/fix/stuck-notification
Fixed stuck notification
This commit is contained in:
commit
b5bbabf376
@ -149,6 +149,8 @@ public class DownloadServiceImpl extends Service implements DownloadService
|
|||||||
private boolean autoPlayStart;
|
private boolean autoPlayStart;
|
||||||
private final static int lockScreenBitmapSize = 500;
|
private final static int lockScreenBitmapSize = 500;
|
||||||
|
|
||||||
|
private boolean isInForeground = false;
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -719,6 +721,7 @@ public class DownloadServiceImpl extends Service implements DownloadService
|
|||||||
if (tabInstance != null) {
|
if (tabInstance != null) {
|
||||||
if (Util.isNotificationEnabled(this)) {
|
if (Util.isNotificationEnabled(this)) {
|
||||||
startForeground(NOTIFICATION_ID, buildForegroundNotification());
|
startForeground(NOTIFICATION_ID, buildForegroundNotification());
|
||||||
|
isInForeground = true;
|
||||||
}
|
}
|
||||||
tabInstance.showNowPlaying();
|
tabInstance.showNowPlaying();
|
||||||
}
|
}
|
||||||
@ -728,6 +731,7 @@ public class DownloadServiceImpl extends Service implements DownloadService
|
|||||||
if (tabInstance != null)
|
if (tabInstance != null)
|
||||||
{
|
{
|
||||||
stopForeground(true);
|
stopForeground(true);
|
||||||
|
isInForeground = false;
|
||||||
tabInstance.hideNowPlaying();
|
tabInstance.hideNowPlaying();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1252,6 +1256,7 @@ public class DownloadServiceImpl extends Service implements DownloadService
|
|||||||
if (tabInstance != null)
|
if (tabInstance != null)
|
||||||
{
|
{
|
||||||
stopForeground(true);
|
stopForeground(true);
|
||||||
|
isInForeground = false;
|
||||||
tabInstance.hideNowPlaying();
|
tabInstance.hideNowPlaying();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2075,9 +2080,17 @@ public class DownloadServiceImpl extends Service implements DownloadService
|
|||||||
public void updateNotification()
|
public void updateNotification()
|
||||||
{
|
{
|
||||||
if (Util.isNotificationEnabled(this)) {
|
if (Util.isNotificationEnabled(this)) {
|
||||||
final NotificationManagerCompat notificationManager =
|
if (isInForeground == true) {
|
||||||
NotificationManagerCompat.from(this);
|
final NotificationManagerCompat notificationManager =
|
||||||
notificationManager.notify(NOTIFICATION_ID, buildForegroundNotification());
|
NotificationManagerCompat.from(this);
|
||||||
|
notificationManager.notify(NOTIFICATION_ID, buildForegroundNotification());
|
||||||
|
Log.w(TAG, "--- Updated notification");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
startForeground(NOTIFICATION_ID, buildForegroundNotification());
|
||||||
|
isInForeground = true;
|
||||||
|
Log.w(TAG, "--- Created Foreground notification");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,6 +438,10 @@
|
|||||||
|
|
||||||
<string name="feature_flags_image_loader_title">Neuen Bild-Lader aktivieren</string>
|
<string name="feature_flags_image_loader_title">Neuen Bild-Lader aktivieren</string>
|
||||||
<string name="feature_flags_image_loader_description">Neuen Bild-Lader aktivieren. Bilder werden derzeit nur im Chache gespeichert.</string>
|
<string name="feature_flags_image_loader_description">Neuen Bild-Lader aktivieren. Bilder werden derzeit nur im Chache gespeichert.</string>
|
||||||
|
<string name="feature_flags_five_star_rating_title">Verwenden Sie Fünf-Sterne-Bewertung für Songs</string>
|
||||||
|
<string name="feature_flags_five_star_rating_description">Verwenden Sie Fünf-Sterne-Bewertungssystem für Songs
|
||||||
|
anstatt einfach Elemente zu markieren / zu entfernen.
|
||||||
|
</string>
|
||||||
<string name="feature_flags_category_title">Funktionseinstellungem</string>
|
<string name="feature_flags_category_title">Funktionseinstellungem</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user