OSDN Git Service

Merge "Fix AppWindowTokenAnimationTests and add them to presubmit"
authorTreeHugger Robot <treehugger-gerrit@google.com>
Thu, 21 Feb 2019 05:03:52 +0000 (05:03 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Thu, 21 Feb 2019 05:03:52 +0000 (05:03 +0000)
1  2 
services/tests/wmtests/src/com/android/server/wm/WindowTestUtils.java
services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java

@@@ -55,9 -127,31 +55,16 @@@ class WindowTestUtils 
          return newToken;
      }
  
 -    /**
 -     * An extension of {@link TestTaskStack}, which overrides package scoped methods that would not
 -     * normally be mocked out.
 -     */
 -    public static class TestTaskStack extends TaskStack {
 -        TestTaskStack(WindowManagerService service, int stackId) {
 -            super(service, stackId, null);
 -        }
 -
 -        @Override
 -        void addTask(Task task, int position, boolean showForAllUsers, boolean moveParents) {
 -            // Do nothing.
 -        }
 -    }
 -
      static TestAppWindowToken createTestAppWindowToken(DisplayContent dc) {
          synchronized (dc.mWmService.mGlobalLock) {
-             return new TestAppWindowToken(dc);
+             return new TestAppWindowToken(dc, true /* skipOnParentChanged */);
+         }
+     }
+     static TestAppWindowToken createTestAppWindowToken(DisplayContent dc,
+             boolean skipOnParentChanged) {
+         synchronized (dc.mWmService.mGlobalLock) {
+             return new TestAppWindowToken(dc, skipOnParentChanged);
          }
      }
  
                  }
              }, new ComponentName("", ""), false, dc, true /* fillsParent */);
              mTargetSdk = Build.VERSION_CODES.CUR_DEVELOPMENT;
+             mSkipOnParentChanged = skipOnParentChanged;
          }
  
 -        TestAppWindowToken(WindowManagerService service, IApplicationToken token,
 -                ComponentName activityComponent, boolean voiceInteraction, DisplayContent dc,
 -                long inputDispatchingTimeoutNanos, boolean fullscreen, boolean showForAllUsers,
 -                int targetSdk, int orientation, int rotationAnimationHint, int configChanges,
 -                boolean launchTaskBehind, boolean alwaysFocusable, ActivityRecord activityRecord) {
 -            super(service, token, activityComponent, voiceInteraction, dc,
 -                    inputDispatchingTimeoutNanos, fullscreen, showForAllUsers, targetSdk,
 -                    orientation, rotationAnimationHint, configChanges, launchTaskBehind,
 -                    alwaysFocusable, activityRecord);
 -        }
 -
          int getWindowsCount() {
              return mChildren.size();
          }