Merge "Improve isInForeground" am: 1b043e301d

Change-Id: Ifd6ed878ab1907a2e5be444cf6b7bfbfc96d3e99