Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f492ab2 authored by Helen Cheuk's avatar Helen Cheuk Committed by Android (Google) Code Review
Browse files

Merge "[Contextual Edu] Add tutorial entry point" into main

parents e240b52c 475de418
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ import com.android.systemui.education.ui.viewmodel.ContextualEduNotificationView
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 @@ constructor(
                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 @@ constructor(
        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 @@ constructor(
            TAG,
            NOTIFICATION_ID,
            notification,
            UserHandle.of(model.userId)
            UserHandle.of(model.userId),
        )
    }

@@ -140,12 +142,16 @@ constructor(
            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,
        )
    }
}