From 5ac72a29593ab9a20337a2225df52bdf4754be02 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Wed, 29 Aug 2012 18:32:08 -0700 Subject: Improve multi-user broadcasts. You can now use ALL and CURRENT when sending broadcasts, to specify where the broadcast goes. Sticky broadcasts are now correctly separated per user, and registered receivers are filtered based on the requested target user. New Context APIs for more kinds of sending broadcasts as users. Updating a bunch of system code that sends broadcasts to explicitly specify which user the broadcast goes to. Made a single version of the code for interpreting the requested target user ID that all entries to activity manager (start activity, send broadcast, start service) use. Change-Id: Ie29f02dd5242ef8c8fa56c54593a315cd2574e1c --- test-runner/src/android/test/mock/MockContext.java | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'test-runner/src/android') diff --git a/test-runner/src/android/test/mock/MockContext.java b/test-runner/src/android/test/mock/MockContext.java index 6047cda..eb1f2d6 100644 --- a/test-runner/src/android/test/mock/MockContext.java +++ b/test-runner/src/android/test/mock/MockContext.java @@ -311,8 +311,14 @@ public class MockContext extends Context { } @Override + public void sendBroadcastAsUser(Intent intent, UserHandle user, + String receiverPermission) { + throw new UnsupportedOperationException(); + } + + @Override public void sendOrderedBroadcastAsUser(Intent intent, UserHandle user, - BroadcastReceiver resultReceiver, Handler scheduler, + String receiverPermission, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) { throw new UnsupportedOperationException(); } @@ -335,6 +341,24 @@ public class MockContext extends Context { } @Override + public void sendStickyBroadcastAsUser(Intent intent, UserHandle user) { + throw new UnsupportedOperationException(); + } + + @Override + public void sendStickyOrderedBroadcastAsUser(Intent intent, + UserHandle user, BroadcastReceiver resultReceiver, + Handler scheduler, int initialCode, String initialData, + Bundle initialExtras) { + throw new UnsupportedOperationException(); + } + + @Override + public void removeStickyBroadcastAsUser(Intent intent, UserHandle user) { + throw new UnsupportedOperationException(); + } + + @Override public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) { throw new UnsupportedOperationException(); } -- cgit v1.1