Rate-limit FGS notification visibility deferral

Apps that transition services in and out of the foreground mode
frequently won't see deferred visibility on each transition.  There is
now a minimum time after any such deferral, during which a new transition
to the FGS mode will always show its notification immediately.

Bug: 183428469
Test: atest CtsAppTestCases:ServiceTest
Change-Id: I90e50357290203adac23ae4508cf72daab2c150a
2 files changed