OSDN Git Service

Give the DhcpClient alarm broadcasts foreground priority.
authorLorenzo Colitti <lorenzo@google.com>
Fri, 25 Sep 2015 03:54:06 +0000 (12:54 +0900)
committerLorenzo Colitti <lorenzo@google.com>
Fri, 25 Sep 2015 03:57:39 +0000 (12:57 +0900)
Bug: 24265658
Bug: 24224067
Change-Id: I375097e7957643efb4bc0bb81318b13d9b9c82c1

services/net/java/android/net/dhcp/DhcpClient.java

index 9ee9cf4..e0d2ac1 100644 (file)
@@ -244,8 +244,9 @@ public class DhcpClient extends BaseDhcpStateMachine {
     private PendingIntent createStateMachineCommandIntent(final String cmdName, final int cmd) {
         String action = DhcpClient.class.getName() + "." + mIfaceName + "." + cmdName;
 
-        Intent intent = new Intent(action, null)
-                .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
+        Intent intent = new Intent(action, null).addFlags(
+                Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT |
+                Intent.FLAG_RECEIVER_FOREGROUND);
         // TODO: The intent's package covers the whole of the system server, so it's pretty generic.
         // Consider adding some sort of token as well.
         intent.setPackage(mContext.getPackageName());