Merge pull request #1690 from mfietz/issue/1685-public-notificationsa

Set notification visibility to public
This commit is contained in:
Tom Hennen 2016-02-20 10:53:10 -05:00
commit 32f124f810
2 changed files with 9 additions and 4 deletions

View File

@ -13,7 +13,6 @@ import android.util.Log;
import android.util.Pair; import android.util.Pair;
import java.util.Collection; import java.util.Collection;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -315,6 +314,7 @@ public class GpodnetSyncService extends Service {
.setContentIntent(activityIntent) .setContentIntent(activityIntent)
.setSmallIcon(R.drawable.stat_notify_sync_error) .setSmallIcon(R.drawable.stat_notify_sync_error)
.setAutoCancel(true) .setAutoCancel(true)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.build(); .build();
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(id, notification); nm.notify(id, notification);

View File

@ -350,7 +350,9 @@ public class DownloadService extends Service {
.setOngoing(true) .setOngoing(true)
.setContentIntent(ClientConfig.downloadServiceCallbacks.getNotificationContentIntent(this)) .setContentIntent(ClientConfig.downloadServiceCallbacks.getNotificationContentIntent(this))
.setLargeIcon(icon) .setLargeIcon(icon)
.setSmallIcon(R.drawable.stat_notify_sync); .setSmallIcon(R.drawable.stat_notify_sync)
.setVisibility(Notification.VISIBILITY_PUBLIC);
Log.d(TAG, "Notification set up"); Log.d(TAG, "Notification set up");
} }
@ -556,7 +558,9 @@ public class DownloadService extends Service {
.setContentIntent( .setContentIntent(
ClientConfig.downloadServiceCallbacks.getReportNotificationContentIntent(this) ClientConfig.downloadServiceCallbacks.getReportNotificationContentIntent(this)
) )
.setAutoCancel(true).build(); .setAutoCancel(true)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.build();
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(REPORT_ID, notification); nm.notify(REPORT_ID, notification);
} else { } else {
@ -609,7 +613,8 @@ public class DownloadService extends Service {
.setSmallIcon(R.drawable.ic_stat_authentication) .setSmallIcon(R.drawable.ic_stat_authentication)
.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_stat_authentication)) .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_stat_authentication))
.setAutoCancel(true) .setAutoCancel(true)
.setContentIntent(ClientConfig.downloadServiceCallbacks.getAuthentificationNotificationContentIntent(DownloadService.this, downloadRequest)); .setContentIntent(ClientConfig.downloadServiceCallbacks.getAuthentificationNotificationContentIntent(DownloadService.this, downloadRequest))
.setVisibility(Notification.VISIBILITY_PUBLIC);
Notification n = builder.build(); Notification n = builder.build();
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(downloadRequest.getSource().hashCode(), n); nm.notify(downloadRequest.getSource().hashCode(), n);