Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SystemDownloadCompletedReceiver.java « bookmarks « maps « mapswithme « com « src « android - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 76414b1ed47ec3c04feb7aa1b386908d100b9e84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.mapswithme.maps.bookmarks;

import android.app.DownloadManager;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v4.app.JobIntentService;

import com.mapswithme.maps.background.AbstractLogBroadcastReceiver;
import com.mapswithme.maps.scheduling.JobIdMap;

public class SystemDownloadCompletedReceiver extends AbstractLogBroadcastReceiver
{
  @NonNull
  @Override
  protected String getAssertAction()
  {
    return DownloadManager.ACTION_DOWNLOAD_COMPLETE;
  }

  @Override
  public void onReceiveInternal(@NonNull Context context, @NonNull Intent intent)
  {
    DownloadManager manager = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
    if (manager == null)
      return;
    intent.setClass(context, SystemDownloadCompletedService.class);
    int jobId = JobIdMap.getId(SystemDownloadCompletedService.class);
    JobIntentService.enqueueWork(context, SystemDownloadCompletedService.class, jobId, intent);
  }
}