Update database before sending broadcast.

This was moved to to solve a race condition around service shutdown,
but ended up causing another race with remote apps.

Bug: 8200919
Change-Id: Ief470e9454e9be8ec43ca3ec11e3b3440fa5852d
1 file changed