Fix case in which onTaskStackChanged was not called

In completeResumeLocked, visibility was changed but we didn't set the
flag so the listeners didn't get notified.

Test:
runtest -c com.android.server.am.TaskStackChangedListenerTest frameworks-services

Change-Id: I4b4076a895baafc877f312d24211a2fc69a98e3b
Fixes: 31527783
diff --git a/services/tests/servicestests/AndroidManifest.xml b/services/tests/servicestests/AndroidManifest.xml
index b8ace28..514f095 100644
--- a/services/tests/servicestests/AndroidManifest.xml
+++ b/services/tests/servicestests/AndroidManifest.xml
@@ -43,6 +43,7 @@
     <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
     <uses-permission android:name="android.permission.PACKET_KEEPALIVE_OFFLOAD" />
     <uses-permission android:name="android.permission.GET_INTENT_SENDER_INTENT" />
+    <uses-permission android:name="android.permission.MANAGE_ACTIVITY_STACKS" />
 
     <application>
         <uses-library android:name="android.test.runner" />
@@ -155,6 +156,9 @@
             </intent-filter>
         </activity-alias>
 
+        <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityA" />
+        <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityB" />
+
     </application>
 
     <instrumentation