[Contextual Edu] Add tutorial entry point
Add tutorial entry point as extras in notification intent
Bug: 371567508
Test: manual, tested the entry point is in intent extras
Flag: com.android.systemui.keyboard_touchpad_contextual_education
Change-Id: I4fc8741aa0e52206104ef034ce3154cb80364f95
diff --git a/packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduUiCoordinator.kt b/packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduUiCoordinator.kt
index 6baffdd..2a3729b 100644
--- a/packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduUiCoordinator.kt
+++ b/packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduUiCoordinator.kt
@@ -34,6 +34,8 @@
import com.android.systemui.education.ui.viewmodel.ContextualEduToastViewModel
import com.android.systemui.education.ui.viewmodel.ContextualEduViewModel
import com.android.systemui.inputdevice.tutorial.ui.view.KeyboardTouchpadTutorialActivity
+import com.android.systemui.inputdevice.tutorial.ui.view.KeyboardTouchpadTutorialActivity.Companion.INTENT_TUTORIAL_ENTRY_POINT_CONTEXTUAL_EDU
+import com.android.systemui.inputdevice.tutorial.ui.view.KeyboardTouchpadTutorialActivity.Companion.INTENT_TUTORIAL_ENTRY_POINT_KEY
import com.android.systemui.res.R
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
@@ -99,7 +101,7 @@
CHANNEL_ID,
context.getString(com.android.internal.R.string.android_system_label),
// Make it as silent notification
- NotificationManager.IMPORTANCE_LOW
+ NotificationManager.IMPORTANCE_LOW,
)
notificationManager.createNotificationChannel(channel)
}
@@ -114,7 +116,7 @@
val extras = Bundle()
extras.putString(
Notification.EXTRA_SUBSTITUTE_APP_NAME,
- context.getString(com.android.internal.R.string.android_system_label)
+ context.getString(com.android.internal.R.string.android_system_label),
)
val notification =
@@ -131,7 +133,7 @@
TAG,
NOTIFICATION_ID,
notification,
- UserHandle.of(model.userId)
+ UserHandle.of(model.userId),
)
}
@@ -140,12 +142,16 @@
Intent(context, KeyboardTouchpadTutorialActivity::class.java).apply {
addCategory(Intent.CATEGORY_DEFAULT)
flags = Intent.FLAG_ACTIVITY_NEW_TASK
+ putExtra(
+ INTENT_TUTORIAL_ENTRY_POINT_KEY,
+ INTENT_TUTORIAL_ENTRY_POINT_CONTEXTUAL_EDU,
+ )
}
return PendingIntent.getActivity(
context,
/* requestCode= */ 0,
intent,
- PendingIntent.FLAG_IMMUTABLE
+ PendingIntent.FLAG_IMMUTABLE,
)
}
}