Merge "Add onClick for CardPreference" into main
diff --git a/src/com/android/settings/widget/CardPreference.kt b/src/com/android/settings/widget/CardPreference.kt
index 7122ac6..010d7de 100644
--- a/src/com/android/settings/widget/CardPreference.kt
+++ b/src/com/android/settings/widget/CardPreference.kt
@@ -61,6 +61,9 @@
     /** The visibility of secondary button on tips card. The default value is `false`. */
     var secondaryButtonVisibility: Boolean = false
 
+    var onClick: (() -> Unit)? = null
+
+    /** The callback for click on card preference itself. */
     private var onDismiss: (() -> Unit)? = null
 
     /** Enable the dismiss button on tips card. */
@@ -84,9 +87,10 @@
                     buttons = listOfNotNull(configPrimaryButton(), configSecondaryButton()),
                     onDismiss = onDismiss,
                     imageVector =
-                        iconResId
-                            ?.takeIf { it != Resources.ID_NULL }
-                            ?.let { ImageVector.vectorResource(it) },
+                    iconResId
+                        ?.takeIf { it != Resources.ID_NULL }
+                        ?.let { ImageVector.vectorResource(it) },
+                    onClick = onClick,
                 )
             )
         }