diff options
author | Jeff Sharkey <jsharkey@android.com> | 2013-01-17 18:18:22 -0800 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2013-01-17 18:25:47 -0800 |
commit | 66a017b63461a22842b3678c9520f803d5ddadfc (patch) | |
tree | 07a0d63d0b362628ecbf6083aadf726d0ae02636 /test-runner/src | |
parent | 54781207d31fd0fb33c6038b6999ba649fc488b2 (diff) | |
download | frameworks_base-66a017b63461a22842b3678c9520f803d5ddadfc.zip frameworks_base-66a017b63461a22842b3678c9520f803d5ddadfc.tar.gz frameworks_base-66a017b63461a22842b3678c9520f803d5ddadfc.tar.bz2 |
Always give ContentResolver a valid Context.
Also add MockContentResolver constructor to provide a Context, and
move to singleton ActivityThread, since there is only one inside
each process. This makes ActivityThread accessible from threads like
InstrumentationThread.
Change-Id: Ib8b18f1b9bba8820ff412d782a43511066eabf24
Diffstat (limited to 'test-runner/src')
-rw-r--r-- | test-runner/src/android/test/mock/MockContentResolver.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/test-runner/src/android/test/mock/MockContentResolver.java b/test-runner/src/android/test/mock/MockContentResolver.java index 715da0f..aec6c77 100644 --- a/test-runner/src/android/test/mock/MockContentResolver.java +++ b/test-runner/src/android/test/mock/MockContentResolver.java @@ -54,12 +54,20 @@ import java.util.Map; public class MockContentResolver extends ContentResolver { Map<String, ContentProvider> mProviders; - /* - * Creates a local map of providers. This map is used instead of the global map when an - * API call tries to acquire a provider. + /** + * Creates a local map of providers. This map is used instead of the global + * map when an API call tries to acquire a provider. */ public MockContentResolver() { - super(null); + this(null); + } + + /** + * Creates a local map of providers. This map is used instead of the global + * map when an API call tries to acquire a provider. + */ + public MockContentResolver(Context context) { + super(context); mProviders = Maps.newHashMap(); } |