Skip to content

[NMA-1123] Bugfix: lockscreen viewmodel crash - #853

Merged
HashEngineering merged 3 commits into
masterfrom
bugfix-lockscreen-viewmodel-crash
Jan 2, 2022
Merged

HashEngineering merged 3 commits into
masterfrom
bugfix-lockscreen-viewmodel-crash

Conversation

@Syn-McJ

@Syn-McJ Syn-McJ commented Dec 28, 2021

Copy link
Copy Markdown
Member

There is a crash in LockScreenActivity.getLockScreenViewModel which is related to Hilt:

Fatal Exception: java.lang.IllegalArgumentException
SavedStateProvider with the given key is already registered
androidx.savedstate.SavedStateRegistry.registerSavedStateProvider (SavedStateRegistry.java:111)
androidx.lifecycle.AbstractSavedStateViewModelFactory.create (AbstractSavedStateViewModelFactory.java:84)
dagger.hilt.android.internal.lifecycle.HiltViewModelFactory.create (HiltViewModelFactory.java:109)

This is probably happening because in the FancyAlertDialog, LockScreenViewModel is initialized with fragment as an owner instead of an activity.

Issue being fixed or feature implemented

Replaced initializations with activity as owner.

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

@Syn-McJ Syn-McJ self-assigned this Dec 28, 2021

@HashEngineering HashEngineering left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent.

@HashEngineering
HashEngineering merged commit 10821a3 into master Jan 2, 2022
@Syn-McJ
Syn-McJ deleted the bugfix-lockscreen-viewmodel-crash branch January 10, 2022 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants