1919import java .util .Collections ;
2020import java .util .List ;
2121
22+ import cn .leancloud .annotation .RestrictTo ;
23+
24+ import static cn .leancloud .annotation .RestrictTo .Scope .GROUP_ID ;
25+
2226/**
2327 * Helper for accessing features in {@link android.app.Notification}
2428 * introduced after API level 4 in a backwards compatible fashion.
@@ -425,6 +429,7 @@ NotificationCompatBase.UnreadConversation getUnreadConversationFromBundle(
425429 *
426430 * @hide
427431 */
432+ @ RestrictTo (GROUP_ID )
428433 protected static class BuilderExtender {
429434 public Notification build (Builder b , NotificationBuilderWithBuilderAccessor builder ) {
430435 Notification n = builder .build ();
@@ -846,29 +851,39 @@ public static class Builder {
846851 // All these variables are declared public/hidden so they can be accessed by a builder
847852 // extender.
848853 /** @hide */
854+ @ RestrictTo (GROUP_ID )
849855 public Context mContext ;
850856 /** @hide */
857+ @ RestrictTo (GROUP_ID )
851858 public CharSequence mContentTitle ;
852859 /** @hide */
860+ @ RestrictTo (GROUP_ID )
853861 public CharSequence mContentText ;
854862 PendingIntent mContentIntent ;
855863 PendingIntent mFullScreenIntent ;
856864 RemoteViews mTickerView ;
857865 /** @hide */
866+ @ RestrictTo (GROUP_ID )
858867 public Bitmap mLargeIcon ;
859868 /** @hide */
869+ @ RestrictTo (GROUP_ID )
860870 public CharSequence mContentInfo ;
861871 /** @hide */
872+ @ RestrictTo (GROUP_ID )
862873 public int mNumber ;
863874 int mPriority ;
864875 boolean mShowWhen = true ;
865876 /** @hide */
877+ @ RestrictTo (GROUP_ID )
866878 public boolean mUseChronometer ;
867879 /** @hide */
880+ @ RestrictTo (GROUP_ID )
868881 public Style mStyle ;
869882 /** @hide */
883+ @ RestrictTo (GROUP_ID )
870884 public CharSequence mSubText ;
871885 /** @hide */
886+ @ RestrictTo (GROUP_ID )
872887 public CharSequence [] mRemoteInputHistory ;
873888 int mProgressMax ;
874889 int mProgress ;
@@ -877,6 +892,7 @@ public static class Builder {
877892 boolean mGroupSummary ;
878893 String mSortKey ;
879894 /** @hide */
895+ @ RestrictTo (GROUP_ID )
880896 public ArrayList <Action > mActions = new ArrayList <Action >();
881897 boolean mLocalOnly = false ;
882898 String mCategory ;
@@ -888,6 +904,7 @@ public static class Builder {
888904 RemoteViews mBigContentView ;
889905 RemoteViews mHeadsUpContentView ;
890906 /** @hide */
907+ @ RestrictTo (GROUP_ID )
891908 public Notification mNotification = new Notification ();
892909 public ArrayList <String > mPeople ;
893910 /**
@@ -1537,6 +1554,7 @@ public Notification build() {
15371554 /**
15381555 * @hide
15391556 */
1557+ @ RestrictTo (GROUP_ID )
15401558 protected BuilderExtender getExtender () {
15411559 return new BuilderExtender ();
15421560 }
@@ -1550,20 +1568,21 @@ protected static CharSequence limitCharSequenceLength(CharSequence cs) {
15501568 /**
15511569 * @hide
15521570 */
1571+ @ RestrictTo (GROUP_ID )
15531572 public RemoteViews getContentView () {
15541573 return mContentView ;
15551574 }
15561575 /**
15571576 * @hide
15581577 */
1559-
1578+ @ RestrictTo ( GROUP_ID )
15601579 public RemoteViews getBigContentView () {
15611580 return mBigContentView ;
15621581 }
15631582 /**
15641583 * @hide
15651584 */
1566-
1585+ @ RestrictTo ( GROUP_ID )
15671586 public RemoteViews getHeadsUpContentView () {
15681587 return mHeadsUpContentView ;
15691588 }
@@ -1572,7 +1591,7 @@ public RemoteViews getHeadsUpContentView() {
15721591 *
15731592 * @hide
15741593 */
1575-
1594+ @ RestrictTo ( GROUP_ID )
15761595 public long getWhenIfShowing () {
15771596 return mShowWhen ? mNotification .when : 0 ;
15781597 }
@@ -1581,7 +1600,7 @@ public long getWhenIfShowing() {
15811600 *
15821601 * @hide
15831602 */
1584-
1603+ @ RestrictTo ( GROUP_ID )
15851604 public int getPriority () {
15861605 return mPriority ;
15871606 }
@@ -1590,7 +1609,7 @@ public int getPriority() {
15901609 *
15911610 * @hide
15921611 */
1593-
1612+ @ RestrictTo ( GROUP_ID )
15941613 public int getColor () {
15951614 return mColor ;
15961615 }
@@ -1599,7 +1618,7 @@ public int getColor() {
15991618 *
16001619 * @hide
16011620 */
1602-
1621+ @ RestrictTo ( GROUP_ID )
16031622 protected CharSequence resolveText () {
16041623 return mContentText ;
16051624 }
@@ -1608,7 +1627,7 @@ protected CharSequence resolveText() {
16081627 *
16091628 * @hide
16101629 */
1611-
1630+ @ RestrictTo ( GROUP_ID )
16121631 protected CharSequence resolveTitle () {
16131632 return mContentTitle ;
16141633 }
@@ -1643,14 +1662,14 @@ public Notification build() {
16431662 /**
16441663 * @hide
16451664 */
1646-
1665+ @ RestrictTo ( GROUP_ID )
16471666 // TODO: implement for all styles
16481667 public void addCompatExtras (Bundle extras ) {
16491668 }
16501669 /**
16511670 * @hide
16521671 */
1653-
1672+ @ RestrictTo ( GROUP_ID )
16541673 // TODO: implement for all styles
16551674 protected void restoreFromCompatExtras (Bundle extras ) {
16561675 }
@@ -1914,7 +1933,7 @@ public void addCompatExtras(Bundle extras) {
19141933 /**
19151934 * @hide
19161935 */
1917-
1936+ @ RestrictTo ( GROUP_ID )
19181937 @ Override
19191938 protected void restoreFromCompatExtras (Bundle extras ) {
19201939 mMessages .clear ();
@@ -2532,7 +2551,7 @@ public boolean getHintDisplayActionInline() {
25322551 }
25332552 }
25342553 /** @hide */
2535-
2554+ @ RestrictTo ( GROUP_ID )
25362555 public static final Factory FACTORY = new Factory () {
25372556 @ Override
25382557 public NotificationCompatBase .Action build (int icon , CharSequence title ,
0 commit comments