-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Presentation Activity in Wallet #459
Presentation Activity in Wallet #459
Conversation
wallet/src/main/java/com/android/identity_credential/wallet/MainActivity.kt
Outdated
Show resolved
Hide resolved
wallet/src/main/java/com/android/identity_credential/wallet/NfcDataTransferHandler.kt
Outdated
Show resolved
Hide resolved
wallet/src/main/java/com/android/identity_credential/wallet/TransferHelper.kt
Outdated
Show resolved
Hide resolved
wallet/src/main/java/com/android/identity_credential/wallet/TransferHelper.kt
Outdated
Show resolved
Hide resolved
a414116
to
a0496fd
Compare
wallet/src/main/java/com/android/identity_credential/wallet/PresentationActivity.kt
Outdated
Show resolved
Hide resolved
wallet/src/main/java/com/android/identity_credential/wallet/PresentationActivity.kt
Show resolved
Hide resolved
wallet/src/main/java/com/android/identity_credential/wallet/PresentationActivity.kt
Outdated
Show resolved
Hide resolved
wallet/src/main/java/com/android/identity_credential/wallet/NfcEngagementHandler.kt
Outdated
Show resolved
Hide resolved
wallet/src/main/java/com/android/identity_credential/wallet/PresentationActivity.kt
Show resolved
Hide resolved
wallet/src/main/java/com/android/identity_credential/wallet/MainActivity.kt
Show resolved
Hide resolved
wallet/src/main/java/com/android/identity_credential/wallet/MainActivity.kt
Outdated
Show resolved
Hide resolved
wallet/src/main/java/com/android/identity_credential/wallet/NfcEngagementHandler.kt
Outdated
Show resolved
Hide resolved
4a1cf1c
to
836e437
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for me except nits that are easily addressed. I'm not sure about the PermissionTracker
changes so added @sorotokin to review that and I'll let him approve the PR.
|
||
private val permissionTracker = PermissionTracker(this, mapOf( | ||
Manifest.permission.CAMERA to "This application requires camera permission to scan", | ||
Manifest.permission.NFC to "NFC permission is required to operate" | ||
)) | ||
|
||
private val blePermissionTracker: PermissionTracker = if (Build.VERSION.SDK_INT >= 31) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe call it inPersonPresentationPermissionTracker
since we'd also include Wifi Aware permissions here in the (unlikely) case we'd want to support Wifi Aware as well as BLE.
|
||
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(applicationContext) | ||
|
||
setContent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use primitives from commonUI.kt which @sorotokin landed yesterday.
Text(text = reasoningTxt, modifier = Modifier.fillMaxWidth()) | ||
Button(onClick = {requestPermission(permission)}) { | ||
Text("I understand") | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @sorotokin to review the changes here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why
} else {
SinglePermissionRequest(permission = permissionsToRequest[0])
}
is needed? It should give you a list of all the missing permission with a button to request each of them. Is it not working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, when I used it all the composables in the loop were being rendered at once, so all three ble msgs were on top of each other
836e437
to
2fc6a36
Compare
Text(text = reasoningTxt, modifier = Modifier.fillMaxWidth()) | ||
Button(onClick = {requestPermission(permission)}) { | ||
Text("I understand") | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why
} else {
SinglePermissionRequest(permission = permissionsToRequest[0])
}
is needed? It should give you a list of all the missing permission with a button to request each of them. Is it not working?
@@ -108,50 +125,78 @@ class MainActivity : ComponentActivity() { | |||
|
|||
private val provisioningViewModel: ProvisioningViewModel by viewModels() | |||
private val credentialInformationViewModel: CredentialInformationViewModel by viewModels() | |||
private lateinit var sharedPreferences: SharedPreferences | |||
|
|||
private val permissionTracker = PermissionTracker(this, mapOf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just create a single permission tracker for all permissions. Map may require a builder function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you're saying, will do
|
||
permissionTracker.updatePermissions() | ||
inPersonPresentationPermissionTracker.updatePermissions() | ||
val requiredPermissions: List<String> = if (Build.VERSION.SDK_INT >= 31) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be more descriptive name than just requiredPermissions (at least if declared on top level rather than locally next to its use). This set is for a particular screen or workflow, right?
Adding PresentationActivity to wallet, which will appear on-screen with related presentation UI once the NfcEngagementHandler starts the activity. This addition allows for in-person presentation with NFC engagement. Tested manually with 0/1/2 active credentials in wallet. Signed-off-by: Suzanna Jiwani <[email protected]>
2fc6a36
to
41003f8
Compare
Adding PresentationActivity to wallet, which will appear on-screen with related presentation UI once the NfcEngagementHandler starts the activity. This addition allows for in-person presentation with NFC engagement. Tested manually with 0/1/2 active credentials in wallet. Signed-off-by: Suzanna Jiwani <[email protected]> Signed-off-by: Peter Sorotokin <[email protected]>
Adding PresentationActivity to wallet, which will appear on-screen with related presentation UI once the NfcEngagementHandler starts the activity. This addition allows for in-person presentation with NFC engagement. Tested manually with 0/1/2 active credentials in wallet. Signed-off-by: Suzanna Jiwani <[email protected]> Signed-off-by: Peter Sorotokin <[email protected]>
Adding PresentationActivity to wallet, which will appear on-screen with related presentation UI once the NfcEngagementHandler starts the activity. This addition allows for in-person presentation with NFC engagement.
Tested manually with 0/1/2 active credentials in wallet.