diff options
| author | Tom O'Neill <tomo@google.com> | 2013-09-09 09:34:58 -0700 |
|---|---|---|
| committer | Tom O'Neill <tomo@google.com> | 2013-09-09 09:34:58 -0700 |
| commit | 365632e8ee83db7492094292cea0c509c3447d4b (patch) | |
| tree | 249175eecedb2a6c212c9e7aceb53ea83b167d3d /core/java/android/app/ContextImpl.java | |
| parent | bdd61696c6720faa14ca9fdf180e519138b3d087 (diff) | |
| download | frameworks_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.java | 5 |
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: " |
