summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMartin Wallgren <martin.wallgren@sonymobile.com>2013-02-04 14:26:51 +0100
committerHenrik Baard <henrik.baard@sonymobile.com>2013-02-04 14:26:51 +0100
commita81d7dace6e729a1f4f5dd3afc3d53c536e1996c (patch)
tree0b3ba303a94af1ba64243c188f411604600507a4 /services
parent7ad885e2e6c845dbec4f16cd71e859240741dbf9 (diff)
downloadframeworks_base-a81d7dace6e729a1f4f5dd3afc3d53c536e1996c.zip
frameworks_base-a81d7dace6e729a1f4f5dd3afc3d53c536e1996c.tar.gz
frameworks_base-a81d7dace6e729a1f4f5dd3afc3d53c536e1996c.tar.bz2
Set foreground priority for shutdown receivers.
The broadcast of ACTION_SHUTDOWN has a timeout of 10 seconds. To reduce the risk of hitting the timeout and speeding up the shutdown sequence in ShutdownThread we set the priority of the BroadcastReceivers to FLAG_RECEIVER_FOREGROUND. We have seen that this change reduces the shutdown time when the system is under heavy load. Change-Id: I22cbf6af8cf6fc4bdefaa1c3da8a7eed7e7b7674
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/power/ShutdownThread.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/java/com/android/server/power/ShutdownThread.java b/services/java/com/android/server/power/ShutdownThread.java
index c7f7390..c084666 100644
--- a/services/java/com/android/server/power/ShutdownThread.java
+++ b/services/java/com/android/server/power/ShutdownThread.java
@@ -297,7 +297,9 @@ public final class ShutdownThread extends Thread {
// First send the high-level shut down broadcast.
mActionDone = false;
- mContext.sendOrderedBroadcastAsUser(new Intent(Intent.ACTION_SHUTDOWN),
+ Intent intent = new Intent(Intent.ACTION_SHUTDOWN);
+ intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
+ mContext.sendOrderedBroadcastAsUser(intent,
UserHandle.ALL, null, br, mHandler, 0, null, null);
final long endTime = SystemClock.elapsedRealtime() + MAX_BROADCAST_TIME;