Add the first window under the status bar in addTwoAppPanelWindows

If the status bar height is large, the first window might be hidden
below the status bar.
In that case, testSingleAccessibilityFocusAcrossWindows() fails.
Because the number of the windows which the window type
is TYPE_APPLICATION is shorter than expected.

Change-Id: If440f4a5dc1072a70ac6234084c401847e589554
diff --git a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryTest.java b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryTest.java
old mode 100644
new mode 100755
index f8cf4dd..131b8d6
--- a/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryTest.java
+++ b/tests/tests/accessibilityservice/src/android/accessibilityservice/cts/AccessibilityWindowQueryTest.java
@@ -30,6 +30,7 @@
 import android.os.SystemClock;
 import android.test.suitebuilder.annotation.MediumTest;
 import android.view.Gravity;
+import android.view.Window;
 import android.view.WindowManager;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityNodeInfo;
@@ -729,6 +730,7 @@
                     public void run() {
                         WindowManager.LayoutParams params = new WindowManager.LayoutParams();
                         params.gravity = Gravity.TOP;
+                        params.y = getStatusBarHeight();
                         params.width = WindowManager.LayoutParams.MATCH_PARENT;
                         params.height = WindowManager.LayoutParams.WRAP_CONTENT;
                         params.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
@@ -783,6 +785,13 @@
         }, TIMEOUT_ASYNC_PROCESSING);
     }
 
+    private int getStatusBarHeight() {
+        final Rect rect = new Rect();
+        Window window = getActivity().getWindow();
+        window.getDecorView().getWindowVisibleDisplayFrame(rect);
+        return rect.top;
+    }
+
     private void setAccessInteractiveWindowsFlag () {
         UiAutomation uiAutomation = getInstrumentation().getUiAutomation();
         AccessibilityServiceInfo info = uiAutomation.getServiceInfo();