Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5808a506 authored by Peter Wang's avatar Peter Wang
Browse files

[API Review] Expose sendOrderedBroadcast

with appOp as String and options as Bundle

Bug: 139077993
Bug: 146423958
Test: Build
Change-Id: Ic0329c41863c160d0129aebafb123c0f10b31ce1
Merged-In: Ic0329c41863c160d0129aebafb123c0f10b31ce1
parent d97788ea
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -1196,20 +1196,19 @@ public abstract class InboundSmsHandler extends StateMachine {
                // Only pass in the resultReceiver when the user SYSTEM is processed.
                try {
                    mContext.createPackageContextAsUser(mContext.getPackageName(), 0, targetUser)
                            .sendOrderedBroadcast(intent, permission, appOp, opts,
                            .sendOrderedBroadcast(intent, Activity.RESULT_OK, permission, appOp,
                                    users[i] == UserHandle.SYSTEM.getIdentifier()
                                            ? resultReceiver : null,
                                    getHandler(), Activity.RESULT_OK, null /* initialData */,
                                    null /* initialExtras */);
                                            ? resultReceiver : null, getHandler(),
                                    null /* initialData */, null /* initialExtras */, opts);
                } catch (PackageManager.NameNotFoundException ignored) {
                }
            }
        } else {
            try {
                mContext.createPackageContextAsUser(mContext.getPackageName(), 0, user)
                        .sendOrderedBroadcast(intent, permission, appOp, opts, resultReceiver,
                                getHandler(), Activity.RESULT_OK, null /* initialData */,
                                null /* initialExtras */);
                        .sendOrderedBroadcast(intent, Activity.RESULT_OK, permission, appOp,
                                resultReceiver, getHandler(), null /* initialData */,
                                null /* initialExtras */, opts);
            } catch (PackageManager.NameNotFoundException ignored) {
            }
        }
+3 −3
Original line number Diff line number Diff line
@@ -481,9 +481,9 @@ public class ContextFixture implements TestFixture<Context> {
        }

        @Override
        public void sendOrderedBroadcast(Intent intent, String receiverPermission,
                String receiverAppOp, Bundle options, BroadcastReceiver resultReceiver,
                Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
        public void sendOrderedBroadcast(Intent intent, int initialCode, String receiverPermission,
                String receiverAppOp, BroadcastReceiver resultReceiver, Handler scheduler,
                String initialData, Bundle initialExtras, Bundle options) {
            logd("sendOrderedBroadcast called for " + intent.getAction());
            mLastBroadcastOptions = options;
            sendBroadcast(intent);