System server should always send broadcasts to a specific or all users
Bug: 7368245
Log a warning if the system process calls unqualified sendBroadcast()
and other calls.
As a result of the logging above, found a few more method calls such as
bindService() that would benefit from being more explicit to avoid
future confusion and reduce the log warnings.
Change-Id: I17f15c8be9adf7becd456d6abbab606f19befdbf
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index e46afd3..894c4d0 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -37,6 +37,7 @@
import android.os.StrictMode;
import android.os.SystemClock;
import android.os.SystemProperties;
+import android.os.UserHandle;
import android.server.search.SearchManagerService;
import android.service.dreams.DreamService;
import android.util.DisplayMetrics;
@@ -1005,7 +1006,7 @@
intent.setComponent(new ComponentName("com.android.systemui",
"com.android.systemui.SystemUIService"));
Slog.d(TAG, "Starting service: " + intent);
- context.startService(intent);
+ context.startServiceAsUser(intent, UserHandle.OWNER);
}
}