FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Warn that SettingInjectorService must be fast · Hashcode/android_frameworks_base@184e751 · GitHub

Commit 184e751

Browse files
Tom O'Neill
committed
Warn that SettingInjectorService must be fast
- Move UPDATE_INTENT to SettingInjectorSErvice Change-Id: I9c8f8dc0878647a051cb852721b3436e9d55b391
1 parent b6e8943 commit 184e751

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎api/current.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11813,6 +11813,7 @@ package android.location {
1181311813
ctor public SettingInjectorService(java.lang.String);
1181411814
method protected abstract android.location.SettingInjectorService.Status getStatus();
1181511815
method protected final void onHandleIntent(android.content.Intent);
11816+
field public static final java.lang.String UPDATE_INTENT = "com.android.location.InjectedSettingChanged";
1181611817
}
1181711818

1181811819
public static final class SettingInjectorService.Status {

‎location/java/android/location/SettingInjectorService.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@
6969
* to the user that it is not part of the system settings.</li>
7070
* </ul>
7171
*
72+
* To ensure a good user experience, your {@link #onHandleIntent(Intent)} must complete within
73+
* 200 msec even if your app is not already running. This means that both
74+
* {@link android.app.Application#onCreate()} and {@link #getStatus()} must be fast. If you exceed
75+
* this time, then this can delay the retrieval of settings status for other apps as well.
76+
*
7277
* For consistency, the label and {@link #getStatus()} values should be provided in all of the
7378
* locales supported by the system settings app. The text should not contain offensive language.
7479
*
@@ -82,6 +87,7 @@
8287
*/
8388
// TODO: is there a public list of supported locales?
8489
// TODO: is there a public list of guidelines for settings text?
90+
// TODO: would a bound service be better? E.g., we could just disconnect if a service took too long
8591
public abstract class SettingInjectorService extends IntentService {
8692

8793
/**
@@ -106,6 +112,12 @@ public abstract class SettingInjectorService extends IntentService {
106112
*/
107113
public static final String MESSENGER_KEY = "messenger";
108114

115+
/**
116+
* Intent action a client should broadcast when the value of one of its injected settings has
117+
* changed, so that the setting can be updated in the UI.
118+
*/
119+
public static final String UPDATE_INTENT = "com.android.location.InjectedSettingChanged";
120+
109121
private final String mLogTag;
110122

111123
/**

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL