diff options
author | 2022-10-05 14:09:28 +0200 | |
---|---|---|
committer | 2022-10-17 17:45:53 +0200 | |
commit | 7c1be3298d99cde28ac39b3095391065d619eaa8 (patch) | |
tree | 781e79b896625a8a8bf93e96c3e5fa3c8948b38d /test-mock | |
parent | 0050a51961000057f7858bb2b8892892aaad3232 (diff) |
Add deviceId to Context and allow for creating Contexts with different deviceId.
Applications may create contexts associated with the default host device or with any virtual device. The only way to create a non-default device context for now is via an explcit createDeviceContext call.
Bug: 239152561
Test: atest FrameworksCoreTests:ContextTest
Change-Id: If18dc7661fb232b0bc40121c723673ba880be9d5
Diffstat (limited to 'test-mock')
-rw-r--r-- | test-mock/src/android/test/mock/MockContext.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test-mock/src/android/test/mock/MockContext.java b/test-mock/src/android/test/mock/MockContext.java index 49daad324bd1..8fc8c7d162f4 100644 --- a/test-mock/src/android/test/mock/MockContext.java +++ b/test-mock/src/android/test/mock/MockContext.java @@ -839,6 +839,11 @@ public class MockContext extends Context { } @Override + public @NonNull Context createDeviceContext(int deviceId) { + throw new UnsupportedOperationException(); + } + + @Override public @NonNull Context createWindowContext(int type, Bundle options) { throw new UnsupportedOperationException(); } @@ -883,6 +888,11 @@ public class MockContext extends Context { } @Override + public int getDeviceId() { + throw new UnsupportedOperationException(); + } + + @Override public File[] getExternalFilesDirs(String type) { throw new UnsupportedOperationException(); } |