Skip to content
Commit 1406fb72 authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Prevent crashes when user is stopping

Added defensive checks to prevent sporadic crashes due to various race
conditions when user is stopped:
* onPackageBroadcastReceived - moved the check inside the synchronized block.
  This guarantees that onUserStopped (that also grabs mLock) is not yet
  called and we can proceed.
* stopListening - Since it is invoked before onUserStopped callback, we can call
  ensureGroupStateLoadedLocked(userId, false). The state will be subsequently cleaned
  up in the onUserStopped.

Test: manual user switching + SecondaryUserContentResolverTest and
      ManagedUserContentResolverTest
Fixes: 37472670
Fixes: 36890589

Change-Id: I44d0a0c004e9c3e6cfb37a24cb8a5b6f20a42f13
parent bd886e52
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment