Poll for posted notifications in LegacyNotificationManagerTest

Simply having Thread.sleep(500) was insufficient time for the notifications to be received and was thus leading to test flakiness.

Bug: 223072027
Test: this
Change-Id: I36c7dff317752b19ff054f7d9fd5f59901f7ee9e
1 file changed