diff options
author | Chris Li <lihongyu@google.com> | 2020-03-17 10:12:24 -0700 |
---|---|---|
committer | Chris Li <lihongyu@google.com> | 2020-03-26 22:09:28 -0700 |
commit | bfe1b70fcd3f3688bd27be317ee0830e80cc00fc (patch) | |
tree | 5a62b351c6731fd8e3111693b73b42f218e9ff23 /test-mock/src | |
parent | 2279fd5f469d16da8e458f3bec6a1a072fc296f3 (diff) |
Report incorrect context usage in ViewConfiguration
Before, the documentation said that the passed context is an application context, which is incorrect to get the density, window metrics, and window manager. We should use visual context to get these instead.
Bug: 151474461
Test: StrictModeTest#testIncorrectContextUse_GetViewConfiguration
Change-Id: Iea28d727cafbb3ec8536742c6a0e594f73fe5a51
Diffstat (limited to 'test-mock/src')
-rw-r--r-- | test-mock/src/android/test/mock/MockContext.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test-mock/src/android/test/mock/MockContext.java b/test-mock/src/android/test/mock/MockContext.java index 784ee85fea34..cf3b03cae72e 100644 --- a/test-mock/src/android/test/mock/MockContext.java +++ b/test-mock/src/android/test/mock/MockContext.java @@ -928,4 +928,10 @@ public class MockContext extends Context { public Handler getMainThreadHandler() { throw new UnsupportedOperationException(); } + + /** {@hide} */ + @Override + public boolean isUiContext() { + throw new UnsupportedOperationException(); + } } |