summaryrefslogtreecommitdiffstats
path: root/core/java/android/content
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2015-04-24 09:54:54 -0700
committerDianne Hackborn <hackbod@google.com>2015-04-29 17:04:50 -0700
commitd69e4c1460017062e7c36be55801cb434ad19d97 (patch)
treefdb11d94a6a8434e7c7667a8496288b599ef81b7 /core/java/android/content
parent9ac2718e7dcf274ad41fbb374bedabadc558634b (diff)
downloadframeworks_base-d69e4c1460017062e7c36be55801cb434ad19d97.zip
frameworks_base-d69e4c1460017062e7c36be55801cb434ad19d97.tar.gz
frameworks_base-d69e4c1460017062e7c36be55801cb434ad19d97.tar.bz2
Update use of procstate for services.
Now that we have a separate foreground service proc state (above a sleeping top app), update various system services to put their bindings into this state when appropriate. There are two new bind flags for this -- one that just always makes it a foreground service, another that only does it when the device is awake (useful for things like the wallpaper). And with all of that, tweak network policy manager to only include apps that are at least foreground service state when in power save and device idle modes. This will allow us to further reduce the set of apps that have network access (in particular not giving access to the current top app when the screen is off), hopefully leading to even better battery life. Change-Id: I91d85a5c5ed64e856149e9a5d94a634a7925ec7f
Diffstat (limited to 'core/java/android/content')
-rw-r--r--core/java/android/content/Context.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 5eacce3..0bd60ef 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -252,6 +252,21 @@ public abstract class Context {
public static final int BIND_ADJUST_WITH_ACTIVITY = 0x0080;
/**
+ * @hide Flag for {@link #bindService}: Like {@link #BIND_FOREGROUND_SERVICE},
+ * but only applies while the device is awake.
+ */
+ public static final int BIND_FOREGROUND_SERVICE_WHILE_AWAKE = 0x02000000;
+
+ /**
+ * @hide Flag for {@link #bindService}: For only the case where the binding
+ * is coming from the system, set the process state to FOREGROUND_SERVICE
+ * instead of the normal maximum of IMPORTANT_FOREGROUND. That is, this is
+ * saying that the process shouldn't participate in the normal power reduction
+ * modes (removing network access etc).
+ */
+ public static final int BIND_FOREGROUND_SERVICE = 0x04000000;
+
+ /**
* @hide Flag for {@link #bindService}: Treat the binding as hosting
* an activity, an unbinding as the activity going in the background.
* That is, when unbinding, the process when empty will go on the activity