summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/ContextImpl.java
diff options
context:
space:
mode:
authorTom O'Neill <tomo@google.com>2013-09-09 09:34:58 -0700
committerTom O'Neill <tomo@google.com>2013-09-09 09:34:58 -0700
commit365632e8ee83db7492094292cea0c509c3447d4b (patch)
tree249175eecedb2a6c212c9e7aceb53ea83b167d3d /core/java/android/app/ContextImpl.java
parentbdd61696c6720faa14ca9fdf180e519138b3d087 (diff)
downloadframeworks_base-365632e8ee83db7492094292cea0c509c3447d4b.zip
frameworks_base-365632e8ee83db7492094292cea0c509c3447d4b.tar.gz
frameworks_base-365632e8ee83db7492094292cea0c509c3447d4b.tar.bz2
Explain what warnIfCallingFromSystemProcess() is about
- Helps the next person to hit a bug like b/10621831 Change-Id: Id44dc57472516ec5f574d22d4c131ab9870648db
Diffstat (limited to 'core/java/android/app/ContextImpl.java')
-rw-r--r--core/java/android/app/ContextImpl.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index e776a98..7ff7562 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -1827,6 +1827,11 @@ class ContextImpl extends Context {
message);
}
+ /**
+ * Logs a warning if the system process directly called a method such as
+ * {@link #startService(Intent)} instead of {@link #startServiceAsUser(Intent, UserHandle)}.
+ * The "AsUser" variants allow us to properly enforce the user's restrictions.
+ */
private void warnIfCallingFromSystemProcess() {
if (Process.myUid() == Process.SYSTEM_UID) {
Slog.w(TAG, "Calling a method in the system process without a qualified user: "