Fixes memory leak and NPE crash issue (2/3).
We were incorrectly depending on the navigator in the view-model. The view-model is long-lived and used across fragment/activity lifecycles. The navigator is the fragment itself. It's not correct to keep a reference to it in a long-lived object like the view-model. This leads to memory leaks and to NPE crashes when attempting to touch the "more wallpapers" button after changing the wallpaper at least once. The approach is to remove the reference from view-model and move the navigation logic out into the binder and section controller. Bug: 262924643 Test: manually verified that changing the wallpaper and then clicking the "more wallpapers" button no longer crashes Change-Id: Ib564d1afcf346710d1ab116596336ccad5accbde
Loading
Please register or sign in to comment