-
Notifications
You must be signed in to change notification settings - Fork 731
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
Fix crash on PIN code settings screen #6980
Conversation
private val biometricHelper = biometricHelperFactory.create(defaultLockScreenConfiguration.copy(mode = LockScreenMode.CREATE)) | ||
private val biometricHelper by lazy { | ||
biometricHelperFactory.create(defaultLockScreenConfiguration.copy(mode = LockScreenMode.CREATE)) | ||
} |
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.
it could also be a lateinit var
and be created in fun onCreate()
. Not sure if it's better, but at least it will remove the overhead of using by lazy
.
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.
(IMO we should use by lazy
when on object would eventually be not used - which is not the case 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.
Sorry, when it was approved I enabled automatic merge and by the time I read that message it was already merged. I can open a new PR changing lazy to lateinit and instantiate it in onCreate
if you think it's worth it.
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.
No worries, this is not urgent.
Kudos, SonarCloud Quality Gate passed! |
Type of change
Content
Made
VectorSettingsPinFragment.biometricHelper
lazy so it's not instantiated beforebiometricHelperFactory
is injected.Motivation and context
See #6979.
Tests
Tested devices
Checklist