PasskeyUnlockIntent.kt

888 B · raw

1package com.peachpasswords.passkeys23import android.app.PendingIntent4import android.content.Context5import android.content.Intent6import androidx.credentials.provider.BeginGetCredentialRequest7import com.peachpasswords.credentials.CredentialProviderUnlockActivity89object PasskeyUnlockIntent {10    fun pendingIntent(context: Context, request: BeginGetCredentialRequest): PendingIntent {11        val intent = Intent(context, CredentialProviderUnlockActivity::class.java)12            .putExtra(EXTRA_REQUEST, BeginGetCredentialRequest.asBundle(request))13        return PendingIntent.getActivity(14            context,15            REQUEST_CODE,16            intent,17            PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,18        )19    }2021    const val EXTRA_REQUEST = "com.peachpasswords.passkeys.EXTRA_BEGIN_GET_REQUEST"22    private const val REQUEST_CODE = 0x504b23}