diff options
| author | 2024-01-16 12:39:38 +0000 | |
|---|---|---|
| committer | 2024-01-16 13:40:43 +0000 | |
| commit | caa341ae082a5fb5316828618943a336fc2abe33 (patch) | |
| tree | 9769fc0afa11233a5bd4d2091441515509ca7e0f | |
| parent | 3c87a01e0896056033831eb031fe74f0d1fcc9f7 (diff) | |
Remove getUserId mock method from Mock Context.
getUserId is a widely used context method and mocking it with an exception can cause many failures if not overridden with a valid value.
Removed the getUserId() method from mock context to use actual invocation, Text classes can still override the method in the Test class implementation if it's needed for any specific case.
Test: atest EabControllerTest -c
Test: atest TelephonyProviderTest -c
Bug: 319931444
Bug: 319437162
Bug: 320426061
Change-Id: Ibf9a2efc22a3bdbc8403dfbc25be07485f4336b4
| -rw-r--r-- | test-mock/src/android/test/mock/MockContext.java | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/test-mock/src/android/test/mock/MockContext.java b/test-mock/src/android/test/mock/MockContext.java index f5f9d97787ae..cf38bea55f2c 100644 --- a/test-mock/src/android/test/mock/MockContext.java +++ b/test-mock/src/android/test/mock/MockContext.java @@ -822,12 +822,6 @@ public class MockContext extends Context { throw new UnsupportedOperationException(); } - /** {@hide} */ - @Override - public int getUserId() { - throw new UnsupportedOperationException(); - } - @Override public Context createConfigurationContext(Configuration overrideConfiguration) { throw new UnsupportedOperationException(); |