From f35b0660ca97c28625b2aefbd76f267d360d6ba7 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 26 Feb 2020 12:37:36 +0100 Subject: [PATCH] Rename constant for code readability --- .../features/crypto/quads/SharedSecureStorageActivity.kt | 9 ++++++--- .../crypto/verification/VerificationBottomSheet.kt | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/quads/SharedSecureStorageActivity.kt b/vector/src/main/java/im/vector/riotx/features/crypto/quads/SharedSecureStorageActivity.kt index 93b531ac9c..1347b6ca19 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/quads/SharedSecureStorageActivity.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/quads/SharedSecureStorageActivity.kt @@ -109,10 +109,13 @@ class SharedSecureStorageActivity : SimpleFragmentActivity() { } companion object { - const val EXTRA_DATA_RESULT = "EXTRA_DATA_RESULT" - const val RESULT_KEYSTORE_ALIAS = "SharedSecureStorageActivity" - fun newIntent(context: Context, keyId: String? = null, requestedSecrets: List, resultKeyStoreAlias: String = RESULT_KEYSTORE_ALIAS): Intent { + const val DEFAULT_RESULT_KEYSTORE_ALIAS = "SharedSecureStorageActivity" + + fun newIntent(context: Context, + keyId: String? = null, + requestedSecrets: List, + resultKeyStoreAlias: String = DEFAULT_RESULT_KEYSTORE_ALIAS): Intent { require(requestedSecrets.isNotEmpty()) return Intent(context, SharedSecureStorageActivity::class.java).also { it.putExtra(MvRx.KEY_ARG, Args( diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheet.kt b/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheet.kt index 154849c227..d73fc0955d 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheet.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/verification/VerificationBottomSheet.kt @@ -98,7 +98,7 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment() { requireContext(), null, // use default key listOf(MASTER_KEY_SSSS_NAME, USER_SIGNING_KEY_SSSS_NAME, SELF_SIGNING_KEY_SSSS_NAME), - SharedSecureStorageActivity.RESULT_KEYSTORE_ALIAS + SharedSecureStorageActivity.DEFAULT_RESULT_KEYSTORE_ALIAS ), SECRET_REQUEST_CODE) } is VerificationBottomSheetViewEvents.ModalError -> { @@ -117,7 +117,7 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment() { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { if (resultCode == Activity.RESULT_OK && requestCode == SECRET_REQUEST_CODE) { data?.getStringExtra(SharedSecureStorageActivity.EXTRA_DATA_RESULT)?.let { - viewModel.handle(VerificationAction.GotResultFromSsss(it, SharedSecureStorageActivity.RESULT_KEYSTORE_ALIAS)) + viewModel.handle(VerificationAction.GotResultFromSsss(it, SharedSecureStorageActivity.DEFAULT_RESULT_KEYSTORE_ALIAS)) } } super.onActivityResult(requestCode, resultCode, data)