Merge "Revert "wifidisplay: restrict broadcast by the proper permission"" into rvc-dev am: 30c6383d1d am: 17d1be8efc am: 5cb13bbebf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15287612

Change-Id: Ia5193bc6840887c259e66778851188196dcb5877
This commit is contained in:
TreeHugger Robot
2021-07-20 03:04:38 +00:00
committed by Automerger Merge Worker
2 changed files with 1 additions and 9 deletions

View File

@@ -72,9 +72,6 @@ public final class DisplayManager {
* {@link #EXTRA_WIFI_DISPLAY_STATUS} extra. * {@link #EXTRA_WIFI_DISPLAY_STATUS} extra.
* </p><p> * </p><p>
* This broadcast is only sent to registered receivers and can only be sent by the system. * This broadcast is only sent to registered receivers and can only be sent by the system.
* </p><p>
* {@link android.Manifest.permission#ACCESS_FINE_LOCATION} permission is required to
* receive this broadcast.
* </p> * </p>
* @hide * @hide
*/ */

View File

@@ -91,10 +91,6 @@ final class WifiDisplayAdapter extends DisplayAdapter {
private boolean mPendingStatusChangeBroadcast; private boolean mPendingStatusChangeBroadcast;
private static final String[] RECEIVER_PERMISSIONS_FOR_BROADCAST = {
android.Manifest.permission.ACCESS_FINE_LOCATION,
};
// Called with SyncRoot lock held. // Called with SyncRoot lock held.
public WifiDisplayAdapter(DisplayManagerService.SyncRoot syncRoot, public WifiDisplayAdapter(DisplayManagerService.SyncRoot syncRoot,
Context context, Handler handler, Listener listener, Context context, Handler handler, Listener listener,
@@ -436,8 +432,7 @@ final class WifiDisplayAdapter extends DisplayAdapter {
} }
// Send protected broadcast about wifi display status to registered receivers. // Send protected broadcast about wifi display status to registered receivers.
getContext().createContextAsUser(UserHandle.ALL, 0) getContext().sendBroadcastAsUser(intent, UserHandle.ALL);
.sendBroadcastWithMultiplePermissions(intent, RECEIVER_PERMISSIONS_FOR_BROADCAST);
} }
private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {