java.lang.Object | ||
↳ | android.content.BroadcastReceiver | |
↳ | lineageos.preference.RemotePreferenceUpdater |
Base class for remote summary providers.
When an application is hosting preferences which are served by a different process, the former needs to stay updated with changes in order to display the correct summary when the user returns to the latter.
This class implements a simple ordered broadcast mechanism where the application running the RemotePreference sends an explicit broadcast to the host, who fills out the extras in the result bundle and returns it to the caller.
A minimal implementation will override getSummary and return a summary for the given key. Alternatively, fillResultExtras can be overridden if additional data should be added to the result.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Tell the RemotePreference that updated state is available.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Fill the bundle with the summary and any other data needed to update
the client.
| |||||||||||
Fetch the updated summary for the given key
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.content.BroadcastReceiver
| |||||||||||
From class
java.lang.Object
|
Tell the RemotePreference that updated state is available. Call from the fragment when necessary.
Fill the bundle with the summary and any other data needed to update the client.
Returns | |
---|---|
boolean |
true if successful |
Fetch the updated summary for the given key
Parameters | |
---|---|
context |
Context |
Returns | |
---|---|
String |
the summary for the given key |