Check PendingStartActivityUids in getAppStartModeLocked.

While starting activity, WindowManager posts a runnable to DisplayThread to updateOomAdj.
The UidRecord update could be delayed.

In getAppStartModeLocked(), before checking UidRecord, check PendingStartActivityUids
 to determine if the uid is in foreground state.

Bug: 160213874
Test: Reproduce steps in b/160213874, launch GCA and take a photo immediately.
Change-Id: Ieb984d2f629d607abfbda89ca00f8785cf5923fd
1 file changed