Skip to content

Commit 4dfbe83

Browse files
committed
Unhide some new Notification APIs.
Bug: 6318391 Change-Id: Ie51f373cc84d845fa4aababab702c115fcc9e2e5
1 parent 92bb93e commit 4dfbe83

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

api/current.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3686,6 +3686,7 @@ package android.app {
36863686
field public static final int PRIORITY_MIN = -2; // 0xfffffffe
36873687
field public static final int STREAM_DEFAULT = -1; // 0xffffffff
36883688
field public int audioStreamType;
3689+
field public android.widget.RemoteViews bigContentView;
36893690
field public android.app.PendingIntent contentIntent;
36903691
field public android.widget.RemoteViews contentView;
36913692
field public int defaults;
@@ -3708,6 +3709,18 @@ package android.app {
37083709
field public long when;
37093710
}
37103711

3712+
public static class Notification.BigPictureStyle {
3713+
ctor public Notification.BigPictureStyle(android.app.Notification.Builder);
3714+
method public android.app.Notification.BigPictureStyle bigPicture(android.graphics.Bitmap);
3715+
method public android.app.Notification build();
3716+
}
3717+
3718+
public static class Notification.BigTextStyle {
3719+
ctor public Notification.BigTextStyle(android.app.Notification.Builder);
3720+
method public android.app.Notification.BigTextStyle bigText(java.lang.CharSequence);
3721+
method public android.app.Notification build();
3722+
}
3723+
37113724
public static class Notification.Builder {
37123725
ctor public Notification.Builder(android.content.Context);
37133726
method public android.app.Notification.Builder addAction(int, java.lang.CharSequence, android.app.PendingIntent);
@@ -3737,6 +3750,7 @@ package android.app {
37373750
method public android.app.Notification.Builder setSubText(java.lang.CharSequence);
37383751
method public android.app.Notification.Builder setTicker(java.lang.CharSequence);
37393752
method public android.app.Notification.Builder setTicker(java.lang.CharSequence, android.widget.RemoteViews);
3753+
method public android.app.Notification.Builder setUsesChronometer(boolean);
37403754
method public android.app.Notification.Builder setUsesIntruderAlert(boolean);
37413755
method public android.app.Notification.Builder setVibrate(long[]);
37423756
method public android.app.Notification.Builder setWhen(long);

core/java/android/app/Notification.java

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,9 @@ public class Notification implements Parcelable
196196
public RemoteViews intruderView;
197197

198198
/**
199-
* A larger version of {@link #contentView}, giving the Notification an
199+
* A large-format version of {@link #contentView}, giving the Notification an
200200
* opportunity to show more detail. The system UI may choose to show this
201201
* instead of the normal content view at its discretion.
202-
* @hide
203202
*/
204203
public RemoteViews bigContentView;
205204

@@ -987,8 +986,6 @@ public Builder setWhen(long when) {
987986
}
988987

989988
/**
990-
* @hide
991-
*
992989
* Show the {@link Notification#when} field as a countdown (or count-up) timer instead of a timestamp.
993990
*
994991
* @see Notification#when
@@ -1609,23 +1606,21 @@ public Notification getNotification() {
16091606
}
16101607

16111608
/**
1612-
* @hide because this API is still very rough
1609+
* Helper class for generating large-format notifications that include a large image attachment.
16131610
*
1614-
* This is a "rebuilder": It consumes a Builder object and modifies its output.
1615-
*
1616-
* This represents the "big picture" style notification, with a large Bitmap atop the usual notification.
1617-
*
1618-
* Usage:
1611+
* This class is a "rebuilder": It consumes a Builder object and modifies its behavior, like so:
16191612
* <pre class="prettyprint">
16201613
* Notification noti = new Notification.BigPictureStyle(
16211614
* new Notification.Builder()
1622-
* .setContentTitle(&quot;New mail from &quot; + sender.toString())
1615+
* .setContentTitle(&quot;New photo from &quot; + sender.toString())
16231616
* .setContentText(subject)
1624-
* .setSmallIcon(R.drawable.new_mail)
1617+
* .setSmallIcon(R.drawable.new_post)
16251618
* .setLargeIcon(aBitmap))
16261619
* .bigPicture(aBigBitmap)
16271620
* .build();
16281621
* </pre>
1622+
*
1623+
* @see Notification#bigContentView
16291624
*/
16301625
public static class BigPictureStyle {
16311626
private Builder mBuilder;
@@ -1656,13 +1651,9 @@ public Notification build() {
16561651
}
16571652

16581653
/**
1659-
* @hide because this API is still very rough
1660-
*
1661-
* This is a "rebuilder": It consumes a Builder object and modifies its output.
1654+
* Helper class for generating large-format notifications that include a lot of text.
16621655
*
1663-
* This represents the "big text" style notification, with more area for the main content text to be read in its entirety.
1664-
*
1665-
* Usage:
1656+
* This class is a "rebuilder": It consumes a Builder object and modifies its behavior, like so:
16661657
* <pre class="prettyprint">
16671658
* Notification noti = new Notification.BigPictureStyle(
16681659
* new Notification.Builder()
@@ -1673,6 +1664,8 @@ public Notification build() {
16731664
* .bigText(aVeryLongString)
16741665
* .build();
16751666
* </pre>
1667+
*
1668+
* @see Notification#bigContentView
16761669
*/
16771670
public static class BigTextStyle {
16781671
private Builder mBuilder;

0 commit comments

Comments
 (0)