diff options
| author | 2016-04-19 21:08:12 +0000 | |
|---|---|---|
| committer | 2016-04-19 21:08:14 +0000 | |
| commit | 6ed4e35e49fb9d1e485f53b4ce309865d98a6058 (patch) | |
| tree | 5d1acdaee1fde4df86186fcd80d3b18d64d57d86 | |
| parent | 6bf86d5e5ca73bceeb4f46771eabdc946ddc56e1 (diff) | |
| parent | 1e3535276365da64ad066bffc86238ed04a7ae13 (diff) | |
Merge "Document startService cost" into nyc-dev
| -rw-r--r-- | core/java/android/content/Context.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 15cc17da2150..8349d3da6860 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -2446,6 +2446,15 @@ public abstract class Context { * <p>This function will throw {@link SecurityException} if you do not * have permission to start the given service. * + * <p class="note"><strong>Note:</strong> Each call to startService() + * results in significant work done by the system to manage service + * lifecycle surrounding the processing of the intent, which can take + * multiple milliseconds of CPU time. Due to this cost, startService() + * should not be used for frequent intent delivery to a service, and only + * for scheduling significant work. Use {@link #bindService bound services} + * for high frequency calls. + * </p> + * * @param service Identifies the service to be started. The Intent must be either * fully explicit (supplying a component name) or specify a specific package * name it is targetted to. Additional values |