Check user states exist before package add/removal

It's possible for packages to be added/removed for a user even if they
are not yet unlocked. This could cause a NPE, so we check beforehand and
ignore if the the user states have not been initialized. This is fine
because on user unlock, we get the most up to date package data anyway.

Bug: 175829330
Test: atest AppHibernationService
Change-Id: Ia29359d38325be5a40d84237fd7fc1b5ba356c5d
1 file changed