2012-04-12 20:15:53 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2012-05-24 13:17:46 -07:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-12-21 08:44:08 -08:00
|
|
|
|
2012-01-14 09:20:31 -08:00
|
|
|
package org.mozilla.gecko.sync;
|
2011-12-21 08:44:08 -08:00
|
|
|
|
2012-01-14 09:20:31 -08:00
|
|
|
import android.content.SharedPreferences;
|
2011-12-21 08:44:08 -08:00
|
|
|
|
2012-01-14 09:20:31 -08:00
|
|
|
/**
|
|
|
|
* Implement PrefsSource to allow other components to fetch a SharedPreferences
|
|
|
|
* instance via a Context that you provide.
|
|
|
|
*
|
|
|
|
* This allows components to use SharedPreferences without being tightly
|
|
|
|
* coupled to an Activity.
|
|
|
|
*
|
|
|
|
* @author rnewman
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public interface PrefsSource {
|
|
|
|
/**
|
|
|
|
* Return a SharedPreferences instance.
|
|
|
|
* @param name
|
|
|
|
* A String, used to identify a preferences 'branch'. Must not be null.
|
|
|
|
* @param mode
|
|
|
|
* A bitmask mode, as described in http://developer.android.com/reference/android/content/Context.html#getSharedPreferences%28java.lang.String,%20int%29.
|
|
|
|
* @return
|
|
|
|
* A new or existing SharedPreferences instance.
|
|
|
|
*/
|
|
|
|
public SharedPreferences getPrefs(String name, int mode);
|
2011-12-21 08:44:08 -08:00
|
|
|
}
|