Load Weaver HAL if needed in destroyWeaverSlot()
Now that mWeaver is not initialized at boot time, but rather only by
isWeaverAvailable(), we need to make sure that isWeaverAvailable() is
called before dereferencing mWeaver. This was done in all cases except
for destroyWeaverSlot(), which is reachable with null mWeaver if a user
is removed before any user is unlocked. Fix this.
This fixes commit 61bd5961f6fc ("Do not initialize the weaver service at
boot") (http://ag/21164366).
Bug: 252760591
Test: Set a PIN on user 0. Add secondary user. Reboot. Remove
secondary user using 'pm remove-user'. system_server crashes
before this change, but not after it.
Change-Id: I05019af328c56739724a67f9af776664e2cef438
1 file changed