diff --git a/download/src/main/kotlin/com/alfresco/download/DownloadMonitor.kt b/download/src/main/kotlin/com/alfresco/download/DownloadMonitor.kt index 0a9427603..e941b8cee 100644 --- a/download/src/main/kotlin/com/alfresco/download/DownloadMonitor.kt +++ b/download/src/main/kotlin/com/alfresco/download/DownloadMonitor.kt @@ -41,7 +41,15 @@ object DownloadMonitor { val newReceiver = DownloadCompleteReceiver(::onDownloadComplete) val filter = IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE) - context.applicationContext.registerReceiver(newReceiver, filter) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + context.applicationContext.registerReceiver( + newReceiver, + filter, + Context.RECEIVER_EXPORTED, + ) + } else { + context.applicationContext.registerReceiver(newReceiver, filter) + } receiver = newReceiver } diff --git a/process-app/src/main/kotlin/com/alfresco/content/process/ui/composeviews/FormScreen.kt b/process-app/src/main/kotlin/com/alfresco/content/process/ui/composeviews/FormScreen.kt index e7276e29b..ffacfc45b 100644 --- a/process-app/src/main/kotlin/com/alfresco/content/process/ui/composeviews/FormScreen.kt +++ b/process-app/src/main/kotlin/com/alfresco/content/process/ui/composeviews/FormScreen.kt @@ -32,7 +32,7 @@ fun FormScreen(navController: NavController, viewModel: FormViewModel, fragment: state.formFields.isEmpty() -> emptyList() state.processOutcomes.isEmpty() -> defaultOutcomes(state) state.parent.taskEntry.memberOfCandidateGroup == true -> pooledOutcomes(state, viewModel) - else -> customOutcomes(state) + else -> customOutcomes(state, viewModel) } when { @@ -48,7 +48,13 @@ fun FormScreen(navController: NavController, viewModel: FormViewModel, fragment: color = colorScheme.background, contentColor = colorScheme.onBackground, ) { - FormDetailScreen(viewModel, customOutcomes, navController, fragment, snackbarHostState) + FormDetailScreen( + viewModel, + customOutcomes, + navController, + fragment, + snackbarHostState, + ) } } } @@ -56,7 +62,13 @@ fun FormScreen(navController: NavController, viewModel: FormViewModel, fragment: else -> { Scaffold( snackbarHost = { SnackbarHost(snackbarHostState) }, - floatingActionButton = { FloatingActionButton(customOutcomes, fragment, viewModel) }, + floatingActionButton = { + FloatingActionButton( + customOutcomes, + fragment, + viewModel, + ) + }, floatingActionButtonPosition = FabPosition.End, ) { padding -> val colorScheme = MaterialTheme.colorScheme @@ -67,7 +79,13 @@ fun FormScreen(navController: NavController, viewModel: FormViewModel, fragment: color = colorScheme.background, contentColor = colorScheme.onBackground, ) { - FormDetailScreen(viewModel, emptyList(), navController, fragment, snackbarHostState) + FormDetailScreen( + viewModel, + emptyList(), + navController, + fragment, + snackbarHostState, + ) } } } @@ -106,16 +124,21 @@ private fun defaultOutcomes(state: FormViewState): List { } @Composable -private fun customOutcomes(state: FormViewState): List { +private fun customOutcomes(state: FormViewState, viewModel: FormViewModel): List { + val dataObj = state.parent.taskEntry return if (state.parent.processInstanceId == null) { state.processOutcomes } else { - listOf( - OptionsModel( - id = DefaultOutcomesID.DEFAULT_SAVE.value(), - name = stringResource(id = R.string.action_text_save), - ), - ) + state.processOutcomes + if (viewModel.isAssigneeAndLoggedInSame(dataObj.assignee)) { + listOf( + OptionsModel( + id = DefaultOutcomesID.DEFAULT_SAVE.value(), + name = stringResource(id = R.string.action_text_save), + ), + ) + state.processOutcomes + } else { + emptyList() + } } }