title: Is CHANGE_WIFI_MULTICAST_STATE permission and use of WifiManager.MulticastLock required to receive multicast packets on Android?
body: <p>I have a test app that I'm using to demonstrate whether or not multicast traffic is making it into an Android device.  I'm seeing behavior that appears to contradict Google's documentation <a href="http://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock.html" rel="noreferrer">here</a> and <a href="http://developer.android.com/reference/android/Manifest.permission.html#CHANGE_WIFI_MULTICAST_STATE" rel="noreferrer">here</a> which implies that two prerequisites need to be in place in order for an app to receive multicast traffic:</p>
  
  <ol>
  <li>Acquire the MulticastLock</li>
  <li>Add the CHANGE_WIFI_MULTICAST_STATE permission to the app's manifest</li>
  </ol>
  
  <p>My app is able to receive multicast traffic without either of these items in place.  Below is the code snippet that sets up the multicast socket for receiving data.</p>
  
  <pre><code>MulticastSocket multicastReceiveSocket = new MulticastSocket( 18200 );
  multicastReceiveSocket.joinGroup( InetAddress.getByName( "232.232.232.232" ) );
  
  byte[] buffer = new byte[ 65536 ];
  DatagramPacket packet = new DatagramPacket( buffer, buffer.length );
  multicastReceiveSocket.receive( packet );
  </code></pre>
  
  <p>Should this be happening?  Should I be able to receive multicast packets without either of the 2 prerequisites in place?  I noticed that the MulticastLock documentation says:</p>
  
  <blockquote>
    <p>Normally the Wifi stack filters out packets not explicitly addressed to this device</p>
  </blockquote>
  
  <p>Does this mean that the behavior could be different from one device to another?  I'm testing my app on a Samsung Galaxy Note4 (model SM-N910T) running Android version 4.4.4.  Any clarification on this issue would be greatly appreciated.</p>