Merge "Free up all scratch resources when the app's UI is hidden" into pi-dev am: 26f99b4cb7
am: 7af6ec70b6

Change-Id: I6fab7c61d5ff3d2cf4931a0ac32dacadb5f1507f