Home
last modified time | relevance | path

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

/development/samples/browseable/Geofencing/Application/src/com.example.android.wearable.geofencing/
DSimpleGeofenceStore.java87 SharedPreferences.Editor prefs = mPrefs.edit(); in setGeofence() local
89 prefs.putFloat(getGeofenceFieldKey(id, KEY_LATITUDE), (float) geofence.getLatitude()); in setGeofence()
90 prefs.putFloat(getGeofenceFieldKey(id, KEY_LONGITUDE), (float) geofence.getLongitude()); in setGeofence()
91 prefs.putFloat(getGeofenceFieldKey(id, KEY_RADIUS), geofence.getRadius()); in setGeofence()
92 prefs.putLong(getGeofenceFieldKey(id, KEY_EXPIRATION_DURATION), in setGeofence()
94 prefs.putInt(getGeofenceFieldKey(id, KEY_TRANSITION_TYPE), in setGeofence()
97 prefs.commit(); in setGeofence()
104 SharedPreferences.Editor prefs = mPrefs.edit(); in clearGeofence() local
105 prefs.remove(getGeofenceFieldKey(id, KEY_LATITUDE)); in clearGeofence()
106 prefs.remove(getGeofenceFieldKey(id, KEY_LONGITUDE)); in clearGeofence()
[all …]
/development/samples/browseable/CardEmulation/src/com.example.android.cardemulation/
DAccountStorage.java42 SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(c); in SetAccount() local
43 prefs.edit().putString(PREF_ACCOUNT_NUMBER, s).commit(); in SetAccount()
51 SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(c); in GetAccount() local
52 String account = prefs.getString(PREF_ACCOUNT_NUMBER, DEFAULT_ACCOUNT_NUMBER); in GetAccount()
/development/samples/ApiDemos/src/com/example/android/apis/app/
DPersistentState.java99 SharedPreferences prefs = getPreferences(0); in onResume() local
100 String restoredText = prefs.getString("text", null); in onResume()
104 int selectionStart = prefs.getInt("selection-start", -1); in onResume()
105 int selectionEnd = prefs.getInt("selection-end", -1); in onResume()
DDeviceAdminSample.java486 final SharedPreferences prefs = getPreferenceManager().getSharedPreferences(); in reloadSummaries() local
489 String component = prefs.getString(mTrustAgentComponent.getKey(), null); in reloadSummaries()
493 String features = prefs.getString(mTrustAgentFeatures.getKey(), null); in reloadSummaries()
/development/samples/training/device-management-policy/src/com/example/training/deviceadmin/
DPolicy.java89 SharedPreferences prefs = mContext.getSharedPreferences(APP_PREF, Context.MODE_PRIVATE); in readFromLocal() local
90 mPasswordQuality = prefs.getInt(KEY_PASSWORD_QUALITY, -1); in readFromLocal()
91 mPasswordLength = prefs.getInt(KEY_PASSWORD_LENGTH, -1); in readFromLocal()
92 mPasswordMinUpperCase = prefs.getInt(KEY_PASSWORD_MIN_UPPERCASE, -1); in readFromLocal()
163 SharedPreferences prefs = context.getSharedPreferences(APP_PREF, Activity.MODE_PRIVATE); in onDisabled() local
164 prefs.edit().clear().commit(); in onDisabled()
DPolicySetupActivity.java67 SharedPreferences prefs = getSharedPreferences(APP_PREF, MODE_PRIVATE); in onResume() local
68 final int savedScreenId = prefs.getInt(SCREEN_ID_KEY, UNKNOWN_SCREEN_ID); in onResume()
/development/samples/ToyVpn/src/com/example/android/toyvpn/
DToyVpnClient.java59 final SharedPreferences prefs = getSharedPreferences(Prefs.NAME, MODE_PRIVATE); in onCreate() local
60 serverAddress.setText(prefs.getString(Prefs.SERVER_ADDRESS, "")); in onCreate()
61 int serverPortPrefValue = prefs.getInt(Prefs.SERVER_PORT, 0); in onCreate()
63 sharedSecret.setText(prefs.getString(Prefs.SHARED_SECRET, "")); in onCreate()
64 proxyHost.setText(prefs.getString(Prefs.PROXY_HOSTNAME, "")); in onCreate()
65 int proxyPortPrefValue = prefs.getInt(Prefs.PROXY_PORT, 0); in onCreate()
68 allowed.setChecked(prefs.getBoolean(Prefs.ALLOW, true)); in onCreate()
69 packages.setText(String.join(", ", prefs.getStringSet( in onCreate()
99 prefs.edit() in onCreate()
DToyVpnService.java104 final SharedPreferences prefs = getSharedPreferences(ToyVpnClient.Prefs.NAME, MODE_PRIVATE); in connect() local
105 final String server = prefs.getString(ToyVpnClient.Prefs.SERVER_ADDRESS, ""); in connect()
106 final byte[] secret = prefs.getString(ToyVpnClient.Prefs.SHARED_SECRET, "").getBytes(); in connect()
107 final boolean allow = prefs.getBoolean(ToyVpnClient.Prefs.ALLOW, true); in connect()
109 prefs.getStringSet(ToyVpnClient.Prefs.PACKAGES, Collections.emptySet()); in connect()
110 final int port = prefs.getInt(ToyVpnClient.Prefs.SERVER_PORT, 0); in connect()
111 final String proxyHost = prefs.getString(ToyVpnClient.Prefs.PROXY_HOSTNAME, ""); in connect()
112 final int proxyPort = prefs.getInt(ToyVpnClient.Prefs.PROXY_PORT, 0); in connect()
/development/samples/browseable/XYZTouristAttractions/Shared/src/com.example.android.xyztouristattractions.common/
DUtils.java94 SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); in storeLocation() local
95 SharedPreferences.Editor editor = prefs.edit(); in storeLocation()
109 SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); in getLocation() local
110 Long lat = prefs.getLong(PREFERENCES_LAT, Long.MAX_VALUE); in getLocation()
111 Long lng = prefs.getLong(PREFERENCES_LNG, Long.MAX_VALUE); in getLocation()
124 SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); in storeGeofenceEnabled() local
125 SharedPreferences.Editor editor = prefs.edit(); in storeGeofenceEnabled()
134 SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); in getGeofenceEnabled() local
135 return prefs.getBoolean(PREFERENCES_GEOFENCE_ENABLED, true); in getGeofenceEnabled()
/development/samples/browseable/MessagingService/src/com.example.android.messagingservice/
DMessageLogger.java40 SharedPreferences prefs = getPrefs(context); in logMessage() local
42 prefs.edit() in logMessage()
43 .putString(LOG_KEY, prefs.getString(LOG_KEY, "") + LINE_BREAKS + message) in logMessage()
/development/samples/ApiDemos/src/com/example/android/apis/appwidget/
DExampleAppWidgetConfigure.java108 SharedPreferences.Editor prefs = context.getSharedPreferences(PREFS_NAME, 0).edit(); in saveTitlePref() local
109 prefs.putString(PREF_PREFIX_KEY + appWidgetId, text); in saveTitlePref()
110 prefs.commit(); in saveTitlePref()
116 SharedPreferences prefs = context.getSharedPreferences(PREFS_NAME, 0); in loadTitlePref() local
117 String prefix = prefs.getString(PREF_PREFIX_KEY + appWidgetId, null); in loadTitlePref()
/development/samples/VoiceRecognitionService/src/com/example/android/voicerecognitionservice/
DVoiceRecognitionService.java48 SharedPreferences prefs = getSharedPreferences( in onStartListening() local
52 String resultType = prefs.getString( in onStartListening()
/development/apps/DumpViewer/app/src/main/java/com/android/dumpviewer/utils/
DHistory.java34 public History(SharedPreferences prefs, String sharedPrefKey, int maxSize) { in History() argument
35 mPrefs = prefs; in History()
/development/samples/MultiDisplay/src/com/example/android/multidisplay/launcher/
DPinnedAppListViewModel.java70 final SharedPreferences prefs = context.getSharedPreferences(PINNED_APPS_KEY, 0); in PinnedAppListLiveData() local
74 prefs.registerOnSharedPreferenceChangeListener(mChangeListener); in PinnedAppListLiveData()
/development/samples/SipDemo/src/com/example/android/sip/
DWalkieTalkieActivity.java123 SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); in initializeLocalProfile() local
124 String username = prefs.getString("namePref", ""); in initializeLocalProfile()
125 String domain = prefs.getString("domainPref", ""); in initializeLocalProfile()
126 String password = prefs.getString("passPref", ""); in initializeLocalProfile()
/development/samples/browseable/AppRestrictionEnforcer/src/com.example.android.apprestrictionenforcer/
DAppRestrictionEnforcerFragment.java245 SharedPreferences prefs = activity.getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE); in loadRestrictions() local
249 updateCanSayHello(prefs.getBoolean(RESTRICTION_KEY_SAY_HELLO, in loadRestrictions()
252 updateMessage(prefs.getString(RESTRICTION_KEY_MESSAGE, in loadRestrictions()
255 updateNumber(prefs.getInt(RESTRICTION_KEY_NUMBER, in loadRestrictions()
259 prefs.getString(RESTRICTION_KEY_RANK, restriction.getSelectedString())); in loadRestrictions()
262 TextUtils.split(prefs.getString(RESTRICTION_KEY_APPROVALS, in loadRestrictions()
267 String itemsString = prefs.getString(RESTRICTION_KEY_ITEMS, ""); in loadRestrictions()
/development/samples/CubeLiveWallpaper/src/com/example/android/livecubes/cube2/
DCubeWallpaper2.java105 public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { in onSharedPreferenceChanged() argument
107 String shape = prefs.getString("cube2_shape", "cube"); in onSharedPreferenceChanged()
/development/samples/Vault/src/com/example/android/vault/
DVaultProvider.java300 final SharedPreferences prefs = getContext() in createDocument() local
302 childDocId = prefs.getLong(PREF_NEXT_ID, 1); in createDocument()
303 if (!prefs.edit().putLong(PREF_NEXT_ID, childDocId + 1).commit()) { in createDocument()