Emit TRIM_MEMORY_UI_HIDDEN event on switching to background

Previously it won't be emitted while switching from foreground
to cached, but we should send it on the visibility changes.

Bug: 194748319
Test: atest CtsAppTestCases
Change-Id: I901d7d32790d6b888f960ca1bdfb160ea1786cde
Merged-In: I901d7d32790d6b888f960ca1bdfb160ea1786cde
(cherry picked from commit 88dcaf3a52020693329debd511260a6a7ba8beb2)
(cherry picked from commit 2c2e0fb2c3ae68e13318a1741b1aaf0649b62caf)
1 file changed