Merge "Revert "Only extract RON content model for RON style notifications."" into main
diff --git a/core/api/current.txt b/core/api/current.txt
index 36c91758..7f2b004 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -6844,9 +6844,6 @@
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 ef09dc4..db979a5 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -10979,18 +10979,6 @@
}
/**
- * 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
*
* <p>Instead of providing a notification that is completely custom, a developer can set this
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 fe86375..bf5b3a3 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 @@
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 @@
} 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