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

Commit b5584f77 authored by Joanne Chung's avatar Joanne Chung
Browse files

PackageMonitor PackagesSuspened/Unsuspended() applies package visibility rules

PackageManagerService sends ACTION_PACKAGES_SUSPENDED and
ACTION_PACKAGES_UNSUSPENDED broadcasts, it uses extras filtering
logic to adhere to the package visibility rules but the logic doesn't
be added for PackageMonitorCallback. The change add the filter logic
back.

Bug: 316194178
Test: atest PackageMonitorCallbackHelperTest
Change-Id: I5ad923be919a2caaa46903b0f874fe92aee4105d
parent 70ce23b0
Loading
Loading
Loading
Loading
+10 −6
Original line number Original line Diff line number Diff line
@@ -827,7 +827,8 @@ public final class BroadcastHelper {
            // action. When the targetPkg is set, it sends the broadcast to specific app, e.g.
            // action. When the targetPkg is set, it sends the broadcast to specific app, e.g.
            // installer app or null for registered apps. The callback only need to send back to the
            // installer app or null for registered apps. The callback only need to send back to the
            // registered apps so we check the null condition here.
            // registered apps so we check the null condition here.
            notifyPackageMonitor(action, pkg, extras, userIds, instantUserIds, broadcastAllowList);
            notifyPackageMonitor(action, pkg, extras, userIds, instantUserIds, broadcastAllowList,
                    null /* filterExtras */);
        }
        }
    }
    }


@@ -980,14 +981,16 @@ public final class BroadcastHelper {
        final Bundle options = new BroadcastOptions()
        final Bundle options = new BroadcastOptions()
                .setDeferralPolicy(BroadcastOptions.DEFERRAL_POLICY_UNTIL_ACTIVE)
                .setDeferralPolicy(BroadcastOptions.DEFERRAL_POLICY_UNTIL_ACTIVE)
                .toBundle();
                .toBundle();
        BiFunction<Integer, Bundle, Bundle> filterExtrasForReceiver =
                (callingUid, intentExtras) -> BroadcastHelper.filterExtrasChangedPackageList(
                        snapshot, callingUid, intentExtras);
        mHandler.post(() -> sendPackageBroadcast(intent, null /* pkg */,
        mHandler.post(() -> sendPackageBroadcast(intent, null /* pkg */,
                extras, flags, null /* targetPkg */, null /* finishedReceiver */,
                extras, flags, null /* targetPkg */, null /* finishedReceiver */,
                new int[]{userId}, null /* instantUserIds */, null /* broadcastAllowList */,
                new int[]{userId}, null /* instantUserIds */, null /* broadcastAllowList */,
                (callingUid, intentExtras) -> BroadcastHelper.filterExtrasChangedPackageList(
                filterExtrasForReceiver,
                        snapshot, callingUid, intentExtras),
                options));
                options));
        notifyPackageMonitor(intent, null /* pkg */, extras, new int[]{userId},
        notifyPackageMonitor(intent, null /* pkg */, extras, new int[]{userId},
                null /* instantUserIds */, null /* broadcastAllowList */);
                null /* instantUserIds */, null /* broadcastAllowList */, filterExtrasForReceiver);
    }
    }


    void sendMyPackageSuspendedOrUnsuspended(@NonNull Computer snapshot,
    void sendMyPackageSuspendedOrUnsuspended(@NonNull Computer snapshot,
@@ -1073,9 +1076,10 @@ public final class BroadcastHelper {
                                      @Nullable Bundle extras,
                                      @Nullable Bundle extras,
                                      @NonNull int[] userIds,
                                      @NonNull int[] userIds,
                                      @NonNull int[] instantUserIds,
                                      @NonNull int[] instantUserIds,
                                      @Nullable SparseArray<int[]> broadcastAllowList) {
                                      @Nullable SparseArray<int[]> broadcastAllowList,
                                      @Nullable BiFunction<Integer, Bundle, Bundle> filterExtras) {
        mPackageMonitorCallbackHelper.notifyPackageMonitor(action, pkg, extras, userIds,
        mPackageMonitorCallbackHelper.notifyPackageMonitor(action, pkg, extras, userIds,
                instantUserIds, broadcastAllowList, mHandler);
                instantUserIds, broadcastAllowList, mHandler, filterExtras);
    }
    }


    private void notifyResourcesChanged(boolean mediaStatus,
    private void notifyResourcesChanged(boolean mediaStatus,
+2 −2
Original line number Original line Diff line number Diff line
@@ -4607,7 +4607,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
                });
                });
                mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_UNSTOPPED,
                mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_UNSTOPPED,
                        packageName, extras, userIds, null /* instantUserIds */,
                        packageName, extras, userIds, null /* instantUserIds */,
                        broadcastAllowList, mHandler);
                        broadcastAllowList, mHandler, null /* filterExtras */);
            }
            }
        }
        }
    }
    }
