Lines Matching refs:scope
48 * Scope
50 * This API introduces the concept of "scope" for a setting, which is the generality
52 * entire application, have a scope of SCOPE_GLOBAL. They are stored in the default
56 * a custom scope. The specific module can define whatever scope (String) argument
57 * they want, and the settings saved with that scope can only be seen by that third
58 * party module. Scope is a general concept that helps protect settings values
106 * custom scope.
113 * Open a SharedPreferences file by custom scope.
117 protected SharedPreferences openPreferences(String scope) {
119 mPackageName + scope, Context.MODE_PRIVATE);
129 * Close a SharedPreferences file by custom scope.
235 /** This scope stores and retrieves settings from
240 * Returns the SharedPreferences file matching the scope
247 private SharedPreferences getPreferencesFromScope(String scope) {
248 if (scope.equals(SCOPE_GLOBAL)) {
255 mCustomPreferences = openPreferences(scope);
321 public String getString(String scope, String key, String defaultValue) {
322 SharedPreferences preferences = getPreferencesFromScope(scope);
336 public String getString(String scope, String key) {
337 return getString(scope, key, getStringDefault(key));
344 public Integer getInteger(String scope, String key, Integer defaultValue) {
346 String value = getString(scope, key, defaultValueString);
354 public Integer getInteger(String scope, String key) {
355 return getInteger(scope, key, getIntegerDefault(key));
362 public boolean getBoolean(String scope, String key, boolean defaultValue) {
364 String value = getString(scope, key, defaultValueString);
372 public boolean getBoolean(String scope, String key) {
373 return getBoolean(scope, key, getBooleanDefault(key));
380 public Size getSize(String scope, String key) {
381 String strValue = getString(scope, key);
411 public int getIndexOfCurrentValue(String scope, String key) {
415 "No possible values for scope=" + scope + " key=" + key);
418 String value = getString(scope, key);
424 throw new IllegalStateException("Current value for scope=" + scope + " key="
432 public void set(String scope, String key, String value) {
433 SharedPreferences preferences = getPreferencesFromScope(scope);
441 public void set(String scope, String key, int value) {
442 set(scope, key, convert(value));
450 public void set(String scope, String key, boolean value) {
451 set(scope, key, convert(value));
457 public void setToDefault(String scope, String key) {
458 set(scope, key, getStringDefault(key));
473 public void setValueByIndex(String scope, String key, int index) {
477 "No possible values for scope=" + scope + " key=" + key);
481 set(scope, key, possibleValues[index]);
483 throw new IndexOutOfBoundsException("For possible values of scope=" + scope
491 public boolean isSet(String scope, String key) {
492 SharedPreferences preferences = getPreferencesFromScope(scope);
500 public boolean isDefault(String scope, String key) {
502 String value = getString(scope, key);
509 public void remove(String scope, String key) {
510 SharedPreferences preferences = getPreferencesFromScope(scope);