summaryrefslogtreecommitdiffstats
path: root/services/print
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 /services/print
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 'services/print')
-rw-r--r--services/print/java/com/android/server/print/RemotePrintService.java3
-rw-r--r--services/print/java/com/android/server/print/RemotePrintSpooler.java2
2 files changed, 3 insertions, 2 deletions
diff --git a/services/print/java/com/android/server/print/RemotePrintService.java b/services/print/java/com/android/server/print/RemotePrintService.java
index a8c739c..0ab1657 100644
--- a/services/print/java/com/android/server/print/RemotePrintService.java
+++ b/services/print/java/com/android/server/print/RemotePrintService.java
@@ -507,7 +507,8 @@ final class RemotePrintService implements DeathRecipient {
}
mBinding = true;
mContext.bindServiceAsUser(mIntent, mServiceConnection,
- Context.BIND_AUTO_CREATE, new UserHandle(mUserId));
+ Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE,
+ new UserHandle(mUserId));
}
private void ensureUnbound() {
diff --git a/services/print/java/com/android/server/print/RemotePrintSpooler.java b/services/print/java/com/android/server/print/RemotePrintSpooler.java
index 7ab3840..85c876a 100644
--- a/services/print/java/com/android/server/print/RemotePrintSpooler.java
+++ b/services/print/java/com/android/server/print/RemotePrintSpooler.java
@@ -365,7 +365,7 @@ final class RemotePrintSpooler {
}
mContext.bindServiceAsUser(mIntent, mServiceConnection,
- Context.BIND_AUTO_CREATE, mUserHandle);
+ Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE, mUserHandle);
final long startMillis = SystemClock.uptimeMillis();
while (true) {