Home | History | Annotate | Download | only in testing

Lines Matching defs:Settings

22 import android.provider.Settings;
31 * Allows calls to android.provider.Settings to be tested easier.
33 * This provides a simple copy-on-write implementation of settings that gets cleared
47 private TestableSettingsProvider(ContentProviderClient settings) {
48 mSettings = settings;
57 Settings.Global.clearProviderForTest();
58 Settings.Secure.clearProviderForTest();
59 Settings.System.clearProviderForTest();
60 // Verify that if any test is using TestableContext, they all have the correct settings
62 assertEquals("Incorrect settings provider, test using incorrect Context?", MY_UNIQUE_KEY,
63 Settings.Global.getString(context.getContentResolver(), MY_UNIQUE_KEY));
64 assertEquals("Incorrect settings provider, test using incorrect Context?", MY_UNIQUE_KEY,
65 Settings.Secure.getString(context.getContentResolver(), MY_UNIQUE_KEY));
66 assertEquals("Incorrect settings provider, test using incorrect Context?", MY_UNIQUE_KEY,
67 Settings.System.getString(context.getContentResolver(), MY_UNIQUE_KEY));
74 final int userId = extras.getInt(Settings.CALL_METHOD_USER_KEY, 0);
87 out.putString(Settings.NameValueTable.VALUE, value);
90 // Fall through to real settings.
92 if (DEBUG) Log.d(TAG, "Falling through to real settings " + method);
95 call.remove(Settings.CALL_METHOD_TRACK_GENERATION_KEY);
103 value = extras.getString(Settings.NameValueTable.VALUE, null);
122 * Since the settings provider is cached inside android.provider.Settings, this must
125 static TestableSettingsProvider getFakeSettingsProvider(ContentProviderClient settings) {
127 sInstance = new TestableSettingsProvider(settings);