@@ -7045,7 +7045,7 @@ public class PackageManagerService implements PackageSender, TestUtilityService
            }
            }
            mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_RESTARTED,
            mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_RESTARTED,
                    packageName, extras, userIds, null /* instantUserIds */,
                    packageName, extras, userIds, null /* instantUserIds */,
                    broadcastAllowList, mHandler);
                    broadcastAllowList, mHandler, null /* filterExtras */);
        }
        }


        @Override
        @Override
+27 −11
Original line number Original line Diff line number Diff line
@@ -41,6 +41,7 @@ import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.ArrayUtils;


import java.util.ArrayList;
import java.util.ArrayList;
import java.util.function.BiFunction;


/** Helper class to handle PackageMonitorCallback and notify the registered client. This is mainly
/** Helper class to handle PackageMonitorCallback and notify the registered client. This is mainly
 * used by PackageMonitor to improve the broadcast latency. */
 * used by PackageMonitor to improve the broadcast latency. */
@@ -106,7 +107,8 @@ class PackageMonitorCallbackHelper {
        }
        }
        extras.putInt(PackageInstaller.EXTRA_DATA_LOADER_TYPE, dataLoaderType);
        extras.putInt(PackageInstaller.EXTRA_DATA_LOADER_TYPE, dataLoaderType);
        notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED, packageName, extras,
        notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED, packageName, extras,
                userIds /* userIds */, instantUserIds, broadcastAllowList, handler);
                userIds /* userIds */, instantUserIds, broadcastAllowList, handler,
                null /* filterExtras */);
    }
    }


    public void notifyResourcesChanged(boolean mediaStatus, boolean replacing,
    public void notifyResourcesChanged(boolean mediaStatus, boolean replacing,
@@ -120,7 +122,8 @@ class PackageMonitorCallbackHelper {
        String action = mediaStatus ? Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE
        String action = mediaStatus ? Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE
                : Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE;
                : Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE;
        notifyPackageMonitor(action, null /* pkg */, extras, null /* userIds */,
        notifyPackageMonitor(action, null /* pkg */, extras, null /* userIds */,
                null /* instantUserIds */, null /* broadcastAllowList */, handler);
                null /* instantUserIds */, null /* broadcastAllowList */, handler,
                null /* filterExtras */);
    }
    }


    public void notifyPackageChanged(String packageName, boolean dontKillApp,
    public void notifyPackageChanged(String packageName, boolean dontKillApp,
@@ -137,12 +140,12 @@ class PackageMonitorCallbackHelper {
            extras.putString(Intent.EXTRA_REASON, reason);
            extras.putString(Intent.EXTRA_REASON, reason);
        }
        }
        notifyPackageMonitor(Intent.ACTION_PACKAGE_CHANGED, packageName, extras, userIds,
        notifyPackageMonitor(Intent.ACTION_PACKAGE_CHANGED, packageName, extras, userIds,
                instantUserIds, broadcastAllowList, handler);
                instantUserIds, broadcastAllowList, handler, null /* filterExtras */);
    }
    }


    public void notifyPackageMonitor(String action, String pkg, Bundle extras,
    public void notifyPackageMonitor(String action, String pkg, Bundle extras,
            int[] userIds, int[] instantUserIds, SparseArray<int[]> broadcastAllowList,
            int[] userIds, int[] instantUserIds, SparseArray<int[]> broadcastAllowList,
            Handler handler) {
            Handler handler, BiFunction<Integer, Bundle, Bundle> filterExtras) {
        if (!isAllowedCallbackAction(action)) {
        if (!isAllowedCallbackAction(action)) {
            return;
            return;
        }
        }
@@ -160,10 +163,11 @@ class PackageMonitorCallbackHelper {


            if (ArrayUtils.isEmpty(instantUserIds)) {
            if (ArrayUtils.isEmpty(instantUserIds)) {
                doNotifyCallbacksByAction(
                doNotifyCallbacksByAction(
                        action, pkg, extras, resolvedUserIds, broadcastAllowList, handler);
                        action, pkg, extras, resolvedUserIds, broadcastAllowList, handler,
                        filterExtras);
            } else {
            } else {
                doNotifyCallbacksByAction(action, pkg, extras, instantUserIds, broadcastAllowList,
                doNotifyCallbacksByAction(action, pkg, extras, instantUserIds, broadcastAllowList,
                        handler);
                        handler, filterExtras);
            }
            }
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            // do nothing
            // do nothing
@@ -199,11 +203,13 @@ class PackageMonitorCallbackHelper {
        synchronized (mLock) {
        synchronized (mLock) {
            callbacks = mCallbacks;
            callbacks = mCallbacks;
        }
        }
        doNotifyCallbacks(callbacks, intent, userId, broadcastAllowList, handler);
        doNotifyCallbacks(callbacks, intent, userId, broadcastAllowList, handler,
                null /* filterExtrasFunction */);
    }
    }


    private void doNotifyCallbacksByAction(String action, String pkg, Bundle extras, int[] userIds,
    private void doNotifyCallbacksByAction(String action, String pkg, Bundle extras, int[] userIds,
            SparseArray<int[]> broadcastAllowList, Handler handler) {
            SparseArray<int[]> broadcastAllowList, Handler handler,
            BiFunction<Integer, Bundle, Bundle> filterExtrasFunction) {
        RemoteCallbackList<IRemoteCallback> callbacks;
        RemoteCallbackList<IRemoteCallback> callbacks;
        synchronized (mLock) {
        synchronized (mLock) {
            callbacks = mCallbacks;
            callbacks = mCallbacks;
@@ -223,12 +229,13 @@ class PackageMonitorCallbackHelper {


            final int[] allowUids =
            final int[] allowUids =
                    broadcastAllowList != null ? broadcastAllowList.get(userId) : null;
                    broadcastAllowList != null ? broadcastAllowList.get(userId) : null;
            doNotifyCallbacks(callbacks, intent, userId, allowUids, handler);
            doNotifyCallbacks(callbacks, intent, userId, allowUids, handler, filterExtrasFunction);
        }
        }
    }
    }


    private void doNotifyCallbacks(RemoteCallbackList<IRemoteCallback> callbacks,
    private void doNotifyCallbacks(RemoteCallbackList<IRemoteCallback> callbacks,
            Intent intent, int userId, int[] allowUids, Handler handler) {
            Intent intent, int userId, int[] allowUids, Handler handler,
            BiFunction<Integer, Bundle, Bundle> filterExtrasFunction) {
        handler.post(() -> callbacks.broadcast((callback, user) -> {
        handler.post(() -> callbacks.broadcast((callback, user) -> {
            RegisterUser registerUser = (RegisterUser) user;
            RegisterUser registerUser = (RegisterUser) user;
            if ((registerUser.getUserId() != UserHandle.USER_ALL) && (registerUser.getUserId()
            if ((registerUser.getUserId() != UserHandle.USER_ALL) && (registerUser.getUserId()
@@ -236,6 +243,15 @@ class PackageMonitorCallbackHelper {
                return;
                return;
            }
            }
            int registerUid = registerUser.getUid();
            int registerUid = registerUser.getUid();
            if (filterExtrasFunction != null) {
                final Bundle extras = intent.getExtras();
                if (extras != null) {
                    final Bundle filteredExtras = filterExtrasFunction.apply(registerUid, extras);
                    if (filteredExtras != null) {
                        intent.replaceExtras(filteredExtras);
                    }
                }
            }
            if (allowUids != null && registerUid != Process.SYSTEM_UID
            if (allowUids != null && registerUid != Process.SYSTEM_UID
                    && !ArrayUtils.contains(allowUids, registerUid)) {
                    && !ArrayUtils.contains(allowUids, registerUid)) {
                if (DEBUG) {
                if (DEBUG) {
+43 −9
Original line number Original line Diff line number Diff line
@@ -44,6 +44,7 @@ import org.junit.runners.JUnit4;
import org.mockito.ArgumentCaptor;
import org.mockito.ArgumentCaptor;


import java.util.ArrayList;
import java.util.ArrayList;
import java.util.function.BiFunction;


/**
/**
 * A unit test for PackageMonitorCallbackHelper implementation.
 * A unit test for PackageMonitorCallbackHelper implementation.
@@ -78,7 +79,8 @@ public class PackageMonitorCallbackHelperTest {


        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0} /* userIds */,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0} /* userIds */,
                null /* instantUserIds */, null /* broadcastAllowList */, mHandler);
                null /* instantUserIds */, null /* broadcastAllowList */, mHandler,
                null /* filterExtras */);


        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).never()).sendResult(any());
        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).never()).sendResult(any());
    }
    }
@@ -91,7 +93,7 @@ public class PackageMonitorCallbackHelperTest {
                Binder.getCallingUid());
                Binder.getCallingUid());
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0}, null /* instantUserIds */,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0}, null /* instantUserIds */,
                null /* broadcastAllowList */, mHandler);
                null /* broadcastAllowList */, mHandler, null /* filterExtras */);


        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).times(1)).sendResult(any());
        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).times(1)).sendResult(any());


