Skip to content
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

Add a developer option to trigger syncing all documents. #787

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import androidx.compose.ui.unit.dp
import com.android.identity.document.DocumentStore
import com.android.identity_credential.wallet.R
import com.android.identity_credential.wallet.SettingsModel
import com.android.identity_credential.wallet.WalletApplication
import com.android.identity_credential.wallet.WalletApplicationConfiguration
import com.android.identity_credential.wallet.navigation.WalletDestination
import com.android.identity_credential.wallet.ui.ScreenWithAppBarAndBackButton
Expand Down Expand Up @@ -235,6 +236,18 @@ fun SettingsScreen(
onClicked = { showMinServerUrlDialog = true }
)
}
if (settingsModel.developerModeEnabled.value == true) {
SettingSectionSubtitle(title = stringResource(R.string.settings_screen_debug_actions_section))
val context = LocalContext.current
val walletApplication = context.applicationContext as WalletApplication
Button(
onClick = {
walletApplication.documentModel.periodicSyncForAllDocuments()
}
) {
Text(text = stringResource(R.string.settings_screen_trigger_periodic_sync_button))
}
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions wallet/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -566,4 +566,6 @@
<string name="qr_alert_dialog_bt_disabled_text">Bluetooth must be enabled to share a QR connection code</string>
<string name="qr_alert_dialog_bt_enable_button">Enable</string>
<string name="presentation_result_no_matching_document_message">No available documents can fulfill the request.</string>
<string name="settings_screen_debug_actions_section">Debug actions</string>
<string name="settings_screen_trigger_periodic_sync_button">Trigger Periodic Sync</string>
</resources>