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
This commit is contained in:
Amith Yamasani
2012-10-19 18:23:52 -07:00
parent 39c6526249
commit cd75706117
7 changed files with 36 additions and 10 deletions

View File

@ -37,6 +37,7 @@ import android.os.ServiceManager;
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 @@ class ServerThread extends Thread {
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);
}
}