@@ -99,11 +101,40 @@ public class PackageMonitorCallbackHelperTest {
        mPackageMonitorCallbackHelper.unregisterPackageMonitorCallback(callback);
        mPackageMonitorCallbackHelper.unregisterPackageMonitorCallback(callback);
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0} /* userIds */,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0} /* userIds */,
                null /* instantUserIds */, null /* broadcastAllowList */, mHandler);
                null /* instantUserIds */, null /* broadcastAllowList */, mHandler,
                null /* filterExtras */);


        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).never()).sendResult(any());
        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).never()).sendResult(any());
    }
    }


    @Test
    public void testPackageMonitorCallback_SuspendCallbackCalled() throws Exception {
        Bundle result = new Bundle();
        result.putInt(Intent.EXTRA_UID, FAKE_PACKAGE_UID);
        result.putStringArray(Intent.EXTRA_CHANGED_PACKAGE_LIST, new String[]{FAKE_PACKAGE_NAME});
        BiFunction<Integer, Bundle, Bundle> filterExtras = (callingUid, intentExtras) -> result;

        IRemoteCallback callback = createMockPackageMonitorCallback();
        mPackageMonitorCallbackHelper.registerPackageMonitorCallback(callback, 0 /* userId */,
                Binder.getCallingUid());
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGES_SUSPENDED,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0}, null /* instantUserIds */,
                null /* broadcastAllowList */, mHandler, filterExtras);

        ArgumentCaptor<Bundle> bundleCaptor = ArgumentCaptor.forClass(Bundle.class);
        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).times(1)).sendResult(
                bundleCaptor.capture());
        Bundle bundle = bundleCaptor.getValue();
        Intent intent = bundle.getParcelable(
                PackageManager.EXTRA_PACKAGE_MONITOR_CALLBACK_RESULT, Intent.class);
        assertThat(intent).isNotNull();
        assertThat(intent.getAction()).isEqualTo(Intent.ACTION_PACKAGES_SUSPENDED);
        String[] pkgList = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
        assertThat(pkgList).isNotNull();
        assertThat(pkgList.length).isEqualTo(1);
        assertThat(pkgList[0]).isEqualTo(FAKE_PACKAGE_NAME);
    }

    @Test
    @Test
    public void testRegisterPackageMonitorCallback_callbackCalled() throws Exception {
    public void testRegisterPackageMonitorCallback_callbackCalled() throws Exception {
        IRemoteCallback callback = createMockPackageMonitorCallback();
        IRemoteCallback callback = createMockPackageMonitorCallback();
@@ -112,7 +143,8 @@ public class PackageMonitorCallbackHelperTest {
                Binder.getCallingUid());
                Binder.getCallingUid());
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0} /* userIds */,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0} /* userIds */,
                null /* instantUserIds */, null /* broadcastAllowList */, mHandler);
                null /* instantUserIds */, null /* broadcastAllowList */, mHandler,
                null /* filterExtras */);


        ArgumentCaptor<Bundle> bundleCaptor = ArgumentCaptor.forClass(Bundle.class);
        ArgumentCaptor<Bundle> bundleCaptor = ArgumentCaptor.forClass(Bundle.class);
        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).times(1)).sendResult(
        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).times(1)).sendResult(
@@ -136,7 +168,8 @@ public class PackageMonitorCallbackHelperTest {
        // Notify for user 10
        // Notify for user 10
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{10} /* userIds */,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{10} /* userIds */,
                null /* instantUserIds */, null /* broadcastAllowList */, mHandler);
                null /* instantUserIds */, null /* broadcastAllowList */, mHandler,
                null /* filterExtras */);


        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).never()).sendResult(any());
        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).never()).sendResult(any());
    }
    }
