Home
last modified time | relevance | path

Searched refs:mSharedPreferences (Results 1 – 25 of 46) sorted by relevance

12

/packages/apps/Email/provider_src/com/android/email/
DPreferences.java89 private final SharedPreferences mSharedPreferences; field in Preferences
92 mSharedPreferences = context.getSharedPreferences(PREFERENCES_FILE, Context.MODE_PRIVATE); in Preferences()
109 return getPreferences(context).mSharedPreferences; in getSharedPreferences()
113 return getPreferences(context).mSharedPreferences.getString(ACCOUNT_UUIDS, null); in getLegacyBackupPreference()
117 getPreferences(context).mSharedPreferences.edit().remove(ACCOUNT_UUIDS).apply(); in clearLegacyBackupPreference()
121 mSharedPreferences.edit().putBoolean(ENABLE_DEBUG_LOGGING, value).apply(); in setEnableDebugLogging()
125 return mSharedPreferences.getBoolean(ENABLE_DEBUG_LOGGING, false); in getEnableDebugLogging()
129 mSharedPreferences.edit().putBoolean(ENABLE_EXCHANGE_LOGGING, value).apply(); in setEnableExchangeLogging()
133 return mSharedPreferences.getBoolean(ENABLE_EXCHANGE_LOGGING, false); in getEnableExchangeLogging()
137 mSharedPreferences.edit().putBoolean(ENABLE_EXCHANGE_FILE_LOGGING, value).apply(); in setEnableExchangeFileLogging()
[all …]
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/deviceinfo/storage/
DCachedStorageValuesHelper.java50 private final SharedPreferences mSharedPreferences; field in CachedStorageValuesHelper
57 mSharedPreferences = in CachedStorageValuesHelper()
72 final long freeBytes = mSharedPreferences.getLong(FREE_BYTES_KEY, -1); in getCachedPrivateStorageInfo()
73 final long totalBytes = mSharedPreferences.getLong(TOTAL_BYTES_KEY, -1); in getCachedPrivateStorageInfo()
85 final long gamesSize = mSharedPreferences.getLong(GAME_APPS_SIZE_KEY, -1); in getCachedAppsStorageResult()
86 final long musicAppsSize = mSharedPreferences.getLong(MUSIC_APPS_SIZE_KEY, -1); in getCachedAppsStorageResult()
87 final long videoAppsSize = mSharedPreferences.getLong(VIDEO_APPS_SIZE_KEY, -1); in getCachedAppsStorageResult()
88 final long photoAppSize = mSharedPreferences.getLong(PHOTO_APPS_SIZE_KEY, -1); in getCachedAppsStorageResult()
89 final long otherAppsSize = mSharedPreferences.getLong(OTHER_APPS_SIZE_KEY, -1); in getCachedAppsStorageResult()
90 final long cacheSize = mSharedPreferences.getLong(CACHE_APPS_SIZE_KEY, -1); in getCachedAppsStorageResult()
[all …]
/packages/apps/Settings/src/com/android/settings/deviceinfo/storage/
DCachedStorageValuesHelper.java50 private final SharedPreferences mSharedPreferences; field in CachedStorageValuesHelper
57 mSharedPreferences = in CachedStorageValuesHelper()
72 final long freeBytes = mSharedPreferences.getLong(FREE_BYTES_KEY, -1); in getCachedPrivateStorageInfo()
73 final long totalBytes = mSharedPreferences.getLong(TOTAL_BYTES_KEY, -1); in getCachedPrivateStorageInfo()
85 final long gamesSize = mSharedPreferences.getLong(GAME_APPS_SIZE_KEY, -1); in getCachedAppsStorageResult()
86 final long musicAppsSize = mSharedPreferences.getLong(MUSIC_APPS_SIZE_KEY, -1); in getCachedAppsStorageResult()
87 final long videoAppsSize = mSharedPreferences.getLong(VIDEO_APPS_SIZE_KEY, -1); in getCachedAppsStorageResult()
88 final long photoAppSize = mSharedPreferences.getLong(PHOTO_APPS_SIZE_KEY, -1); in getCachedAppsStorageResult()
89 final long otherAppsSize = mSharedPreferences.getLong(OTHER_APPS_SIZE_KEY, -1); in getCachedAppsStorageResult()
90 final long cacheSize = mSharedPreferences.getLong(CACHE_APPS_SIZE_KEY, -1); in getCachedAppsStorageResult()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/deviceinfo/storage/
DCachedStorageValuesHelperTest.java67 private SharedPreferences mSharedPreferences; field in CachedStorageValuesHelperTest
73 mSharedPreferences = mContext.getSharedPreferences(SHARED_PREFERENCES_NAME, 0); in setUp()
81 mSharedPreferences in getCachedPrivateStorageInfo_cachedValuesAreLoaded()
109 mSharedPreferences in getCachedAppsStorageResult_cachedValuesAreLoaded()
148 mSharedPreferences in getCachedPrivateStorageInfo_nullIfDataIsStale()
174 mSharedPreferences in getCachedAppsStorageResult_nullIfDataIsStale()
201 mSharedPreferences in getCachedPrivateStorageInfo_nullIfWrongUser()
227 mSharedPreferences in getCachedAppsStorageResult_nullIfWrongUser()
282 assertThat(mSharedPreferences.getLong(GAME_APPS_SIZE_KEY, -1)).isEqualTo(1L); in cacheResult_succeeds()
283 assertThat(mSharedPreferences.getLong(MUSIC_APPS_SIZE_KEY, -1)).isEqualTo(10L); in cacheResult_succeeds()
[all …]
/packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/analytics/
DProvisioningAnalyticsTracker.java69 private final ManagedProvisioningSharedPreferences mSharedPreferences; field in ProvisioningAnalyticsTracker
101 mSharedPreferences = prefs; in ProvisioningAnalyticsTracker()
138 .setTimePeriod(AnalyticsUtils.getProvisioningTime(mSharedPreferences))); in logCopyAccountStatus()
152 .setTimePeriod(AnalyticsUtils.getProvisioningTime(mSharedPreferences))); in logProvisioningCancelled()
169 .setTimePeriod(AnalyticsUtils.getProvisioningTime(mSharedPreferences))); in logProvisioningError()
183 .setTimePeriod(AnalyticsUtils.getProvisioningTime(mSharedPreferences))); in logProvisioningNotAllowed()
195 .setTimePeriod(AnalyticsUtils.getProvisioningTime(mSharedPreferences))); in logProvisioningSessionStarted()
207 .setTimePeriod(AnalyticsUtils.getProvisioningTime(mSharedPreferences))); in logProvisioningSessionCompleted()
220 .setTimePeriod(AnalyticsUtils.getProvisioningTime(mSharedPreferences))); in logNumberOfTermsDisplayed()
234 .setTimePeriod(AnalyticsUtils.getProvisioningTime(mSharedPreferences))); in logNumberOfTermsRead()
[all …]
DNetworkTypeLogger.java42 private final ManagedProvisioningSharedPreferences mSharedPreferences; field in NetworkTypeLogger
61 mSharedPreferences = checkNotNull(sharedPreferences); in NetworkTypeLogger()
75 .setTimePeriod(AnalyticsUtils.getProvisioningTime(mSharedPreferences))); in log()
82 .setTimePeriod(AnalyticsUtils.getProvisioningTime(mSharedPreferences))); in log()
/packages/apps/Contacts/tests/src/com/android/contacts/preference/
DContactsPreferencesTest.java44 @Mock private SharedPreferences mSharedPreferences; field in ContactsPreferencesTest
60 .thenReturn(mSharedPreferences); in setUp()
61 Mockito.when(mSharedPreferences.contains(ContactsPreferences.SORT_ORDER_KEY)) in setUp()
63 Mockito.when(mSharedPreferences.contains(ContactsPreferences.DISPLAY_ORDER_KEY)) in setUp()
65 Mockito.when(mSharedPreferences.contains(ContactsPreferences.PHONETIC_NAME_DISPLAY_KEY)) in setUp()
89 Mockito.when(mSharedPreferences.getInt(Mockito.eq(ContactsPreferences.SORT_ORDER_KEY), in testGetSortOrder()
108 Mockito.when(mSharedPreferences.getInt(Mockito.eq(ContactsPreferences.DISPLAY_ORDER_KEY), in testGetDisplayOrder()
127 Mockito.when(mSharedPreferences.getInt( in testGetPhoneticNameDisplay()
138 Mockito.when(mSharedPreferences.getInt( in testRefreshPhoneticNameDisplay()
155 Mockito.when(mSharedPreferences.getInt(Mockito.eq(ContactsPreferences.SORT_ORDER_KEY), in testRefreshSortOrder()
[all …]
/packages/apps/TV/src/com/android/tv/data/
DWatchedHistoryManager.java61 private SharedPreferences mSharedPreferences; field in WatchedHistoryManager
69 final long lastIndex = mSharedPreferences.getLong(PREF_KEY_LAST_INDEX, -1);
81 mSharedPreferences.getString(
141 mSharedPreferences = in loadWatchedHistory()
144 mLastIndex = mSharedPreferences.getLong(PREF_KEY_LAST_INDEX, -1); in loadWatchedHistory()
148 decode(mSharedPreferences.getString(getSharedPreferencesKey(i), null)); in loadWatchedHistory()
156 decode(mSharedPreferences.getString(getSharedPreferencesKey(i), null)); in loadWatchedHistory()
170 Editor editor = mSharedPreferences.edit(); in onLoadFinished()
182 mSharedPreferences.registerOnSharedPreferenceChangeListener( in onLoadFinished()
201 mSharedPreferences in logChannelViewStop()
[all …]
/packages/apps/TvSettings/QuickSettings/src/com/android/tv/quicksettings/
DSetting.java30 private final SharedPreferences mSharedPreferences; field in Setting
35 mSharedPreferences = null; in Setting()
39 mSharedPreferences = sharedPreferences; in Setting()
47 mSharedPreferences = sharedPreferences; in Setting()
74 return mSharedPreferences.getInt(mKey, -1); in getIntValue()
78 return mSharedPreferences.getString(mKey, ""); in getStringValue()
82 mSharedPreferences.edit().putInt(mKey, value).apply(); in setValue()
87 mSharedPreferences.edit().putString(mKey, value).apply(); in setValue()
DSettingsDialog.java58 private SharedPreferences mSharedPreferences; field in SettingsDialog
66 mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); in onCreate()
138 mSharedPreferences.registerOnSharedPreferenceChangeListener(mPresetSettingsListener); in onResume()
145 mSharedPreferences.unregisterOnSharedPreferenceChangeListener(mPresetSettingsListener); in onPause()
151 settings.add(new Setting(mSharedPreferences, "preset", in getSettings()
159 new Setting(mSharedPreferences, settingKeys[i], settingNames[i], in getSettings()
/packages/apps/TV/common/src/com/android/tv/common/feature/
DSharedPreferencesFeature.java32 private SharedPreferences mSharedPreferences; field in SharedPreferencesFeature
53 if (mSharedPreferences == null) { in isEnabled()
54 mSharedPreferences = in isEnabled()
57 mEnabled = mSharedPreferences.getBoolean(mKey, mDefaultValue); in isEnabled()
70 if (mSharedPreferences == null) { in setEnabled()
71 mSharedPreferences = in setEnabled()
75 mSharedPreferences.edit().putBoolean(mKey, enable).apply(); in setEnabled()
78 mSharedPreferences.edit().putBoolean(mKey, enable).apply(); in setEnabled()
/packages/apps/TV/src/com/android/tv/util/
DSetupUtils.java64 private final SharedPreferences mSharedPreferences; field in SetupUtils
76 mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); in SetupUtils()
79 mSharedPreferences.getStringSet(PREF_KEY_SET_UP_INPUTS, Collections.emptySet())); in SetupUtils()
82 mSharedPreferences.getStringSet(PREF_KEY_KNOWN_INPUTS, Collections.emptySet())); in SetupUtils()
85 mSharedPreferences.getStringSet(PREF_KEY_RECOGNIZED_INPUTS, mKnownInputs)); in SetupUtils()
86 mIsFirstTune = mSharedPreferences.getBoolean(PREF_KEY_IS_FIRST_TUNE, true); in SetupUtils()
203 mSharedPreferences in markAsKnownInput()
242 mSharedPreferences in markAllInputsRecognized()
318 mSharedPreferences.edit().putBoolean(PREF_KEY_IS_FIRST_TUNE, false).apply(); in onTuned()
355 mSharedPreferences in onInputListUpdated()
[all …]
/packages/apps/EmergencyInfo/tests/robolectric/src/com/android/emergency/util/
DPreferenceUtilsTest.java56 @Mock SharedPreferences mSharedPreferences; field in PreferenceUtilsTest
72 when(mContext.getSharedPreferences(anyString(), anyInt())).thenReturn(mSharedPreferences); in setUp()
73 when(mSharedPreferences.edit()).thenReturn(mSharedPreferencesEditor); in setUp()
80 when(mSharedPreferences.getString(anyString(), anyString())).thenReturn(""); in testHasAtLeastOnePreferenceSet_notSet()
87 when(mSharedPreferences.getString(anyString(), anyString())).thenReturn("mxyzptlk"); in testHasAtLeastOnePreferenceSet_set()
94 when(mSharedPreferences.getString(eq(PreferenceKeys.KEY_EMERGENCY_CONTACTS), any())) in testHasAtLeastOneEmergencyContact_notSet()
104 when(mSharedPreferences.getString(eq(PreferenceKeys.KEY_EMERGENCY_CONTACTS), any())) in testHasAtLeastOneEmergencyContact_set()
127 when(mSharedPreferences.getString(eq(PreferenceKeys.KEY_EMERGENCY_CONTACTS), any())) in testUpdateSettingsSuggestionState_contactSet()
143 when(mSharedPreferences.getString(anyString(), anyString())).thenReturn(""); in testUpdateSettingsSuggestionState_noPreferencesOrContactSet()
155 when(mSharedPreferences.getString(eq(PreferenceKeys.KEY_ALLERGIES), any())) in testUpdateSettingsSuggestionState_preferenceSet()
/packages/apps/Settings/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/
DNotificationChannelWorkerTest.java52 private SharedPreferences mSharedPreferences; field in NotificationChannelWorkerTest
63 mSharedPreferences = mContext.getSharedPreferences(PREFS, MODE_PRIVATE); in setUp()
77 final Set<String> interactedPackages = mSharedPreferences.getStringSet( in onSliceUnpinned_interactedPackageIsUninstalled_shouldRemovePackage()
88 final Set<String> interactedPackages = mSharedPreferences.getStringSet( in onSliceUnpinned_interactedPackageIsInstalled_shouldKeepPackage()
103 mSharedPreferences.edit().putStringSet(PREF_KEY_INTERACTED_PACKAGES, in addInteractedPackageToSharedPreference()
108 if (mSharedPreferences.contains(PREF_KEY_INTERACTED_PACKAGES)) { in removeInteractedPackageFromSharedPreference()
109 mSharedPreferences.edit().remove(PREF_KEY_INTERACTED_PACKAGES).apply(); in removeInteractedPackageFromSharedPreference()
DContextualNotificationChannelSliceTest.java50 private SharedPreferences mSharedPreferences; field in ContextualNotificationChannelSliceTest
56 mSharedPreferences = mContext.getSharedPreferences(PREFS, MODE_PRIVATE); in setUp()
98 mSharedPreferences.edit().putStringSet(PREF_KEY_INTERACTED_PACKAGES, in addInteractedPackageToSharedPreference()
103 if (mSharedPreferences.contains(PREF_KEY_INTERACTED_PACKAGES)) { in removeInteractedPackageFromSharedPreference()
104 mSharedPreferences.edit().remove(PREF_KEY_INTERACTED_PACKAGES).apply(); in removeInteractedPackageFromSharedPreference()
/packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/common/
DManagedProvisioningSharedPreferences.java41 private final SharedPreferences mSharedPreferences; field in ManagedProvisioningSharedPreferences
44 mSharedPreferences = context.getSharedPreferences(SHARED_PREFERENCE, Context.MODE_PRIVATE); in ManagedProvisioningSharedPreferences()
49 return mSharedPreferences.getLong(KEY_PROVISIONING_ID, DEFAULT_PROVISIONING_ID); in getProvisioningId()
61 mSharedPreferences.edit().putLong(KEY_PROVISIONING_ID, provisioningId).commit(); in incrementAndGetProvisioningId()
70 mSharedPreferences.edit() in writeProvisioningStartedTimestamp()
79 return mSharedPreferences.getLong(KEY_PROVISIONING_START_TIMESTAMP, 0L); in getProvisioningStartedTimestamp()
/packages/apps/UnifiedEmail/src/com/android/mail/preferences/
DVersionedPrefs.java44 private final SharedPreferences mSharedPreferences; field in VersionedPrefs
64 mSharedPreferences = context.getSharedPreferences(sharedPrefsName, Context.MODE_PRIVATE); in VersionedPrefs()
65 mEditor = mSharedPreferences.edit(); in VersionedPrefs()
99 return mSharedPreferences; in getSharedPreferences()
108 mSharedPreferences.registerOnSharedPreferenceChangeListener(listener); in registerOnSharedPreferenceChangeListener()
113 mSharedPreferences.unregisterOnSharedPreferenceChangeListener(listener); in unregisterOnSharedPreferenceChangeListener()
120 return mSharedPreferences.getInt(PREFS_VERSION_NUMBER, 0); in getCurrentVersion()
/packages/apps/Car/Dialer/src/com/android/car/dialer/livedata/
DSharedPreferencesLiveData.java34 private final SharedPreferences mSharedPreferences; field in SharedPreferencesLiveData
41 mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); in SharedPreferencesLiveData()
54 mSharedPreferences.registerOnSharedPreferenceChangeListener( in onActive()
60 mSharedPreferences.unregisterOnSharedPreferenceChangeListener( in onInactive()
66 setValue(mSharedPreferences); in updateSharedPreferences()
/packages/apps/Settings/tests/robotests/src/com/android/settings/homepage/contextualcards/
DContextualCardFeatureProviderImplTest.java64 private SharedPreferences mSharedPreferences; field in ContextualCardFeatureProviderImplTest
70 mSharedPreferences = mContext.getSharedPreferences(PREFS, MODE_PRIVATE); in setUp()
87 final Set<String> interactedPackages = mSharedPreferences.getStringSet( in logNotificationPackage_isContextualNotificationChannel_shouldLogPackage()
99 final Set<String> interactedPackages = mSharedPreferences.getStringSet( in logNotificationPackage_isNotContextualNotificationChannel_shouldNotLogPackage()
126 if (mSharedPreferences.contains(PREF_KEY_INTERACTED_PACKAGES)) { in removeInteractedPackageFromSharedPreference()
127 mSharedPreferences.edit().remove(PREF_KEY_INTERACTED_PACKAGES).apply(); in removeInteractedPackageFromSharedPreference()
/packages/apps/Settings/tests/robotests/src/com/android/settings/datausage/
DBillingCycleSettingsTest.java90 private SharedPreferences mSharedPreferences; field in BillingCycleSettingsTest
98 mSharedPreferences = RuntimeEnvironment.application.getSharedPreferences( in setUp()
101 when(mMockPreferenceManager.getSharedPreferences()).thenReturn(mSharedPreferences); in setUp()
105 mSharedPreferences.edit().putBoolean( in setUp()
113 assertThat(mSharedPreferences.getBoolean(BillingCycleSettings.KEY_SET_DATA_LIMIT, true)) in testDataUsageLimit_shouldNotBeSetOnCancel()
122 assertThat(mSharedPreferences.getBoolean(BillingCycleSettings.KEY_SET_DATA_LIMIT, false)) in testDataUsageLimit_shouldBeSetOnConfirmation()
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/name/
DDeviceNameSuggestionStatus.java28 private SharedPreferences mSharedPreferences; field in DeviceNameSuggestionStatus
42 mSharedPreferences = context.getSharedPreferences( in DeviceNameSuggestionStatus()
51 mSharedPreferences.edit().putBoolean(IS_SUGGESTION_FINISHED, true).apply(); in setFinished()
60 return mSharedPreferences.getBoolean(IS_SUGGESTION_FINISHED, false); in isFinished()
/packages/apps/LegacyCamera/src/com/android/camera/
DCameraPreference.java33 private SharedPreferences mSharedPreferences; field in CameraPreference
55 if (mSharedPreferences == null) { in getSharedPreferences()
56 mSharedPreferences = ComboPreferences.get(mContext); in getSharedPreferences()
58 return mSharedPreferences; in getSharedPreferences()
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/common/
DManagedProvisioningSharedPreferencesTest.java46 private SharedPreferences mSharedPreferences; field in ManagedProvisioningSharedPreferencesTest
53 mSharedPreferences = targetContext.getSharedPreferences(KEY_TEST_SHARED_PREFERENCE, in setUp()
58 .thenReturn(mSharedPreferences); in setUp()
68 mSharedPreferences.edit().clear().commit(); in cleanUp()
/packages/apps/Car/Settings/src/com/android/car/settings/wifi/
DWifiTetherPasswordPreferenceController.java67 private final SharedPreferences mSharedPreferences = field in WifiTetherPasswordPreferenceController
152 mSharedPreferences.getString(KEY_SAVED_PASSWORD, /* defaultValue= */ null))) { in getSyncedPassword()
153 return mSharedPreferences.getString(KEY_SAVED_PASSWORD, /* defaultValue= */ null); in getSyncedPassword()
171 mSharedPreferences.edit().putString(KEY_SAVED_PASSWORD, password).commit(); in updatePassword()
/packages/apps/EmergencyInfo/tests/robolectric/src/com/android/emergency/preferences/
DEmergencyListPreferenceTest.java48 @Mock private SharedPreferences mSharedPreferences; field in EmergencyListPreferenceTest
55 when(mPreferenceManager.getSharedPreferences()).thenReturn(mSharedPreferences); in setUp()
72 when(mSharedPreferences.getString( in testReloadFromPreference()
95 when(mSharedPreferences.getString( in testSetValue()

12