Loading api/system-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -8449,6 +8449,7 @@ package android.content { method public abstract void sendBroadcast(android.content.Intent, java.lang.String, android.os.Bundle); method public abstract void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle); method public abstract void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String); method public abstract void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.os.Bundle); method public abstract void sendOrderedBroadcast(android.content.Intent, java.lang.String); method public abstract void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle); method public abstract void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle); Loading Loading @@ -8642,6 +8643,7 @@ package android.content { method public void sendBroadcast(android.content.Intent, java.lang.String, android.os.Bundle); method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle); method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String); method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.os.Bundle); method public void sendOrderedBroadcast(android.content.Intent, java.lang.String); method public void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle); method public void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle); Loading Loading @@ -41183,6 +41185,7 @@ package android.test.mock { method public void sendBroadcast(android.content.Intent, java.lang.String, android.os.Bundle); method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle); method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String); method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.os.Bundle); method public void sendOrderedBroadcast(android.content.Intent, java.lang.String); method public void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle); method public void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle); core/java/android/app/ContextImpl.java +17 −0 Original line number Diff line number Diff line Loading @@ -1052,6 +1052,23 @@ class ContextImpl extends Context { sendBroadcastAsUser(intent, user, receiverPermission, AppOpsManager.OP_NONE); } @Override public void sendBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, Bundle options) { String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); String[] receiverPermissions = receiverPermission == null ? null : new String[] {receiverPermission}; try { intent.prepareToLeaveProcess(this); ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, null, Activity.RESULT_OK, null, null, receiverPermissions, AppOpsManager.OP_NONE, options, false, false, user.getIdentifier()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } @Override public void sendBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, int appOp) { Loading core/java/android/content/Context.java +21 −0 Original line number Diff line number Diff line Loading @@ -2028,6 +2028,27 @@ public abstract class Context { public abstract void sendBroadcastAsUser(@RequiresPermission Intent intent, UserHandle user, @Nullable String receiverPermission); /** * Version of {@link #sendBroadcast(Intent, String, Bundle)} that allows you to specify the * user the broadcast will be sent to. This is not available to applications * that are not pre-installed on the system image. Using it requires holding * the INTERACT_ACROSS_USERS permission. * * @param intent The Intent to broadcast; all receivers matching this * Intent will receive the broadcast. * @param user UserHandle to send the intent to. * @param receiverPermission (optional) String naming a permission that * a receiver must hold in order to receive your broadcast. * If null, no permission is required. * @param options (optional) Additional sending options, generated from a * {@link android.app.BroadcastOptions}. * * @see #sendBroadcast(Intent, String, Bundle) * @hide */ @SystemApi public abstract void sendBroadcastAsUser(@RequiresPermission Intent intent, UserHandle user, @Nullable String receiverPermission, @Nullable Bundle options); /** * Version of {@link #sendBroadcast(Intent, String)} that allows you to specify the Loading core/java/android/content/ContextWrapper.java +7 −0 Original line number Diff line number Diff line Loading @@ -495,6 +495,13 @@ public class ContextWrapper extends Context { mBase.sendBroadcastAsUser(intent, user, receiverPermission); } /** @hide */ @Override public void sendBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, Bundle options) { mBase.sendBroadcastAsUser(intent, user, receiverPermission, options); } /** @hide */ @Override public void sendBroadcastAsUser(Intent intent, UserHandle user, Loading test-runner/src/android/test/mock/MockContext.java +8 −0 Original line number Diff line number Diff line Loading @@ -403,6 +403,14 @@ public class MockContext extends Context { throw new UnsupportedOperationException(); } /** @hide */ @SystemApi @Override public void sendBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, Bundle options) { throw new UnsupportedOperationException(); } /** @hide */ @Override public void sendBroadcastAsUser(Intent intent, UserHandle user, Loading Loading
api/system-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -8449,6 +8449,7 @@ package android.content { method public abstract void sendBroadcast(android.content.Intent, java.lang.String, android.os.Bundle); method public abstract void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle); method public abstract void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String); method public abstract void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.os.Bundle); method public abstract void sendOrderedBroadcast(android.content.Intent, java.lang.String); method public abstract void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle); method public abstract void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle); Loading Loading @@ -8642,6 +8643,7 @@ package android.content { method public void sendBroadcast(android.content.Intent, java.lang.String, android.os.Bundle); method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle); method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String); method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.os.Bundle); method public void sendOrderedBroadcast(android.content.Intent, java.lang.String); method public void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle); method public void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle); Loading Loading @@ -41183,6 +41185,7 @@ package android.test.mock { method public void sendBroadcast(android.content.Intent, java.lang.String, android.os.Bundle); method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle); method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String); method public void sendBroadcastAsUser(android.content.Intent, android.os.UserHandle, java.lang.String, android.os.Bundle); method public void sendOrderedBroadcast(android.content.Intent, java.lang.String); method public void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle); method public void sendOrderedBroadcast(android.content.Intent, java.lang.String, android.os.Bundle, android.content.BroadcastReceiver, android.os.Handler, int, java.lang.String, android.os.Bundle);
core/java/android/app/ContextImpl.java +17 −0 Original line number Diff line number Diff line Loading @@ -1052,6 +1052,23 @@ class ContextImpl extends Context { sendBroadcastAsUser(intent, user, receiverPermission, AppOpsManager.OP_NONE); } @Override public void sendBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, Bundle options) { String resolvedType = intent.resolveTypeIfNeeded(getContentResolver()); String[] receiverPermissions = receiverPermission == null ? null : new String[] {receiverPermission}; try { intent.prepareToLeaveProcess(this); ActivityManagerNative.getDefault().broadcastIntent( mMainThread.getApplicationThread(), intent, resolvedType, null, Activity.RESULT_OK, null, null, receiverPermissions, AppOpsManager.OP_NONE, options, false, false, user.getIdentifier()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } @Override public void sendBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, int appOp) { Loading
core/java/android/content/Context.java +21 −0 Original line number Diff line number Diff line Loading @@ -2028,6 +2028,27 @@ public abstract class Context { public abstract void sendBroadcastAsUser(@RequiresPermission Intent intent, UserHandle user, @Nullable String receiverPermission); /** * Version of {@link #sendBroadcast(Intent, String, Bundle)} that allows you to specify the * user the broadcast will be sent to. This is not available to applications * that are not pre-installed on the system image. Using it requires holding * the INTERACT_ACROSS_USERS permission. * * @param intent The Intent to broadcast; all receivers matching this * Intent will receive the broadcast. * @param user UserHandle to send the intent to. * @param receiverPermission (optional) String naming a permission that * a receiver must hold in order to receive your broadcast. * If null, no permission is required. * @param options (optional) Additional sending options, generated from a * {@link android.app.BroadcastOptions}. * * @see #sendBroadcast(Intent, String, Bundle) * @hide */ @SystemApi public abstract void sendBroadcastAsUser(@RequiresPermission Intent intent, UserHandle user, @Nullable String receiverPermission, @Nullable Bundle options); /** * Version of {@link #sendBroadcast(Intent, String)} that allows you to specify the Loading
core/java/android/content/ContextWrapper.java +7 −0 Original line number Diff line number Diff line Loading @@ -495,6 +495,13 @@ public class ContextWrapper extends Context { mBase.sendBroadcastAsUser(intent, user, receiverPermission); } /** @hide */ @Override public void sendBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, Bundle options) { mBase.sendBroadcastAsUser(intent, user, receiverPermission, options); } /** @hide */ @Override public void sendBroadcastAsUser(Intent intent, UserHandle user, Loading
test-runner/src/android/test/mock/MockContext.java +8 −0 Original line number Diff line number Diff line Loading @@ -403,6 +403,14 @@ public class MockContext extends Context { throw new UnsupportedOperationException(); } /** @hide */ @SystemApi @Override public void sendBroadcastAsUser(Intent intent, UserHandle user, String receiverPermission, Bundle options) { throw new UnsupportedOperationException(); } /** @hide */ @Override public void sendBroadcastAsUser(Intent intent, UserHandle user, Loading