From 5fcdf6e81d86943ff0d6d50cec9b976206978fa5 Mon Sep 17 00:00:00 2001 From: Dan Sandler Date: Fri, 18 Jul 2014 11:31:15 -0400 Subject: [PATCH] Deprecate and stop generating tickerViews. Tickers have been replaced in the UI by heads-up notifications (and not creating the tickerView will save memory, almost 150k if you have an xhdpi largeIcon). Update docs to explain that tickers are just for accessibility now. Bug: 16395266 Change-Id: Ib1372b34c1c261f64228bbe705d174675cd007dc --- api/current.txt | 4 +- core/java/android/app/Notification.java | 34 ++++++------- .../status_bar_latest_event_ticker.xml | 45 ----------------- ...tus_bar_latest_event_ticker_large_icon.xml | 50 ------------------- core/res/res/values/symbols.xml | 2 - 5 files changed, 16 insertions(+), 119 deletions(-) delete mode 100644 core/res/res/layout-sw720dp/status_bar_latest_event_ticker.xml delete mode 100644 core/res/res/layout-sw720dp/status_bar_latest_event_ticker_large_icon.xml diff --git a/api/current.txt b/api/current.txt index 8e495662262db..83affd2e70077 100644 --- a/api/current.txt +++ b/api/current.txt @@ -4642,7 +4642,7 @@ package android.app { field public android.app.Notification publicVersion; field public android.net.Uri sound; field public java.lang.CharSequence tickerText; - field public android.widget.RemoteViews tickerView; + field public deprecated android.widget.RemoteViews tickerView; field public long[] vibrate; field public int visibility; field public long when; @@ -4743,7 +4743,7 @@ package android.app { method public android.app.Notification.Builder setStyle(android.app.Notification.Style); method public android.app.Notification.Builder setSubText(java.lang.CharSequence); method public android.app.Notification.Builder setTicker(java.lang.CharSequence); - method public android.app.Notification.Builder setTicker(java.lang.CharSequence, android.widget.RemoteViews); + method public deprecated android.app.Notification.Builder setTicker(java.lang.CharSequence, android.widget.RemoteViews); method public android.app.Notification.Builder setUsesChronometer(boolean); method public android.app.Notification.Builder setVibrate(long[]); method public android.app.Notification.Builder setVisibility(int); diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 97a99203153da..e6dbbd55d42a4 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -212,17 +212,22 @@ public class Notification implements Parcelable public PendingIntent fullScreenIntent; /** - * Text to scroll across the screen when this item is added to - * the status bar on large and smaller devices. + * Text that summarizes this notification for accessibility services. + * + * As of the L release, this text is no longer shown on screen, but it is still useful to + * accessibility services (where it serves as an audible announcement of the notification's + * appearance). * * @see #tickerView */ public CharSequence tickerText; /** - * The view to show as the ticker in the status bar when the notification - * is posted. + * Formerly, a view showing the {@link #tickerText}. + * + * No longer displayed in the status bar as of API 21. */ + @Deprecated public RemoteViews tickerView; /** @@ -1950,8 +1955,7 @@ public class Notification implements Parcelable } /** - * Set the "ticker" text which is displayed in the status bar when the notification first - * arrives. + * Set the "ticker" text which is sent to accessibility services. * * @see Notification#tickerText */ @@ -1961,16 +1965,13 @@ public class Notification implements Parcelable } /** - * Set the text that is displayed in the status bar when the notification first - * arrives, and also a RemoteViews object that may be displayed instead on some - * devices. + * Obsolete version of {@link #setTicker(CharSequence)}. * - * @see Notification#tickerText - * @see Notification#tickerView */ + @Deprecated public Builder setTicker(CharSequence tickerText, RemoteViews views) { mTickerText = safeCharSequence(tickerText); - mTickerView = views; + mTickerView = views; // we'll save it for you anyway return this; } @@ -2511,15 +2512,8 @@ public class Notification implements Parcelable private RemoteViews makeTickerView() { if (mTickerView != null) { return mTickerView; - } else { - if (mContentView == null) { - return applyStandardTemplate(mLargeIcon == null - ? R.layout.status_bar_latest_event_ticker - : R.layout.status_bar_latest_event_ticker_large_icon, true); - } else { - return null; - } } + return null; // tickers are not created by default anymore } private RemoteViews makeBigContentView() { diff --git a/core/res/res/layout-sw720dp/status_bar_latest_event_ticker.xml b/core/res/res/layout-sw720dp/status_bar_latest_event_ticker.xml deleted file mode 100644 index a09ad0c5414a7..0000000000000 --- a/core/res/res/layout-sw720dp/status_bar_latest_event_ticker.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - diff --git a/core/res/res/layout-sw720dp/status_bar_latest_event_ticker_large_icon.xml b/core/res/res/layout-sw720dp/status_bar_latest_event_ticker_large_icon.xml deleted file mode 100644 index 09ff1c89f8d37..0000000000000 --- a/core/res/res/layout-sw720dp/status_bar_latest_event_ticker_large_icon.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index aaadc16e1344b..2ff6777bf3c97 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1169,8 +1169,6 @@ - -