title: DownloadManager doesn't receive download complete action
body: <p>I have an intent service that downloads a file in the background, a broadcast receiver is registered to listen for the download completion, but never gets in the <code>onReceive()</code> function of the receiver.  The file seems to finish downloading, I can see it in the file explorer, and get a message from the DownloadManager with status SUCCESS.  Right before the download success message I'm getting an error <code>Failed to chmod /mnt/internal_sd/../filedownloaded</code>  </p>
  
  <p>Intent started from main activity onCreate:</p>
  
  <pre><code>Intent i = new Intent(context, MyIntentService.class);
  startService(i);
  </code></pre>
  
  <p>Intent service:</p>
  
  <pre><code>public class MyIntentService extends IntentService  {
  
      DownloadManager downloadManager;
  
      @Override
      protected void onHandleIntent(Intent intent) {
          IntentFilter filter = new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE);
          registerReceiver(downloadReceiver, filter);
          downloadFile();
      }
  
      void downloadFile(Uri downloadUri) {
          downloadManager = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
  
          DownloadManager.Request request = new DownloadManager.Request(downloadUri);
          request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI);
          request.setAllowedOverRoaming(false);
          request.setTitle("My Andorid App Download");
          request.setDestinationInExternalFilesDir(getApplicationContext(), null, sku + ".apk");
  
          long downloadNum = downloadManager.enqueue(request);        
      }
  
      private BroadcastReceiver downloadReceiver = new BroadcastReceiver() {
          @Override
          public void onReceive(Context context, Intent intent) {         
              System.out.println("does not get in here.");
              long id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, 0);
              Uri u = downloadManager.getUriForDownloadedFile(id);
          }
      };
  }
  </code></pre>
  
  <p>manifest:</p>
  
  <pre><code>&lt;service
      android:name="com.example.MyIntentService"
      android:exported="false"&gt;
  
      &lt;intent-filter&gt;
        &lt;action android:name="android.intent.action.DOWNLOAD_COMPLETE" /&gt;                 
      &lt;/intent-filter&gt;
  
  &lt;/service&gt; 
  </code></pre>
  
  <p>It sounds like a permissions issue with the failed to chmod error, but I can't quite figure out what.  </p>