Wait for launcher is shown after calling pressHome
In current code, the test will call pressHome before show
network notification but it does not verify the home screen
is shown. The test might be failed due to the notification
shade is still opened. Thus adding an assertion to verify
the launcher is shown.
Bug: 255643296
Test: FrameworksNetTest:NetworkNotificationManagerTest
Change-Id: Iee3476a26030b9ba72994dee624e0e6974c9369f
diff --git a/tests/unit/AndroidManifest.xml b/tests/unit/AndroidManifest.xml
index 54e1cd0..5bac2dd 100644
--- a/tests/unit/AndroidManifest.xml
+++ b/tests/unit/AndroidManifest.xml
@@ -50,6 +50,15 @@
<uses-permission android:name="android.permission.NETWORK_STATS_PROVIDER" />
<uses-permission android:name="android.permission.CONTROL_OEM_PAID_NETWORK_PREFERENCE" />
+ <!-- Declare the intent that the test intends to query. This is necessary for
+ UiDevice.getLauncherPackageName which is used in NetworkNotificationManagerTest
+ -->
+ <queries>
+ <intent>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.HOME"/>
+ </intent>
+ </queries>
<application android:testOnly="true">
<uses-library android:name="android.test.runner" />
<uses-library android:name="android.net.ipsec.ike" />