title: Download Manager Not Working in Android Oreo
body: <p>Mine is a cordova hybrid app. I have installed <a href="https://github.com/vasani-arpit/cordova-plugin-downloadmanager" rel="nofollow noreferrer">this</a> plugin to download pdf files from server(url). It works fine in devices running in Android 7.0. When the same app is installed in Oreo devices, nothing happens and after some time, I see "download unsuccessful" message. What could be the reason for this?</p>
  
  <p>I also upgraded a mobile where it was working previously to 8.0 and tested. It failed. So when the OS is Oreo, this is not working.</p>
  
  <pre><code>private void startDownload(String message, CallbackContext callbackContext) {
          if (message != null &amp;&amp; message.length() &gt; 0) {
              String filename = message.substring(message.lastIndexOf("/")+1, message.length());
              try {
                  filename = URLDecoder.decode(filename,"UTF-8");
              } catch (UnsupportedEncodingException e) {
  
                  callbackContext.error("Error in converting filename");
              }
              android.app.DownloadManager downloadManager = (android.app.DownloadManager) cordova.getActivity().getApplicationContext().getSystemService(Context.DOWNLOAD_SERVICE);            
              Uri Download_Uri = Uri.parse(message);
              android.app.DownloadManager.Request request = new android.app.DownloadManager.Request(Download_Uri);
              //Restrict the types of networks over which this download may proceed.
              request.setAllowedNetworkTypes(android.app.DownloadManager.Request.NETWORK_WIFI | android.app.DownloadManager.Request.NETWORK_MOBILE);
              //Set whether this download may proceed over a roaming connection.
              request.setAllowedOverRoaming(false);
              //Set the title of this download, to be displayed in notifications (if enabled).
              request.setTitle(filename);
              //Set a description of this download, to be displayed in notifications (if enabled)
              request.setDescription("DataSync File Download.");
              //Set the local destination for the downloaded file to a path within the application's external files directory            
              request.setDestinationInExternalFilesDir(cordova.getActivity().getApplicationContext(), Environment.DIRECTORY_DOWNLOADS, filename);
              //Set visiblity after download is complete
              request.setNotificationVisibility(android.app.DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
              long downloadReference = downloadManager.enqueue(request);
              callbackContext.success(message);
          } else {
              callbackContext.error("Expected one non-empty string argument.");
          }
      }
  </code></pre>