Loading core/java/android/app/ContextImpl.java +22 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ import android.net.wifi.p2p.WifiP2pManager; import android.nfc.NfcManager; import android.os.Binder; import android.os.Bundle; import android.os.Debug; import android.os.DropBoxManager; import android.os.Environment; import android.os.FileUtils; Loading @@ -97,6 +98,7 @@ import android.telephony.TelephonyManager; import android.content.ClipboardManager; import android.util.AndroidRuntimeException; import android.util.Log; import android.util.Slog; import android.view.CompatibilityInfoHolder; import android.view.ContextThemeWrapper; import android.view.Display; Loading Loading @@ -925,6 +927,7 @@ class ContextImpl extends Context { @Override public void startActivity(Intent intent) { warnIfCallingFromSystemProcess(); startActivity(intent, null); } Loading @@ -936,6 +939,7 @@ class ContextImpl extends Context { @Override public void startActivity(Intent intent, Bundle options) { warnIfCallingFromSystemProcess(); if ((intent.getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) == 0) { throw new AndroidRuntimeException( "Calling startActivity() from outside of an Activity " Loading @@ -962,6 +966,7 @@ class ContextImpl extends Context { @Override public void startActivities(Intent[] intents) { warnIfCallingFromSystemProcess(); startActivities(intents, null); } Loading @@ -981,6 +986,7 @@ class ContextImpl extends Context { @Override public void startActivities(Intent[] intents, Bundle options) { warnIfCallingFromSystemProcess(); if ((intents[0].getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) == 0) { throw new AndroidRuntimeException( "Calling startActivities() from outside of an Activity " Loading Loading @@ -1023,6 +1029,7 @@ class ContextImpl extends Context { @Override public void sendBroadcast(Intent intent) { warnIfCallingFromSystemProcess(); String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); try { intent.setAllowFds(false); Loading @@ -1036,6 +1043,7 @@ class ContextImpl extends Context { @Override public void sendBroadcast(Intent intent, String receiverPermission) { warnIfCallingFromSystemProcess(); String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); try { intent.setAllowFds(false); Loading @@ -1050,6 +1058,7 @@ class ContextImpl extends Context { @Override public void sendOrderedBroadcast(Intent intent, String receiverPermission) { warnIfCallingFromSystemProcess(); String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); try { intent.setAllowFds(false); Loading @@ -1066,6 +1075,7 @@ class ContextImpl extends Context { String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { warnIfCallingFromSystemProcess(); IIntentReceiver rd = null; if (resultReceiver != null) { if (mPackageInfo != null) { Loading Loading @@ -1154,6 +1164,7 @@ class ContextImpl extends Context { @Override public void sendStickyBroadcast(Intent intent) { warnIfCallingFromSystemProcess(); String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); try { intent.setAllowFds(false); Loading @@ -1170,6 +1181,7 @@ class ContextImpl extends Context { BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { warnIfCallingFromSystemProcess(); IIntentReceiver rd = null; if (resultReceiver != null) { if (mPackageInfo != null) { Loading Loading @@ -1337,11 +1349,13 @@ class ContextImpl extends Context { @Override public ComponentName startService(Intent service) { warnIfCallingFromSystemProcess(); return startServiceAsUser(service, mUser); } @Override public boolean stopService(Intent service) { warnIfCallingFromSystemProcess(); return stopServiceAsUser(service, mUser); } Loading Loading @@ -1389,6 +1403,7 @@ class ContextImpl extends Context { @Override public boolean bindService(Intent service, ServiceConnection conn, int flags) { warnIfCallingFromSystemProcess(); return bindService(service, conn, flags, UserHandle.getUserId(Process.myUid())); } Loading Loading @@ -1697,6 +1712,13 @@ class ContextImpl extends Context { message); } private void warnIfCallingFromSystemProcess() { if (Process.myUid() == Process.SYSTEM_UID) { Slog.w(TAG, "Calling a method in the system process without a qualified user: " + Debug.getCallers(3)); } } @Override public Context createPackageContext(String packageName, int flags) throws NameNotFoundException { Loading core/java/android/content/SyncManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -2530,7 +2530,7 @@ public class SyncManager { syncStateIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); syncStateIntent.putExtra("active", mNeedSyncActiveNotification); syncStateIntent.putExtra("failing", false); mContext.sendBroadcast(syncStateIntent); mContext.sendBroadcastAsUser(syncStateIntent, UserHandle.OWNER); } private void installHandleTooManyDeletesNotification(Account account, String authority, Loading policy/src/com/android/internal/policy/impl/keyguard/ClockView.java +2 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.IntentFilter; import android.database.ContentObserver; import android.graphics.Typeface; import android.os.Handler; import android.os.UserHandle; import android.provider.Settings; import android.text.format.DateFormat; import android.util.AttributeSet; Loading Loading @@ -172,7 +173,7 @@ public class ClockView extends RelativeLayout { filter.addAction(Intent.ACTION_TIME_TICK); filter.addAction(Intent.ACTION_TIME_CHANGED); filter.addAction(Intent.ACTION_TIMEZONE_CHANGED); mContext.registerReceiver(mIntentReceiver, filter); mContext.registerReceiverAsUser(mIntentReceiver, UserHandle.OWNER, filter, null, null ); } /* monitor 12/24-hour display preference */ Loading services/java/com/android/server/BackupManagerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -836,7 +836,8 @@ class BackupManagerService extends IBackupManager.Stub { if ((info.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { if (DEBUG) Slog.v(TAG, "Binding to Google transport"); Intent intent = new Intent().setComponent(transportComponent); context.bindService(intent, mGoogleConnection, Context.BIND_AUTO_CREATE); context.bindService(intent, mGoogleConnection, Context.BIND_AUTO_CREATE, UserHandle.USER_OWNER); } else { Slog.w(TAG, "Possible Google transport spoof: ignoring " + info); } Loading services/java/com/android/server/InputMethodManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -1561,7 +1561,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_BEFORE, originalString); intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_AFTER, suggestions[index]); intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_HASHCODE, span.hashCode()); mContext.sendBroadcast(intent); mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT); return true; } } Loading Loading @@ -1649,7 +1649,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub Intent intent = new Intent(Intent.ACTION_INPUT_METHOD_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); intent.putExtra("input_method_id", id); mContext.sendBroadcast(intent); mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT); } unbindCurrentClientLocked(); } finally { Loading Loading
core/java/android/app/ContextImpl.java +22 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ import android.net.wifi.p2p.WifiP2pManager; import android.nfc.NfcManager; import android.os.Binder; import android.os.Bundle; import android.os.Debug; import android.os.DropBoxManager; import android.os.Environment; import android.os.FileUtils; Loading @@ -97,6 +98,7 @@ import android.telephony.TelephonyManager; import android.content.ClipboardManager; import android.util.AndroidRuntimeException; import android.util.Log; import android.util.Slog; import android.view.CompatibilityInfoHolder; import android.view.ContextThemeWrapper; import android.view.Display; Loading Loading @@ -925,6 +927,7 @@ class ContextImpl extends Context { @Override public void startActivity(Intent intent) { warnIfCallingFromSystemProcess(); startActivity(intent, null); } Loading @@ -936,6 +939,7 @@ class ContextImpl extends Context { @Override public void startActivity(Intent intent, Bundle options) { warnIfCallingFromSystemProcess(); if ((intent.getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) == 0) { throw new AndroidRuntimeException( "Calling startActivity() from outside of an Activity " Loading @@ -962,6 +966,7 @@ class ContextImpl extends Context { @Override public void startActivities(Intent[] intents) { warnIfCallingFromSystemProcess(); startActivities(intents, null); } Loading @@ -981,6 +986,7 @@ class ContextImpl extends Context { @Override public void startActivities(Intent[] intents, Bundle options) { warnIfCallingFromSystemProcess(); if ((intents[0].getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) == 0) { throw new AndroidRuntimeException( "Calling startActivities() from outside of an Activity " Loading Loading @@ -1023,6 +1029,7 @@ class ContextImpl extends Context { @Override public void sendBroadcast(Intent intent) { warnIfCallingFromSystemProcess(); String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); try { intent.setAllowFds(false); Loading @@ -1036,6 +1043,7 @@ class ContextImpl extends Context { @Override public void sendBroadcast(Intent intent, String receiverPermission) { warnIfCallingFromSystemProcess(); String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); try { intent.setAllowFds(false); Loading @@ -1050,6 +1058,7 @@ class ContextImpl extends Context { @Override public void sendOrderedBroadcast(Intent intent, String receiverPermission) { warnIfCallingFromSystemProcess(); String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); try { intent.setAllowFds(false); Loading @@ -1066,6 +1075,7 @@ class ContextImpl extends Context { String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { warnIfCallingFromSystemProcess(); IIntentReceiver rd = null; if (resultReceiver != null) { if (mPackageInfo != null) { Loading Loading @@ -1154,6 +1164,7 @@ class ContextImpl extends Context { @Override public void sendStickyBroadcast(Intent intent) { warnIfCallingFromSystemProcess(); String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); try { intent.setAllowFds(false); Loading @@ -1170,6 +1181,7 @@ class ContextImpl extends Context { BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { warnIfCallingFromSystemProcess(); IIntentReceiver rd = null; if (resultReceiver != null) { if (mPackageInfo != null) { Loading Loading @@ -1337,11 +1349,13 @@ class ContextImpl extends Context { @Override public ComponentName startService(Intent service) { warnIfCallingFromSystemProcess(); return startServiceAsUser(service, mUser); } @Override public boolean stopService(Intent service) { warnIfCallingFromSystemProcess(); return stopServiceAsUser(service, mUser); } Loading Loading @@ -1389,6 +1403,7 @@ class ContextImpl extends Context { @Override public boolean bindService(Intent service, ServiceConnection conn, int flags) { warnIfCallingFromSystemProcess(); return bindService(service, conn, flags, UserHandle.getUserId(Process.myUid())); } Loading Loading @@ -1697,6 +1712,13 @@ class ContextImpl extends Context { message); } private void warnIfCallingFromSystemProcess() { if (Process.myUid() == Process.SYSTEM_UID) { Slog.w(TAG, "Calling a method in the system process without a qualified user: " + Debug.getCallers(3)); } } @Override public Context createPackageContext(String packageName, int flags) throws NameNotFoundException { Loading
core/java/android/content/SyncManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -2530,7 +2530,7 @@ public class SyncManager { syncStateIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); syncStateIntent.putExtra("active", mNeedSyncActiveNotification); syncStateIntent.putExtra("failing", false); mContext.sendBroadcast(syncStateIntent); mContext.sendBroadcastAsUser(syncStateIntent, UserHandle.OWNER); } private void installHandleTooManyDeletesNotification(Account account, String authority, Loading
policy/src/com/android/internal/policy/impl/keyguard/ClockView.java +2 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.IntentFilter; import android.database.ContentObserver; import android.graphics.Typeface; import android.os.Handler; import android.os.UserHandle; import android.provider.Settings; import android.text.format.DateFormat; import android.util.AttributeSet; Loading Loading @@ -172,7 +173,7 @@ public class ClockView extends RelativeLayout { filter.addAction(Intent.ACTION_TIME_TICK); filter.addAction(Intent.ACTION_TIME_CHANGED); filter.addAction(Intent.ACTION_TIMEZONE_CHANGED); mContext.registerReceiver(mIntentReceiver, filter); mContext.registerReceiverAsUser(mIntentReceiver, UserHandle.OWNER, filter, null, null ); } /* monitor 12/24-hour display preference */ Loading
services/java/com/android/server/BackupManagerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -836,7 +836,8 @@ class BackupManagerService extends IBackupManager.Stub { if ((info.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { if (DEBUG) Slog.v(TAG, "Binding to Google transport"); Intent intent = new Intent().setComponent(transportComponent); context.bindService(intent, mGoogleConnection, Context.BIND_AUTO_CREATE); context.bindService(intent, mGoogleConnection, Context.BIND_AUTO_CREATE, UserHandle.USER_OWNER); } else { Slog.w(TAG, "Possible Google transport spoof: ignoring " + info); } Loading
services/java/com/android/server/InputMethodManagerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -1561,7 +1561,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_BEFORE, originalString); intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_AFTER, suggestions[index]); intent.putExtra(SuggestionSpan.SUGGESTION_SPAN_PICKED_HASHCODE, span.hashCode()); mContext.sendBroadcast(intent); mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT); return true; } } Loading Loading @@ -1649,7 +1649,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub Intent intent = new Intent(Intent.ACTION_INPUT_METHOD_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); intent.putExtra("input_method_id", id); mContext.sendBroadcast(intent); mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT); } unbindCurrentClientLocked(); } finally { Loading