Fix race condition bug related to freezing apps. am: 41d2be0f0f am: a025a0cdec
am: 3179cd49ac

Change-Id: Ief3cd15afd621695e3c33a773e42e39b3df52827