PasskeyUnlockIntent.kt

750 B · raw

1package com.peachpasswords.passkeys23import android.app.PendingIntent4import android.content.Context5import android.content.Intent6import com.peachpasswords.MainActivity7import com.peachpasswords.PeachActions89object PasskeyUnlockIntent {10    fun pendingIntent(context: Context): PendingIntent {11        val intent = Intent(context, MainActivity::class.java)12            .setAction(PeachActions.PASSKEY_UNLOCK)13            .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_SINGLE_TOP)14        return PendingIntent.getActivity(15            context,16            REQUEST_CODE,17            intent,18            PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,19        )20    }2122    private const val REQUEST_CODE = 0x504b23}