Commit fa5d73cc authored by Geoffrey Métais's avatar Geoffrey Métais

Media style notifs for everyone on Lollipop+

Some manufacturers where banned from having a mediastyle notification.
Let's assume starting Lollipop they did things right
parent c55db04a
......@@ -79,13 +79,11 @@ public class NotificationHelper {
builder.addAction(R.drawable.ic_widget_next_w, ctx.getString(R.string.next), piForward);
builder.addAction(R.drawable.ic_widget_close_w, ctx.getString(R.string.stop), piStop);
if (AndroidDevices.showMediaStyle) {
final Notification.MediaStyle ms = new Notification.MediaStyle()
.setShowActionsInCompactView(0,1,2);
if (sessionToken != null)
ms.setMediaSession((MediaSession.Token) sessionToken.getToken());
builder.setStyle(ms);
}
final Notification.MediaStyle ms = new Notification.MediaStyle()
.setShowActionsInCompactView(0,1,2);
if (sessionToken != null)
ms.setMediaSession((MediaSession.Token) sessionToken.getToken());
builder.setStyle(ms);
return builder.build();
} else {
final NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx);
......
......@@ -204,9 +204,10 @@ public class AndroidDevices {
}
private static boolean isManufacturerBannedForMediastyleNotifications() {
for (String manufacturer : noMediaStyleManufacturers)
if (Build.MANUFACTURER.toLowerCase(Locale.getDefault()).contains(manufacturer))
return true;
if (!AndroidUtil.isLolliPopOrLater)
for (String manufacturer : noMediaStyleManufacturers)
if (Build.MANUFACTURER.toLowerCase(Locale.getDefault()).contains(manufacturer))
return true;
return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment