com.google.android.exoplayer2.util.NotificationUtil Java Examples

The following examples show how to use com.google.android.exoplayer2.util.NotificationUtil. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DownloadService.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
@Override
public void onCreate() {
  if (channelId != null) {
    NotificationUtil.createNotificationChannel(
        this,
        channelId,
        channelNameResourceId,
        channelDescriptionResourceId,
        NotificationUtil.IMPORTANCE_LOW);
  }
  Class<? extends DownloadService> clazz = getClass();
  DownloadManagerHelper downloadManagerHelper = downloadManagerListeners.get(clazz);
  if (downloadManagerHelper == null) {
    DownloadManager downloadManager = getDownloadManager();
    downloadManager.resumeDownloads();
    downloadManagerHelper =
        new DownloadManagerHelper(
            getApplicationContext(), downloadManager, getScheduler(), clazz);
    downloadManagerListeners.put(clazz, downloadManagerHelper);
  }
  downloadManager = downloadManagerHelper.downloadManager;
  downloadManagerHelper.attachService(this);
}
 
Example #2
Source File: DownloadService.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void onCreate() {
  if (channelId != null) {
    NotificationUtil.createNotificationChannel(
        this,
        channelId,
        channelNameResourceId,
        channelDescriptionResourceId,
        NotificationUtil.IMPORTANCE_LOW);
  }
  Class<? extends DownloadService> clazz = getClass();
  DownloadManagerHelper downloadManagerHelper = downloadManagerListeners.get(clazz);
  if (downloadManagerHelper == null) {
    DownloadManager downloadManager = getDownloadManager();
    downloadManager.resumeDownloads();
    downloadManagerHelper =
        new DownloadManagerHelper(
            getApplicationContext(), downloadManager, getScheduler(), clazz);
    downloadManagerListeners.put(clazz, downloadManagerHelper);
  }
  downloadManager = downloadManagerHelper.downloadManager;
  downloadManagerHelper.attachService(this);
}
 
Example #3
Source File: DownloadService.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void onCreate() {
  if (channelId != null) {
    NotificationUtil.createNotificationChannel(
        this,
        channelId,
        channelNameResourceId,
        channelDescriptionResourceId,
        NotificationUtil.IMPORTANCE_LOW);
  }
  Class<? extends DownloadService> clazz = getClass();
  DownloadManagerHelper downloadManagerHelper = downloadManagerListeners.get(clazz);
  if (downloadManagerHelper == null) {
    DownloadManager downloadManager = getDownloadManager();
    downloadManager.resumeDownloads();
    downloadManagerHelper =
        new DownloadManagerHelper(
            getApplicationContext(), downloadManager, getScheduler(), clazz);
    downloadManagerListeners.put(clazz, downloadManagerHelper);
  }
  downloadManager = downloadManagerHelper.downloadManager;
  downloadManagerHelper.attachService(this);
}
 
Example #4
Source File: DownloadService.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onCreate() {
  logd("onCreate");
  if (channelId != null) {
    NotificationUtil.createNotificationChannel(
        this, channelId, channelName, NotificationUtil.IMPORTANCE_LOW);
  }
  downloadManager = getDownloadManager();
  downloadManagerListener = new DownloadManagerListener();
  downloadManager.addListener(downloadManagerListener);
}
 
Example #5
Source File: DownloadService.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void onCreate() {
  logd("onCreate");
  if (channelId != null) {
    NotificationUtil.createNotificationChannel(
        this, channelId, channelName, NotificationUtil.IMPORTANCE_LOW);
  }
  downloadManager = getDownloadManager();
  downloadManagerListener = new DownloadManagerListener();
  downloadManager.addListener(downloadManagerListener);
}