Home
last modified time | relevance | path

Searched refs:prefs (Results 1 – 19 of 19) sorted by relevance

/cts/tests/tests/content/src/android/content/cts/
DSharedPreferencesTest.java54 SharedPreferences prefs = getPrefs(); in setUp() local
55 prefs.edit().clear().commit(); in setUp()
71 SharedPreferences prefs = getPrefs(); in testCommitCreatesFiles() local
73 prefs.edit().putString("foo", "bar").commit(); in testCommitCreatesFiles()
78 SharedPreferences prefs = getPrefs(); in testDefaults() local
80 assertFalse(prefs.contains(key)); in testDefaults()
81 assertEquals(0, prefs.getAll().size()); in testDefaults()
82 assertTrue(prefs.getAll().isEmpty()); in testDefaults()
83 assertEquals(false, prefs.getBoolean(key, false)); in testDefaults()
84 assertEquals(true, prefs.getBoolean(key, true)); in testDefaults()
[all …]
/cts/hostsidetests/securitybulletin/test-apps/CVE-2021-39797/test-app/src/android/security/cts/CVE_2021_39797_test/
DPocActivity.java38 SharedPreferences prefs = in onCreate() local
40 if (prefs == null) { in onCreate()
43 int taskIdSaved = prefs.getInt(getString(R.string.taskId), -1); in onCreate()
45 SharedPreferences.Editor editor = prefs.edit(); in onCreate()
50 SharedPreferences.Editor editor = prefs.edit(); in onCreate()
54 setResult(prefs, getResources().getInteger(R.integer.noAssumptionFailure), ""); in onCreate()
63 setResult(prefs, getResources().getInteger(R.integer.assumptionFailure), in onCreate()
78 setResult(prefs, getResources().getInteger(R.integer.assumptionFailure), in onCreate()
83 setResult(prefs, getResources().getInteger(R.integer.assumptionFailure), in onCreate()
95 setResult(prefs, getResources().getInteger(R.integer.assumptionFailure), in onCreate()
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/car/
DGarageModeTestActivity.java84 SharedPreferences prefs = context.getSharedPreferences( in onCreate() local
87 SharedPreferences.Editor editor = prefs.edit(); in onCreate()
124 SharedPreferences prefs = context.getSharedPreferences( in verifyStatus() local
130 long initiateTime = prefs.getLong(GarageModeChecker.PREFS_INITIATION, 0); in verifyStatus()
131 long garageModeStart = prefs.getLong(GarageModeChecker.PREFS_GARAGE_MODE_START, 0); in verifyStatus()
132 long garageModeEnd = prefs.getLong(GarageModeChecker.PREFS_GARAGE_MODE_END, 0); in verifyStatus()
133 long termination = prefs.getLong(GarageModeChecker.PREFS_TERMINATION, 0); in verifyStatus()
134 long jobUpdate = prefs.getLong(GarageModeChecker.PREFS_JOB_UPDATE, 0); in verifyStatus()
135 boolean hadConnectivity = prefs.getBoolean(GarageModeChecker.PREFS_HAD_CONNECTIVITY, false); in verifyStatus()
136 long startBootCount = prefs.getLong(GarageModeChecker.PREFS_START_BOOT_COUNT, 0); in verifyStatus()
DGarageModeChecker.java121 SharedPreferences prefs = mIdleJobContext.getSharedPreferences(PREFS_FILE_NAME,
123 SharedPreferences.Editor editor = prefs.edit();
141 SharedPreferences prefs = mIdleJobContext.getSharedPreferences(PREFS_FILE_NAME,
143 SharedPreferences.Editor editor = prefs.edit();
164 SharedPreferences prefs = mIdleJobContext.getSharedPreferences(PREFS_FILE_NAME, in onStartJob() local
166 SharedPreferences.Editor editor = prefs.edit(); in onStartJob()
204 SharedPreferences prefs = mIdleJobContext.getSharedPreferences(PREFS_FILE_NAME, in doInBackground() local
212 editor = prefs.edit(); in doInBackground()
220 editor = prefs.edit(); in doInBackground()
/cts/hostsidetests/calllog/app/src/android/provider/cts/contacts/testapp/
DBootReceiver.java22 SharedPreferences prefs = context.createDeviceProtectedStorageContext() in onReceive() local
24 prefs.edit().putBoolean(LOCKED_BOOT_COMPLETE, true).commit(); in onReceive()
40 SharedPreferences prefs = in waitForBootComplete() local
43 prefs.registerOnSharedPreferenceChangeListener( in waitForBootComplete()
49 if (prefs.getBoolean(action, false)) return true; in waitForBootComplete()
/cts/tests/inputmethod/mockspellchecker/src/com/android/cts/mockspellchecker/
DSharedPrefsProvider.kt52 val prefs = getSharedPreferences(context) in getType() constant
53 val bytes = Base64.decode(prefs.getString(uri.path, ""), Base64.DEFAULT) in getType()
70 val prefs = getSharedPreferences(context) in update() constant
73 prefs.edit().putString(uri.path, str).apply() in update()
83 val prefs = getSharedPreferences(context) in delete() constant
84 prefs.edit().remove(uri.path).apply() in delete()
/cts/hostsidetests/backup/KeyValueApp/src/android/cts/backup/keyvaluerestoreapp/
DKeyValueBackupRestoreTest.java230 SharedPreferences prefs = mContext.getSharedPreferences(TEST_PREFS_1, MODE_PRIVATE); in saveSharedPreferencesValues() local
231 SharedPreferences.Editor editor = prefs.edit(); in saveSharedPreferencesValues()
236 prefs = mContext.getSharedPreferences(TEST_PREFS_2, MODE_PRIVATE); in saveSharedPreferencesValues()
237 editor = prefs.edit(); in saveSharedPreferencesValues()
257 SharedPreferences prefs = mContext.getSharedPreferences(TEST_PREFS_1, MODE_PRIVATE); in readSharedPrefValues() local
258 mIntValue = prefs.getInt(INT_PREF, DEFAULT_INT_VALUE); in readSharedPrefValues()
259 mBoolValue = prefs.getBoolean(BOOL_PREF, DEFAULT_BOOL_VALUE); in readSharedPrefValues()
261 prefs = mContext.getSharedPreferences(TEST_PREFS_2, MODE_PRIVATE); in readSharedPrefValues()
262 mFloatValue = prefs.getFloat(FLOAT_PREF, DEFAULT_FLOAT_VALUE); in readSharedPrefValues()
263 mLongValue = prefs.getLong(LONG_PREF, DEFAULT_LONG_VALUE); in readSharedPrefValues()
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/admin/
DPolicySerializationTestActivity.java112 SharedPreferences prefs = getPreferences(MODE_PRIVATE); in loadPolicy() local
113 if (prefs.getBoolean(LOAD_EXPECTED_POLICY_PREFERENCE, false)) { in loadPolicy()
115 item.loadExpectedValue(prefs); in loadPolicy()
135 SharedPreferences prefs = getPreferences(MODE_PRIVATE); in generateRandomPolicy() local
136 SharedPreferences.Editor editor = prefs.edit(); in generateRandomPolicy()
175 SharedPreferences prefs = getPreferences(MODE_PRIVATE); in handleAddDeviceAdminResult() local
176 SharedPreferences.Editor editor = prefs.edit(); in handleAddDeviceAdminResult()
262 void loadExpectedValue(SharedPreferences prefs); in loadExpectedValue() argument
300 public final void loadExpectedValue(SharedPreferences prefs) { in loadExpectedValue() argument
301 mExpectedValue = getPreferencesValue(prefs); in loadExpectedValue()
[all …]
/cts/hostsidetests/backup/RestoreAnyVersion/src/
DRestoreAnyVersionTest.java102 SharedPreferences prefs = mContext.getSharedPreferences(TEST_PREFS_1, MODE_PRIVATE); in saveAppVersionCodeToSharedPreference() local
103 SharedPreferences.Editor editor = prefs.edit(); in saveAppVersionCodeToSharedPreference()
111 SharedPreferences prefs = mContext.getSharedPreferences(TEST_PREFS_1, MODE_PRIVATE); in getAppSharedPreference() local
112 int intValue = prefs.getInt(INT_PREF, DEFAULT_INT_VALUE); in getAppSharedPreference()
/cts/hostsidetests/appsecurity/test-apps/AppWithData/src/com/android/cts/appwithdata/
DCreatePrivateDataTest.java108 SharedPreferences prefs = mContext.getSharedPreferences(PREFERENCES_FILE_NAME, 0); in writeToPreferences() local
109 SharedPreferences.Editor editor = prefs.edit(); in writeToPreferences()
112 assertEquals(PREFERENCE_VALUE, prefs.getString(PREFERENCE_KEY, null)); in writeToPreferences()
149 SharedPreferences prefs = mContext.getSharedPreferences(PREFERENCES_FILE_NAME, 0); in assertPreferencesDataDoesNotExist() local
150 assertNull(prefs.getString(PREFERENCE_KEY, null)); in assertPreferencesDataDoesNotExist()
/cts/hostsidetests/devicepolicy/app/IntentReceiver/src/com/android/cts/intent/receiver/
DBroadcastIntentReceiver.java37 SharedPreferences prefs = c.getSharedPreferences(PREFERENCES_NAME, Context.MODE_PRIVATE); in onReceive() local
38 SharedPreferences.Editor editor = prefs.edit(); in onReceive()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/notifications/
DConditionProviderVerifierActivity.java709 SharedPreferences prefs = mContext.getSharedPreferences(PREFS, Context.MODE_PRIVATE); in test() local
714 Log.d(TAG, "Check pref for broadcast " + prefs.contains(mId) in test()
715 + " " + prefs.getInt(mId, AUTOMATIC_RULE_STATUS_UNKNOWN)); in test()
716 if (prefs.contains(mId) in test()
717 && EXPECTED_STATUS == prefs.getInt(mId, AUTOMATIC_RULE_STATUS_UNKNOWN)) { in test()
738 SharedPreferences prefs = mContext.getSharedPreferences(PREFS, Context.MODE_PRIVATE); in tearDown() local
739 prefs.edit().clear().commit(); in tearDown()
786 SharedPreferences prefs = mContext.getSharedPreferences(PREFS, Context.MODE_PRIVATE); in test() local
791 Log.d(TAG, "Check pref for broadcast " + prefs.contains(mId) in test()
792 + " " + prefs.getInt(mId, AUTOMATIC_RULE_STATUS_UNKNOWN)); in test()
[all …]
DAutomaticZenRuleStatusReceiver.java34 SharedPreferences prefs = context.getSharedPreferences( in onReceive() local
36 SharedPreferences.Editor editor = prefs.edit(); in onReceive()
DBlockChangeReceiver.java33 SharedPreferences prefs = context.getSharedPreferences( in onReceive() local
35 SharedPreferences.Editor editor = prefs.edit(); in onReceive()
DNotificationListenerVerifierActivity.java448 SharedPreferences prefs = in test() local
453 if (prefs.contains(mChannelId) && prefs.getBoolean(mChannelId, false)) { in test()
475 SharedPreferences prefs = in tearDown() local
478 SharedPreferences.Editor editor = prefs.edit(); in tearDown()
627 SharedPreferences prefs = in test() local
632 if (prefs.contains(mGroupId) && prefs.getBoolean(mGroupId, false)) { in test()
653 SharedPreferences prefs = in tearDown() local
656 SharedPreferences.Editor editor = prefs.edit(); in tearDown()
698 SharedPreferences prefs = in test() local
703 Log.d(TAG, "Got broadcast " + prefs.contains(mContext.getPackageName())); in test()
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/camera/fov/
DDetermineFovActivity.java185 SharedPreferences prefs = in getMarkerDistance() local
187 return Float.parseFloat(prefs.getString( in getMarkerDistance()
194 SharedPreferences prefs = in getTargetDistance() local
196 return Float.parseFloat(prefs.getString( in getTargetDistance()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DSecurityLoggingTest.java436 final SharedPreferences prefs = in testVerifyLogIds() local
445 prefs.contains(prevBatchLastIdKey)); in testVerifyLogIds()
446 final long prevBatchLastId = prefs.getLong(prevBatchLastIdKey, 0); in testVerifyLogIds()
453 prefs.edit().putLong(currBatchLastIdKey, lastId).commit(); in testVerifyLogIds()
/cts/tests/libcore/luni/
DAndroid.bp518 "libcore.java.util.prefs",
519 "org.apache.harmony.tests.java.util.prefs",
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DByodFlowTestActivity.java860 final SharedPreferences prefs = getProvisioningPreferences(context); in markProvisioningCompleteBroadcastWithStatus() local
861 final SharedPreferences.Editor editor = prefs.edit(); in markProvisioningCompleteBroadcastWithStatus()