From 0ffbc3aba54b1266f9a3f5fecac3559aacf30b33 Mon Sep 17 00:00:00 2001 From: Ibrahim Yilmaz Date: Mon, 12 Aug 2024 14:55:29 +0000 Subject: Revert "Only extract RON content model for RON style notifications." This reverts commit 3a0c87599fe82f7e44f833069fa9a3ecbc83783f. Reason for revert: Notification.java should be RON agnostic. Change-Id: Iaf35494145eb65ad4ce7d7ebf68110766697e60c --- core/api/current.txt | 3 --- core/java/android/app/Notification.java | 12 ------------ .../row/RichOngoingNotificationContentExtractor.kt | 10 +++------- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index bcd95635e20e..44a6c6b2803b 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -6844,9 +6844,6 @@ package android.app { method public android.app.Notification.MessagingStyle.Message setData(String, android.net.Uri); } - @FlaggedApi("android.app.api_rich_ongoing") public abstract static class Notification.RichOngoingStyle extends android.app.Notification.Style { - } - public abstract static class Notification.Style { ctor @Deprecated public Notification.Style(); method public android.app.Notification build(); diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index a534a8fd5ead..aea15e13e5d6 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -10919,18 +10919,6 @@ public class Notification implements Parcelable } } - /** - * An object that can apply a rich ongoing notification style to a {@link Notification.Builder} - * object. - */ - @FlaggedApi(Flags.FLAG_API_RICH_ONGOING) - public abstract static class RichOngoingStyle extends Notification.Style { - /** - * @hide - */ - public RichOngoingStyle() {} - } - /** * Notification style for custom views that are decorated by the system * diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RichOngoingNotificationContentExtractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RichOngoingNotificationContentExtractor.kt index b8af3698fb63..b5ea861c19a6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RichOngoingNotificationContentExtractor.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RichOngoingNotificationContentExtractor.kt @@ -17,7 +17,6 @@ package com.android.systemui.statusbar.notification.row import android.app.Notification -import android.app.Notification.RichOngoingStyle import android.app.PendingIntent import android.content.Context import android.util.Log @@ -69,14 +68,12 @@ class RichOngoingNotificationContentExtractorImpl @Inject constructor() : builder: Notification.Builder, systemUIContext: Context, packageContext: Context - ): RichOngoingContentModel? { - if (builder.style !is RichOngoingStyle) return null - + ): RichOngoingContentModel? = try { val sbn = entry.sbn val notification = sbn.notification val icon = IconModel(notification.smallIcon) - return if (sbn.packageName == "com.google.android.deskclock") { + if (sbn.packageName == "com.google.android.deskclock") { when (notification.channelId) { "Timers v2" -> { parseTimerNotification(notification, icon) @@ -93,9 +90,8 @@ class RichOngoingNotificationContentExtractorImpl @Inject constructor() : } else null } catch (e: Exception) { Log.e("RONs", "Error parsing RON", e) - return null + null } - } /** * FOR PROTOTYPING ONLY: create a RON TimerContentModel using the time information available -- cgit v1.2.3-59-g8ed1b