java.lang.Object | |
↳ | de.robv.android.xposed.XSharedPreferences |
This class is basically the same as SharedPreferencesImpl from AOSP, but read-only and without listeners support. Instead, it is made to be compatible with all ROMs.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Read settings from the specified file.
| |||||||||||
Read settings from the default preferences for a package.
| |||||||||||
Read settings from a custom preferences file for a package.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
Not supported by this implementation.
| |||||||||||
Returns the file that is backing these preferences.
| |||||||||||
Check whether the file has changed since the last time it has been loaded.
| |||||||||||
Tries to make the preferences file world-readable.
| |||||||||||
This method is deprecated.
Not supported by this implementation.
| |||||||||||
Reload the settings from file if they have changed.
| |||||||||||
This method is deprecated.
Not supported by this implementation.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface android.content.SharedPreferences |
Read settings from the specified file.
prefFile | The file to read the preferences from. |
---|
Read settings from the default preferences for a package.
These preferences are returned by PreferenceManager.getDefaultSharedPreferences(Context)
.
packageName | The package name. |
---|
Read settings from a custom preferences file for a package.
These preferences are returned by Context.getSharedPreferences(String, int)
.
packageName | The package name. |
---|---|
prefFileName | The file name without ".xml". |
This method is deprecated.
Not supported by this implementation.
Create a new Editor for these preferences, through which you can make modifications to the data in the preferences and atomically commit those changes back to the SharedPreferences object.
Note that you must call SharedPreferences.Editor.commit()
to have any
changes you perform in the Editor actually show up in the
SharedPreferences.
SharedPreferences.Editor
interface, allowing
you to modify the values in this SharedPreferences object.
Returns the file that is backing these preferences.
Warning: The file might not be accessible directly.
Check whether the file has changed since the last time it has been loaded.
Warning: With enforcing SELinux, this call might be quite expensive.
Tries to make the preferences file world-readable.
Warning: This is only meant to work around permission "fix" functions that are part
of some recoveries. It doesn't replace the need to open preferences with MODE_WORLD_READABLE
in the module's UI code. Otherwise, Android will set stricter permissions again during the next save.
This will only work if executed as root (e.g. initZygote()
) and only if SELinux is disabled.
true
in case the file could be made world-readable.
This method is deprecated.
Not supported by this implementation.
Registers a callback to be invoked when a change happens to a preference.
Caution: The preference manager does not currently store a strong reference to the listener. You must store a strong reference to the listener, or it will be susceptible to garbage collection. We recommend you keep a reference to the listener in the instance data of an object that will exist as long as you need the listener.
listener | The callback that will run. |
---|
Reload the settings from file if they have changed.
Warning: With enforcing SELinux, this call might be quite expensive.
This method is deprecated.
Not supported by this implementation.
Unregisters a previous callback.
listener | The callback that should be unregistered. |
---|