From f0c7dbbb1a3a043e684064dbd1f45f7bff0c7b63 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Mon, 29 Mar 2021 16:27:56 -0400 Subject: [PATCH] Remove unused code Bug: 181048615 Test: manual Change-Id: I69dc97c2ced3025e7b8b9809bdb0ac7954b862d2 --- core/java/android/app/Notification.java | 59 +------------------------ 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 420ec0846fda1..949f611be4406 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -3698,7 +3698,6 @@ public class Notification implements Parcelable private int mTextColorsAreForBackground = COLOR_INVALID; private int mPrimaryTextColor = COLOR_INVALID; private int mSecondaryTextColor = COLOR_INVALID; - private boolean mRebuildStyledRemoteViews; private boolean mTintActionButtons; private boolean mTintWithThemeAccent; @@ -5729,8 +5728,7 @@ public class Notification implements Parcelable } private boolean useExistingRemoteView() { - return mStyle == null || (!mStyle.displayCustomViewInline() - && !mRebuildStyledRemoteViews); + return mStyle == null || !mStyle.displayCustomViewInline(); } /** @@ -6618,18 +6616,6 @@ public class Notification implements Parcelable && targetSdkVersion < Build.VERSION_CODES.O; } - /** - * Forces all styled remoteViews to be built from scratch and not use any cached - * RemoteViews. - * This is needed for legacy apps that are baking in their remoteviews into the - * notification. - * - * @hide - */ - public void setRebuildStyledRemoteViews(boolean rebuild) { - mRebuildStyledRemoteViews = rebuild; - } - /** * Get the text that should be displayed in the statusBar when heads upped. This is * usually just the app name, but may be different depending on the style. @@ -8279,27 +8265,6 @@ public class Notification implements Parcelable return true; } - private CharSequence createConversationTitleFromMessages() { - ArraySet names = new ArraySet<>(); - for (int i = 0; i < mMessages.size(); i++) { - Message m = mMessages.get(i); - Person sender = m.getSenderPerson(); - if (sender != null) { - names.add(sender.getName()); - } - } - SpannableStringBuilder title = new SpannableStringBuilder(); - int size = names.size(); - for (int i = 0; i < size; i++) { - CharSequence name = names.valueAt(i); - if (!TextUtils.isEmpty(title)) { - title.append(", "); - } - title.append(BidiFormatter.getInstance().unicodeWrap(name)); - } - return title; - } - /** * @hide */ @@ -8313,11 +8278,6 @@ public class Notification implements Parcelable return remoteViews; } - private static TextAppearanceSpan makeFontColorSpan(int color) { - return new TextAppearanceSpan(null, 0, 0, - ColorStateList.valueOf(color), null); - } - public static final class Message { /** @hide */ public static final String KEY_TEXT = "text"; @@ -9779,23 +9739,6 @@ public class Notification implements Parcelable // Comparison done for all custom RemoteViews, independent of style return false; } - - private RemoteViews buildIntoRemoteView(RemoteViews template, RemoteViews customContent, - boolean headerless) { - if (customContent != null) { - // Need to clone customContent before adding, because otherwise it can no longer be - // parceled independently of remoteViews. - customContent = customContent.clone(); - customContent.overrideTextColors(mBuilder.getPrimaryTextColor(mBuilder.mParams)); - if (headerless) { - template.removeFromParent(R.id.notification_top_line); - } - template.removeAllViews(R.id.notification_main_column); - template.addView(R.id.notification_main_column, customContent); - template.addFlags(RemoteViews.FLAG_REAPPLY_DISALLOWED); - } - return template; - } } /**