.class public abstract Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService; .super Landroid/app/Service; .source "SourceFile" # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$RequirementsHelper;, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$ForegroundNotificationUpdater;, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$DownloadManagerListener; } .end annotation # static fields .field public static final ACTION_ADD:Ljava/lang/String; = "com.google.android.exoplayer.downloadService.action.ADD" .field public static final ACTION_INIT:Ljava/lang/String; = "com.google.android.exoplayer.downloadService.action.INIT" .field private static final ACTION_RESTART:Ljava/lang/String; = "com.google.android.exoplayer.downloadService.action.RESTART" .field private static final ACTION_START_DOWNLOADS:Ljava/lang/String; = "com.google.android.exoplayer.downloadService.action.START_DOWNLOADS" .field private static final ACTION_STOP_DOWNLOADS:Ljava/lang/String; = "com.google.android.exoplayer.downloadService.action.STOP_DOWNLOADS" .field private static final DEBUG:Z = false .field public static final DEFAULT_FOREGROUND_NOTIFICATION_UPDATE_INTERVAL:J = 0x3e8L .field public static final KEY_DOWNLOAD_ACTION:Ljava/lang/String; = "download_action" .field public static final KEY_FOREGROUND:Ljava/lang/String; = "foreground" .field private static final TAG:Ljava/lang/String; = "DownloadService" .field private static final requirementsHelpers:Ljava/util/HashMap; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/HashMap<", "Ljava/lang/Class<", "+", "Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;", ">;", "Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$RequirementsHelper;", ">;" } .end annotation .end field # instance fields .field private final channelId:Ljava/lang/String; .annotation build Landroidx/annotation/Nullable; .end annotation .end field .field private final channelName:I .annotation build Landroidx/annotation/StringRes; .end annotation .end field .field private downloadManager:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; .field private downloadManagerListener:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$DownloadManagerListener; .field private final foregroundNotificationUpdater:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$ForegroundNotificationUpdater; .field private lastStartId:I .field private startedInForeground:Z .field private taskRemoved:Z # direct methods .method static constructor ()V .locals 1 .line 65 new-instance v0, Ljava/util/HashMap; invoke-direct {v0}, Ljava/util/HashMap;->()V sput-object v0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->requirementsHelpers:Ljava/util/HashMap; return-void .end method .method public constructor (I)V .locals 2 const-wide/16 v0, 0x3e8 .line 79 invoke-direct {p0, p1, v0, v1}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->(IJ)V return-void .end method .method public constructor (IJ)V .locals 6 const/4 v4, 0x0 const/4 v5, 0x0 move-object v0, p0 move v1, p1 move-wide v2, p2 .line 85 invoke-direct/range {v0 .. v5}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->(IJLjava/lang/String;I)V return-void .end method .method public constructor (IJLjava/lang/String;I)V .locals 1 .param p4 # Ljava/lang/String; .annotation build Landroidx/annotation/Nullable; .end annotation .end param .param p5 # I .annotation build Landroidx/annotation/StringRes; .end annotation .end param .line 97 invoke-direct {p0}, Landroid/app/Service;->()V .line 98 new-instance v0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$ForegroundNotificationUpdater; invoke-direct {v0, p0, p1, p2, p3}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$ForegroundNotificationUpdater;->(Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;IJ)V iput-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->foregroundNotificationUpdater:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$ForegroundNotificationUpdater; iput-object p4, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->channelId:Ljava/lang/String; iput p5, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->channelName:I return-void .end method .method public static synthetic access$200(Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;)V .locals 0 .line 28 invoke-direct {p0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->maybeStartWatchingRequirements()V return-void .end method .method public static synthetic access$300(Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;)Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$ForegroundNotificationUpdater; .locals 0 .line 28 iget-object p0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->foregroundNotificationUpdater:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$ForegroundNotificationUpdater; return-object p0 .end method .method public static synthetic access$400(Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;)V .locals 0 .line 28 invoke-direct {p0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->stop()V return-void .end method .method public static synthetic access$500(Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;)Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; .locals 0 .line 28 iget-object p0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->downloadManager:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; return-object p0 .end method .method public static buildAddActionIntent(Landroid/content/Context;Ljava/lang/Class;Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadAction;Z)Landroid/content/Intent; .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(", "Landroid/content/Context;", "Ljava/lang/Class<", "+", "Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;", ">;", "Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadAction;", "Z)", "Landroid/content/Intent;" } .end annotation .line 111 new-instance v0, Landroid/content/Intent; invoke-direct {v0, p0, p1}, Landroid/content/Intent;->(Landroid/content/Context;Ljava/lang/Class;)V const-string p0, "com.google.android.exoplayer.downloadService.action.ADD" .line 112 invoke-virtual {v0, p0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent; move-result-object p0 const-string p1, "download_action" .line 113 invoke-virtual {p2}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadAction;->toByteArray()[B move-result-object p2 invoke-virtual {p0, p1, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;[B)Landroid/content/Intent; move-result-object p0 const-string p1, "foreground" .line 114 invoke-virtual {p0, p1, p3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent; move-result-object p0 return-object p0 .end method .method private logd(Ljava/lang/String;)V .locals 0 return-void .end method .method private maybeStartWatchingRequirements()V .locals 9 iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->downloadManager:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; .line 244 invoke-virtual {v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager;->getDownloadCount()I move-result v0 if-nez v0, :cond_0 return-void .line 247 :cond_0 invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class; move-result-object v0 sget-object v7, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->requirementsHelpers:Ljava/util/HashMap; .line 248 invoke-virtual {v7, v0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v1 check-cast v1, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$RequirementsHelper; if-nez v1, :cond_1 .line 250 new-instance v8, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$RequirementsHelper; invoke-virtual {p0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->getRequirements()Lcom/mbridge/msdk/playercommon/exoplayer2/scheduler/Requirements; move-result-object v3 invoke-virtual {p0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->getScheduler()Lcom/mbridge/msdk/playercommon/exoplayer2/scheduler/Scheduler; move-result-object v4 const/4 v6, 0x0 move-object v1, v8 move-object v2, p0 move-object v5, v0 invoke-direct/range {v1 .. v6}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$RequirementsHelper;->(Landroid/content/Context;Lcom/mbridge/msdk/playercommon/exoplayer2/scheduler/Requirements;Lcom/mbridge/msdk/playercommon/exoplayer2/scheduler/Scheduler;Ljava/lang/Class;Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$1;)V .line 251 invoke-virtual {v7, v0, v8}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; .line 252 invoke-virtual {v8}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$RequirementsHelper;->start()V const-string v0, "started watching requirements" .line 253 invoke-direct {p0, v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->logd(Ljava/lang/String;)V :cond_1 return-void .end method .method private maybeStopWatchingRequirements()V .locals 2 iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->downloadManager:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; .line 258 invoke-virtual {v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager;->getDownloadCount()I move-result v0 if-lez v0, :cond_0 return-void :cond_0 sget-object v0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->requirementsHelpers:Ljava/util/HashMap; .line 261 invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class; move-result-object v1 invoke-virtual {v0, v1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 check-cast v0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$RequirementsHelper; if-eqz v0, :cond_1 .line 263 invoke-virtual {v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$RequirementsHelper;->stop()V const-string v0, "stopped watching requirements" .line 264 invoke-direct {p0, v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->logd(Ljava/lang/String;)V :cond_1 return-void .end method .method public static start(Landroid/content/Context;Ljava/lang/Class;)V .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(", "Landroid/content/Context;", "Ljava/lang/Class<", "+", "Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;", ">;)V" } .end annotation .line 133 new-instance v0, Landroid/content/Intent; invoke-direct {v0, p0, p1}, Landroid/content/Intent;->(Landroid/content/Context;Ljava/lang/Class;)V const-string p1, "com.google.android.exoplayer.downloadService.action.INIT" invoke-virtual {v0, p1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent; move-result-object p1 invoke-virtual {p0, p1}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName; return-void .end method .method public static startForeground(Landroid/content/Context;Ljava/lang/Class;)V .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "(", "Landroid/content/Context;", "Ljava/lang/Class<", "+", "Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;", ">;)V" } .end annotation .line 138 new-instance v0, Landroid/content/Intent; invoke-direct {v0, p0, p1}, Landroid/content/Intent;->(Landroid/content/Context;Ljava/lang/Class;)V const-string p1, "com.google.android.exoplayer.downloadService.action.INIT" .line 139 invoke-virtual {v0, p1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent; move-result-object p1 const-string v0, "foreground" const/4 v1, 0x1 invoke-virtual {p1, v0, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent; move-result-object p1 .line 140 invoke-static {p0, p1}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/Util;->startForegroundService(Landroid/content/Context;Landroid/content/Intent;)Landroid/content/ComponentName; return-void .end method .method public static startWithAction(Landroid/content/Context;Ljava/lang/Class;Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadAction;Z)V .locals 0 .annotation system Ldalvik/annotation/Signature; value = { "(", "Landroid/content/Context;", "Ljava/lang/Class<", "+", "Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;", ">;", "Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadAction;", "Z)V" } .end annotation .line 123 invoke-static {p0, p1, p2, p3}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->buildAddActionIntent(Landroid/content/Context;Ljava/lang/Class;Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadAction;Z)Landroid/content/Intent; move-result-object p1 if-eqz p3, :cond_0 .line 125 invoke-static {p0, p1}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/Util;->startForegroundService(Landroid/content/Context;Landroid/content/Intent;)Landroid/content/ComponentName; goto :goto_0 .line 127 :cond_0 invoke-virtual {p0, p1}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName; :goto_0 return-void .end method .method private stop()V .locals 3 iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->foregroundNotificationUpdater:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$ForegroundNotificationUpdater; .line 269 invoke-virtual {v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$ForegroundNotificationUpdater;->stopPeriodicUpdates()V iget-boolean v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->startedInForeground:Z if-eqz v0, :cond_0 .line 271 sget v0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/Util;->SDK_INT:I const/16 v1, 0x1a if-lt v0, v1, :cond_0 iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->foregroundNotificationUpdater:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$ForegroundNotificationUpdater; .line 272 invoke-virtual {v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$ForegroundNotificationUpdater;->showNotificationIfNotAlready()V .line 274 :cond_0 sget v0, Lcom/mbridge/msdk/playercommon/exoplayer2/util/Util;->SDK_INT:I const/16 v1, 0x1c if-ge v0, v1, :cond_1 iget-boolean v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->taskRemoved:Z if-eqz v0, :cond_1 .line 275 invoke-virtual {p0}, Landroid/app/Service;->stopSelf()V const-string v0, "stopSelf()" .line 276 invoke-direct {p0, v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->logd(Ljava/lang/String;)V goto :goto_0 :cond_1 iget v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->lastStartId:I .line 278 invoke-virtual {p0, v0}, Landroid/app/Service;->stopSelfResult(I)Z move-result v0 .line 279 new-instance v1, Ljava/lang/StringBuilder; invoke-direct {v1}, Ljava/lang/StringBuilder;->()V const-string v2, "stopSelf(" invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; iget v2, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->lastStartId:I invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; const-string v2, ") result: " invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder; invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 invoke-direct {p0, v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->logd(Ljava/lang/String;)V :goto_0 return-void .end method # virtual methods .method public abstract getDownloadManager()Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; .end method .method public abstract getForegroundNotification([Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager$TaskState;)Landroid/app/Notification; .end method .method public getRequirements()Lcom/mbridge/msdk/playercommon/exoplayer2/scheduler/Requirements; .locals 3 .line 232 new-instance v0, Lcom/mbridge/msdk/playercommon/exoplayer2/scheduler/Requirements; const/4 v1, 0x1 const/4 v2, 0x0 invoke-direct {v0, v1, v2, v2}, Lcom/mbridge/msdk/playercommon/exoplayer2/scheduler/Requirements;->(IZZ)V return-object v0 .end method .method public abstract getScheduler()Lcom/mbridge/msdk/playercommon/exoplayer2/scheduler/Scheduler; .annotation build Landroidx/annotation/Nullable; .end annotation .end method .method public onBind(Landroid/content/Intent;)Landroid/os/IBinder; .locals 0 .annotation build Landroidx/annotation/Nullable; .end annotation const/4 p1, 0x0 return-object p1 .end method .method public onCreate()V .locals 3 const-string v0, "onCreate" .line 145 invoke-direct {p0, v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->logd(Ljava/lang/String;)V iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->channelId:Ljava/lang/String; if-eqz v0, :cond_0 iget v1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->channelName:I const/4 v2, 0x2 .line 147 invoke-static {p0, v0, v1, v2}, Lcom/mbridge/msdk/playercommon/exoplayer2/util/NotificationUtil;->createNotificationChannel(Landroid/content/Context;Ljava/lang/String;II)V .line 150 :cond_0 invoke-virtual {p0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->getDownloadManager()Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; move-result-object v0 iput-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->downloadManager:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; .line 151 new-instance v0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$DownloadManagerListener; const/4 v1, 0x0 invoke-direct {v0, p0, v1}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$DownloadManagerListener;->(Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$1;)V iput-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->downloadManagerListener:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$DownloadManagerListener; iget-object v1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->downloadManager:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; .line 152 invoke-virtual {v1, v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager;->addListener(Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager$Listener;)V return-void .end method .method public onDestroy()V .locals 2 const-string v0, "onDestroy" .line 212 invoke-direct {p0, v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->logd(Ljava/lang/String;)V iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->foregroundNotificationUpdater:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$ForegroundNotificationUpdater; .line 213 invoke-virtual {v0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$ForegroundNotificationUpdater;->stopPeriodicUpdates()V iget-object v0, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->downloadManager:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; iget-object v1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->downloadManagerListener:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService$DownloadManagerListener; .line 214 invoke-virtual {v0, v1}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager;->removeListener(Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager$Listener;)V .line 215 invoke-direct {p0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->maybeStopWatchingRequirements()V return-void .end method .method public onStartCommand(Landroid/content/Intent;II)I .locals 6 iput p3, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->lastStartId:I const/4 p2, 0x0 iput-boolean p2, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->taskRemoved:Z const-string v0, "com.google.android.exoplayer.downloadService.action.RESTART" const/4 v1, 0x1 if-eqz p1, :cond_2 .line 161 invoke-virtual {p1}, Landroid/content/Intent;->getAction()Ljava/lang/String; move-result-object v2 iget-boolean v3, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->startedInForeground:Z const-string v4, "foreground" .line 163 invoke-virtual {p1, v4, p2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z move-result v4 if-nez v4, :cond_1 invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v4 if-eqz v4, :cond_0 goto :goto_0 :cond_0 move v4, p2 goto :goto_1 :cond_1 :goto_0 move v4, v1 :goto_1 or-int/2addr v3, v4 iput-boolean v3, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->startedInForeground:Z goto :goto_2 :cond_2 const/4 v2, 0x0 :goto_2 const-string v3, "com.google.android.exoplayer.downloadService.action.INIT" if-nez v2, :cond_3 move-object v2, v3 .line 169 :cond_3 new-instance v4, Ljava/lang/StringBuilder; invoke-direct {v4}, Ljava/lang/StringBuilder;->()V const-string v5, "onStartCommand action: " invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const-string v5, " startId: " invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v4, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p3 invoke-direct {p0, p3}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->logd(Ljava/lang/String;)V .line 170 invoke-virtual {v2}, Ljava/lang/String;->hashCode()I move-result p3 const/4 v4, -0x1 sparse-switch p3, :sswitch_data_0 :goto_3 move p2, v4 goto :goto_4 :sswitch_0 const-string p2, "com.google.android.exoplayer.downloadService.action.STOP_DOWNLOADS" invoke-virtual {v2, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result p2 if-nez p2, :cond_4 goto :goto_3 :cond_4 const/4 p2, 0x4 goto :goto_4 :sswitch_1 invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result p2 if-nez p2, :cond_5 goto :goto_3 :cond_5 const/4 p2, 0x3 goto :goto_4 :sswitch_2 const-string p2, "com.google.android.exoplayer.downloadService.action.START_DOWNLOADS" invoke-virtual {v2, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result p2 if-nez p2, :cond_6 goto :goto_3 :cond_6 const/4 p2, 0x2 goto :goto_4 :sswitch_3 const-string p2, "com.google.android.exoplayer.downloadService.action.ADD" invoke-virtual {v2, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result p2 if-nez p2, :cond_7 goto :goto_3 :cond_7 move p2, v1 goto :goto_4 :sswitch_4 invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result p3 if-nez p3, :cond_8 goto :goto_3 :cond_8 :goto_4 const-string p3, "DownloadService" packed-switch p2, :pswitch_data_0 .line 194 new-instance p1, Ljava/lang/StringBuilder; invoke-direct {p1}, Ljava/lang/StringBuilder;->()V const-string p2, "Ignoring unrecognized action: " invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 invoke-static {p3, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I goto :goto_5 :pswitch_0 iget-object p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->downloadManager:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; .line 188 invoke-virtual {p1}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager;->stopDownloads()V goto :goto_5 :pswitch_1 iget-object p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->downloadManager:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; .line 191 invoke-virtual {p1}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager;->startDownloads()V goto :goto_5 :pswitch_2 const-string p2, "download_action" .line 176 invoke-virtual {p1, p2}, Landroid/content/Intent;->getByteArrayExtra(Ljava/lang/String;)[B move-result-object p1 if-nez p1, :cond_9 const-string p1, "Ignoring ADD action with no action data" .line 178 invoke-static {p3, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I goto :goto_5 :cond_9 :try_start_0 iget-object p2, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->downloadManager:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; .line 181 invoke-virtual {p2, p1}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager;->handleAction([B)I :try_end_0 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0 goto :goto_5 :catch_0 move-exception p1 const-string p2, "Failed to handle ADD action" .line 183 invoke-static {p3, p2, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I .line 197 :goto_5 :pswitch_3 invoke-direct {p0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->maybeStartWatchingRequirements()V iget-object p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->downloadManager:Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager; .line 198 invoke-virtual {p1}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager;->isIdle()Z move-result p1 if-eqz p1, :cond_a .line 199 invoke-direct {p0}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->stop()V :cond_a return v1 :sswitch_data_0 .sparse-switch -0x33ed2c70 -> :sswitch_4 -0x16d2615e -> :sswitch_3 -0x141b5251 -> :sswitch_2 0x3c89ff0f -> :sswitch_1 0x4ca8280d -> :sswitch_0 .end sparse-switch :pswitch_data_0 .packed-switch 0x0 :pswitch_3 :pswitch_2 :pswitch_1 :pswitch_3 :pswitch_0 .end packed-switch .end method .method public onTaskRemoved(Landroid/content/Intent;)V .locals 2 .line 206 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v1, "onTaskRemoved rootIntent: " invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p0, p1}, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->logd(Ljava/lang/String;)V const/4 p1, 0x1 iput-boolean p1, p0, Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadService;->taskRemoved:Z return-void .end method .method public onTaskStateChanged(Lcom/mbridge/msdk/playercommon/exoplayer2/offline/DownloadManager$TaskState;)V .locals 0 return-void .end method