@@ -239,7 +272,8 @@ public class PackageMonitorCallbackHelperTest {
        mPackageMonitorCallbackHelper.onUserRemoved(10);
        mPackageMonitorCallbackHelper.onUserRemoved(10);
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{10} /* userIds */,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{10} /* userIds */,
                null /* instantUserIds */, null /* broadcastAllowList */, mHandler);
                null /* instantUserIds */, null /* broadcastAllowList */, mHandler,
                null /* filterExtras */);


        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).never()).sendResult(any());
        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).never()).sendResult(any());
    }
    }
@@ -255,7 +289,7 @@ public class PackageMonitorCallbackHelperTest {
                Binder.getCallingUid());
                Binder.getCallingUid());
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0} /* userIds */,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0} /* userIds */,
                null /* instantUserIds */, broadcastAllowList, mHandler);
                null /* instantUserIds */, broadcastAllowList, mHandler, null /* filterExtras */);


        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).times(1)).sendResult(any());
        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).times(1)).sendResult(any());
    }
    }
@@ -271,7 +305,7 @@ public class PackageMonitorCallbackHelperTest {
                Binder.getCallingUid());
                Binder.getCallingUid());
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0} /* userIds */,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0} /* userIds */,
                null /* instantUserIds */, broadcastAllowList, mHandler);
                null /* instantUserIds */, broadcastAllowList, mHandler, null /* filterExtras */);


        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).never()).sendResult(any());
        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).never()).sendResult(any());
    }
    }
@@ -287,7 +321,7 @@ public class PackageMonitorCallbackHelperTest {
                Process.SYSTEM_UID);
                Process.SYSTEM_UID);
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
        mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_ADDED,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0} /* userIds */,
                FAKE_PACKAGE_NAME, createFakeBundle(), new int[]{0} /* userIds */,
                null /* instantUserIds */, broadcastAllowList, mHandler);
                null /* instantUserIds */, broadcastAllowList, mHandler, null /* filterExtras */);


        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).times(1)).sendResult(any());
        verify(callback, after(WAIT_CALLBACK_CALLED_IN_MS).times(1)).sendResult(any());
    }
    }