From 756220bd1912535840388a6743830d2e59ad4964 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 14 Aug 2012 16:45:30 -0700 Subject: Add API to create new contexts with custom configurations. This allows you to, say, make a Context whose configuration is set to a different density than the actual density of the device. The main API is Context.createConfigurationContext(). There is also a new API on ContextThemeWrapper that allows you to apply an override context before its resources are retrieved, which addresses some feature requests from developers to be able to customize the context their app is running in. Change-Id: I88364986660088521e24b567e2fda22fb7042819 --- test-runner/src/android/test/mock/MockContext.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test-runner') diff --git a/test-runner/src/android/test/mock/MockContext.java b/test-runner/src/android/test/mock/MockContext.java index 9acffa3..36f2c14 100644 --- a/test-runner/src/android/test/mock/MockContext.java +++ b/test-runner/src/android/test/mock/MockContext.java @@ -28,6 +28,7 @@ import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.AssetManager; +import android.content.res.Configuration; import android.content.res.Resources; import android.database.DatabaseErrorHandler; import android.database.sqlite.SQLiteDatabase; @@ -477,6 +478,11 @@ public class MockContext extends Context { } @Override + public Context createConfigurationContext(Configuration overrideConfiguration) { + throw new UnsupportedOperationException(); + } + + @Override public boolean isRestricted() { throw new UnsupportedOperationException(); } -- cgit v1.1