am bd7f8215: am d82b7ec9: Merge "Default MediaStyled notifications to CATEGORY_TRANSPORT" into lmp-dev
* commit 'bd7f8215c9af9c48c4d4bd802d0712a8c0eac66b': Default MediaStyled notifications to CATEGORY_TRANSPORT
This commit is contained in:
@@ -3223,6 +3223,10 @@ public class Notification implements Parcelable
|
||||
* {@link #setShowActionsInCompactView(int...)} you can promote up to 2 actions to be displayed
|
||||
* in the standard view alongside the usual content.
|
||||
*
|
||||
* Notifications created with MediaStyle will have their category set to
|
||||
* {@link Notification#CATEGORY_TRANSPORT CATEGORY_TRANSPORT} unless you set a different
|
||||
* category using {@link Notification.Builder#setCategory(String) setCategory()}.
|
||||
*
|
||||
* Finally, if you attach a {@link android.media.session.MediaSession.Token} using
|
||||
* {@link android.app.Notification.MediaStyle#setMediaSession(MediaSession.Token)},
|
||||
* the System UI can identify this as a notification representing an active media session
|
||||
@@ -3235,9 +3239,9 @@ public class Notification implements Parcelable
|
||||
* .setSmallIcon(R.drawable.ic_stat_player)
|
||||
* .setContentTitle("Track title") // these three lines are optional
|
||||
* .setContentText("Artist - Album") // if you use
|
||||
* .setLargeIcon(albumArtBitmap)) // setMediaSession(token, true)
|
||||
* .setMediaSession(mySession, true)
|
||||
* .setStyle(<b>new Notification.MediaStyle()</b>)
|
||||
* .setLargeIcon(albumArtBitmap)) // setMediaSession(token)
|
||||
* .setStyle(<b>new Notification.MediaStyle()</b>
|
||||
* .setMediaSession(mySession))
|
||||
* .build();
|
||||
* </pre>
|
||||
*
|
||||
@@ -3279,7 +3283,9 @@ public class Notification implements Parcelable
|
||||
public Notification buildStyled(Notification wip) {
|
||||
wip.contentView = makeMediaContentView();
|
||||
wip.bigContentView = makeMediaBigContentView();
|
||||
|
||||
if (wip.category == null) {
|
||||
wip.category = Notification.CATEGORY_TRANSPORT;
|
||||
}
|
||||
return wip;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user