diff options
author | Jason Monk <jmonk@google.com> | 2017-06-01 11:21:14 -0400 |
---|---|---|
committer | Jason Monk <jmonk@google.com> | 2017-06-01 11:21:14 -0400 |
commit | 893f0bdcb73785ce0e06e9f935f5a7027cf77f14 (patch) | |
tree | c076b117cfb1aa07628e29c988c5b5829b305c45 /tests/testables | |
parent | 8bc542695c2796fd26d230b86b5f2628ddb9fd1c (diff) |
Add checks against incorrect context use in sysui tests
Fix incorrect usages found by this check.
Test: runtest systemui
Bug: 62251903
Change-Id: I45a762f96838e617833c1cbe003e583087bb8176
Diffstat (limited to 'tests/testables')
-rw-r--r-- | tests/testables/src/android/testing/ViewUtils.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/testables/src/android/testing/ViewUtils.java b/tests/testables/src/android/testing/ViewUtils.java index 5a651aacc74f..fca44aed0447 100644 --- a/tests/testables/src/android/testing/ViewUtils.java +++ b/tests/testables/src/android/testing/ViewUtils.java @@ -31,12 +31,10 @@ public class ViewUtils { LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, LayoutParams.TYPE_APPLICATION_OVERLAY, 0, PixelFormat.TRANSLUCENT); - InstrumentationRegistry.getContext() - .getSystemService(WindowManager.class).addView(view, lp); + view.getContext().getSystemService(WindowManager.class).addView(view, lp); } public static void detachView(View view) { - InstrumentationRegistry.getContext() - .getSystemService(WindowManager.class).removeViewImmediate(view); + view.getContext().getSystemService(WindowManager.class).removeViewImmediate(view); } } |