summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Julia Tuttle <juliatuttle@google.com> 2025-01-27 18:36:45 -0500
committer Julia Tuttle <juliatuttle@google.com> 2025-01-28 11:30:42 -0500
commit9c9d401facc05f3c37bb248e9615da4b076ea5ce (patch)
tree951930eb07bd541aade11b5444780beb87820347
parent1cbeadaaa97eab20f6d1d97355fcc8ecd69c25c3 (diff)
Add traceSection around AOD RON inflate & update
Bug: 392058444 Test: NA Flag: com.android.systemui.aod_ui_rich_ongoing Change-Id: I8e966e3034b916bba9521fb43051898455b0df60
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/AODPromotedNotification.kt28
1 files changed, 20 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/AODPromotedNotification.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/AODPromotedNotification.kt
index d5bffbc81e63..cb9bd4a3fd35 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/AODPromotedNotification.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/promoted/AODPromotedNotification.kt
@@ -31,6 +31,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.key
import androidx.compose.ui.viewinterop.AndroidView
import androidx.core.view.isVisible
+import com.android.app.tracing.traceSection
import com.android.internal.R
import com.android.internal.widget.BigPictureNotificationImageView
import com.android.internal.widget.CachingIconView
@@ -51,8 +52,7 @@ fun AODPromotedNotification(viewModelFactory: AODPromotedNotificationViewModel.F
return
}
- val viewModel =
- rememberViewModel(traceName = "AODPromotedNotification") { viewModelFactory.create() }
+ val viewModel = rememberViewModel(traceName = "$TAG.viewModel") { viewModelFactory.create() }
val content = viewModel.content ?: return
@@ -61,14 +61,24 @@ fun AODPromotedNotification(viewModelFactory: AODPromotedNotificationViewModel.F
AndroidView(
factory = { context ->
- LayoutInflater.from(context).inflate(layoutResource, /* root= */ null).apply {
- setTag(viewUpdaterTagId, AODPromotedNotificationViewUpdater(this))
- }
+ traceSection("$TAG.inflate") {
+ LayoutInflater.from(context).inflate(layoutResource, /* root= */ null)
+ }
+ .apply {
+ setTag(
+ viewUpdaterTagId,
+ traceSection("$TAG.findViews") {
+ AODPromotedNotificationViewUpdater(this)
+ },
+ )
+ }
},
update = { view ->
- (view.getTag(viewUpdaterTagId) as AODPromotedNotificationViewUpdater).update(
- content
- )
+ traceSection("$TAG.update") {
+ (view.getTag(viewUpdaterTagId) as AODPromotedNotificationViewUpdater).update(
+ content
+ )
+ }
},
)
}
@@ -324,3 +334,5 @@ private class AODPromotedNotificationViewUpdater(root: View) {
}
private val viewUpdaterTagId = systemuiR.id.aod_promoted_notification_view_updater_tag
+
+private const val TAG = "AODPromotedNotification"