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

fixed "Unable to start service com.flowcrypt.email.service.PassPhrasesInRAMService" #2713

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 @@ -96,6 +96,9 @@ class PrivateKeyDetailsFragmentPassInRamFlexibleTimeFlowTest : BaseTest() {

@Test
fun testInMemoryPassPhraseSessionLengthParameter() {
//as tests run a bit differently need to run PassPhrasesInRAMService manually at this stage
PassPhrasesInRAMService.start(getTargetContext())

onView(withId(R.id.tVPassPhraseVerification))
.check(matches(withText(getResString(R.string.pass_phrase_not_provided))))
.check(matches(hasTextColor(R.color.red)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ class FlowCryptApplication : Application(), Configuration.Provider {
val hasTemporaryPassPhrases =
keysStorage.getRawKeys().any { it.passphraseType == KeyEntity.PassphraseType.RAM }
if (hasTemporaryPassPhrases) {
PassPhrasesInRAMService.start(this)
if (GeneralUtil.isAppForegrounded()) {
//we can run a foreground service only if the app is visible for a user
PassPhrasesInRAMService.start(this)
}
} else {
PassPhrasesInRAMService.stop(this)
}
Expand Down
Loading