今奥全景相机
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

562 lines
17 KiB

.class Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;
.super Landroid/os/AsyncTask;
.source "YoutubeLiveActivity.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/viatech/camera/YoutubeLiveActivity;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x2
name = "GetLiveEventsTask"
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroid/os/AsyncTask",
"<",
"Ljava/lang/String;",
"Ljava/lang/Void;",
"Ljava/util/List",
"<",
"Lcom/via/vpailib/vpaiinterface/EventData;",
">;>;"
}
.end annotation
# instance fields
.field private mName:Ljava/lang/String;
.field private mRefresher:Lcom/viatech/camera/YoutubeLiveActivity$ListRefresher;
.field private mStartTime:J
.field private mType:Ljava/lang/String;
.field private progressDialog:Landroid/app/ProgressDialog;
.field final synthetic this$0:Lcom/viatech/camera/YoutubeLiveActivity;
# direct methods
.method public constructor <init>(Lcom/viatech/camera/YoutubeLiveActivity;Lcom/viatech/camera/YoutubeLiveActivity$ListRefresher;)V
.locals 0
.prologue
.line 439
iput-object p1, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
invoke-direct {p0}, Landroid/os/AsyncTask;-><init>()V
.line 440
iput-object p2, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mRefresher:Lcom/viatech/camera/YoutubeLiveActivity$ListRefresher;
.line 441
return-void
.end method
.method static synthetic access$1000(Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;)Lcom/viatech/camera/YoutubeLiveActivity$ListRefresher;
.locals 1
.prologue
.line 430
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mRefresher:Lcom/viatech/camera/YoutubeLiveActivity$ListRefresher;
return-object v0
.end method
.method static synthetic access$800(Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;)Ljava/lang/String;
.locals 1
.prologue
.line 430
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mType:Ljava/lang/String;
return-object v0
.end method
.method static synthetic access$900(Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;)Ljava/lang/String;
.locals 1
.prologue
.line 430
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mName:Ljava/lang/String;
return-object v0
.end method
# virtual methods
.method protected bridge synthetic doInBackground([Ljava/lang/Object;)Ljava/lang/Object;
.locals 1
.prologue
.line 430
check-cast p1, [Ljava/lang/String;
invoke-virtual {p0, p1}, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->doInBackground([Ljava/lang/String;)Ljava/util/List;
move-result-object v0
return-object v0
.end method
.method protected varargs doInBackground([Ljava/lang/String;)Ljava/util/List;
.locals 4
.annotation system Ldalvik/annotation/Signature;
value = {
"([",
"Ljava/lang/String;",
")",
"Ljava/util/List",
"<",
"Lcom/via/vpailib/vpaiinterface/EventData;",
">;"
}
.end annotation
.prologue
.line 455
new-instance v0, Lcom/google/api/services/youtube/YouTube$Builder;
iget-object v1, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
iget-object v1, v1, Lcom/viatech/camera/YoutubeLiveActivity;->transport:Lcom/google/api/client/http/HttpTransport;
iget-object v2, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
iget-object v2, v2, Lcom/viatech/camera/YoutubeLiveActivity;->jsonFactory:Lcom/google/api/client/json/JsonFactory;
iget-object v3, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
.line 456
invoke-static {v3}, Lcom/viatech/camera/YoutubeLiveActivity;->access$500(Lcom/viatech/camera/YoutubeLiveActivity;)Lcom/google/api/client/googleapis/extensions/android/gms/auth/GoogleAccountCredential;
move-result-object v3
invoke-direct {v0, v1, v2, v3}, Lcom/google/api/services/youtube/YouTube$Builder;-><init>(Lcom/google/api/client/http/HttpTransport;Lcom/google/api/client/json/JsonFactory;Lcom/google/api/client/http/HttpRequestInitializer;)V
const-string v1, "VpaiLive"
invoke-virtual {v0, v1}, Lcom/google/api/services/youtube/YouTube$Builder;->setApplicationName(Ljava/lang/String;)Lcom/google/api/services/youtube/YouTube$Builder;
move-result-object v0
.line 457
invoke-virtual {v0}, Lcom/google/api/services/youtube/YouTube$Builder;->build()Lcom/google/api/services/youtube/YouTube;
move-result-object v0
.line 459
const/4 v1, 0x0
:try_start_0
aget-object v1, p1, v1
iput-object v1, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mType:Ljava/lang/String;
.line 460
const/4 v1, 0x1
aget-object v1, p1, v1
iput-object v1, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mName:Ljava/lang/String;
.line 461
iget-object v1, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mType:Ljava/lang/String;
const-string v2, "ConceredBroadcast"
invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
.line 462
iget-object v1, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mName:Ljava/lang/String;
invoke-static {v0, v1}, Lcom/via/vpailib/vpaiinterface/YouTubeApi;->getBroadcastData(Lcom/google/api/services/youtube/YouTube;Ljava/lang/String;)Ljava/util/List;
move-result-object v0
.line 472
:goto_0
return-object v0
.line 464
:cond_0
invoke-static {v0}, Lcom/via/vpailib/vpaiinterface/YouTubeApi;->getUpcomingAndActiveEvents(Lcom/google/api/services/youtube/YouTube;)Ljava/util/List;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
move-result-object v0
goto :goto_0
.line 469
:catch_0
move-exception v0
.line 470
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
.line 472
const/4 v0, 0x0
goto :goto_0
.end method
.method protected bridge synthetic onPostExecute(Ljava/lang/Object;)V
.locals 0
.prologue
.line 430
check-cast p1, Ljava/util/List;
invoke-virtual {p0, p1}, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->onPostExecute(Ljava/util/List;)V
return-void
.end method
.method protected onPostExecute(Ljava/util/List;)V
.locals 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List",
"<",
"Lcom/via/vpailib/vpaiinterface/EventData;",
">;)V"
}
.end annotation
.prologue
.line 478
if-nez p1, :cond_1
.line 479
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mRefresher:Lcom/viatech/camera/YoutubeLiveActivity$ListRefresher;
if-nez v0, :cond_0
.line 480
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->progressDialog:Landroid/app/ProgressDialog;
invoke-virtual {v0}, Landroid/app/ProgressDialog;->dismiss()V
.line 481
:cond_0
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
invoke-static {v0}, Lcom/viatech/camera/YoutubeLiveActivity;->access$600(Lcom/viatech/camera/YoutubeLiveActivity;)Lcom/viatech/camera/EventsListFragment;
move-result-object v0
const v1, 0x7f070091
invoke-virtual {v0, v1}, Lcom/viatech/camera/EventsListFragment;->setEmptyViewText(I)V
.line 482
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
invoke-static {v0}, Lcom/viatech/camera/YoutubeLiveActivity;->access$600(Lcom/viatech/camera/YoutubeLiveActivity;)Lcom/viatech/camera/EventsListFragment;
move-result-object v0
const/4 v1, 0x0
invoke-virtual {v0, v1}, Lcom/viatech/camera/EventsListFragment;->setEvents(Ljava/util/List;)V
.line 521
:goto_0
return-void
.line 486
:cond_1
invoke-interface {p1}, Ljava/util/List;->size()I
move-result v0
if-nez v0, :cond_2
.line 487
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
invoke-static {v0}, Lcom/viatech/camera/YoutubeLiveActivity;->access$600(Lcom/viatech/camera/YoutubeLiveActivity;)Lcom/viatech/camera/EventsListFragment;
move-result-object v0
const v1, 0x7f070129
invoke-virtual {v0, v1}, Lcom/viatech/camera/EventsListFragment;->setEmptyViewText(I)V
.line 490
:cond_2
const/4 v0, 0x0
.line 491
iget-object v1, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
invoke-static {v1}, Lcom/viatech/camera/YoutubeLiveActivity;->access$700(Lcom/viatech/camera/YoutubeLiveActivity;)Ljava/util/ArrayList;
move-result-object v1
if-nez v1, :cond_3
.line 492
iget-object v1, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
new-instance v2, Ljava/util/ArrayList;
invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V
invoke-static {v1, v2}, Lcom/viatech/camera/YoutubeLiveActivity;->access$702(Lcom/viatech/camera/YoutubeLiveActivity;Ljava/util/ArrayList;)Ljava/util/ArrayList;
.line 496
:goto_1
if-eqz p1, :cond_4
.line 497
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v3
move v1, v0
:goto_2
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_4
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/via/vpailib/vpaiinterface/EventData;
.line 498
const-string v4, "YoutubeLiveActivity"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
add-int/lit8 v2, v1, 0x1
invoke-virtual {v5, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v1
const-string v5, " id:"
invoke-virtual {v1, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v0}, Lcom/via/vpailib/vpaiinterface/EventData;->getId()Ljava/lang/String;
move-result-object v5
invoke-virtual {v1, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
const-string v5, ", event: "
invoke-virtual {v1, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v0}, Lcom/via/vpailib/vpaiinterface/EventData;->getIngestionAddress()Ljava/lang/String;
move-result-object v5
invoke-virtual {v1, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v4, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 499
iget-object v1, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
invoke-static {v1}, Lcom/viatech/camera/YoutubeLiveActivity;->access$700(Lcom/viatech/camera/YoutubeLiveActivity;)Ljava/util/ArrayList;
move-result-object v1
invoke-virtual {v0}, Lcom/via/vpailib/vpaiinterface/EventData;->getId()Ljava/lang/String;
move-result-object v0
invoke-virtual {v1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move v1, v2
.line 500
goto :goto_2
.line 494
:cond_3
iget-object v1, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
invoke-static {v1}, Lcom/viatech/camera/YoutubeLiveActivity;->access$700(Lcom/viatech/camera/YoutubeLiveActivity;)Ljava/util/ArrayList;
move-result-object v1
invoke-virtual {v1}, Ljava/util/ArrayList;->clear()V
goto :goto_1
.line 503
:cond_4
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mRefresher:Lcom/viatech/camera/YoutubeLiveActivity$ListRefresher;
if-nez v0, :cond_5
.line 504
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->progressDialog:Landroid/app/ProgressDialog;
invoke-virtual {v0}, Landroid/app/ProgressDialog;->dismiss()V
.line 505
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
invoke-static {v0}, Lcom/viatech/camera/YoutubeLiveActivity;->access$600(Lcom/viatech/camera/YoutubeLiveActivity;)Lcom/viatech/camera/EventsListFragment;
move-result-object v0
invoke-virtual {v0, p1}, Lcom/viatech/camera/EventsListFragment;->setEvents(Ljava/util/List;)V
.line 518
:goto_3
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
invoke-static {v0}, Lcom/viatech/camera/YoutubeLiveActivity;->access$1100(Lcom/viatech/camera/YoutubeLiveActivity;)V
.line 520
const-string v0, "YoutubeLiveActivity"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "fetchevent cost "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J
move-result-wide v2
iget-wide v4, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mStartTime:J
sub-long/2addr v2, v4
invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
goto/16 :goto_0
.line 507
:cond_5
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mRefresher:Lcom/viatech/camera/YoutubeLiveActivity$ListRefresher;
invoke-interface {v0, p1}, Lcom/viatech/camera/YoutubeLiveActivity$ListRefresher;->needRefresh(Ljava/util/List;)Z
move-result v0
if-eqz v0, :cond_6
.line 508
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
iget-object v0, v0, Lcom/viatech/camera/YoutubeLiveActivity;->mHandler:Landroid/os/Handler;
new-instance v1, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask$1;
invoke-direct {v1, p0}, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask$1;-><init>(Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;)V
const-wide/16 v2, 0x9c4
invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
.line 515
:cond_6
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
invoke-static {v0}, Lcom/viatech/camera/YoutubeLiveActivity;->access$600(Lcom/viatech/camera/YoutubeLiveActivity;)Lcom/viatech/camera/EventsListFragment;
move-result-object v0
invoke-virtual {v0, p1}, Lcom/viatech/camera/EventsListFragment;->setEvents(Ljava/util/List;)V
goto :goto_3
.end method
.method protected onPreExecute()V
.locals 5
.prologue
const/4 v4, 0x1
.line 445
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mRefresher:Lcom/viatech/camera/YoutubeLiveActivity$ListRefresher;
if-nez v0, :cond_0
.line 446
iget-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
const/4 v1, 0x0
iget-object v2, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->this$0:Lcom/viatech/camera/YoutubeLiveActivity;
.line 447
invoke-virtual {v2}, Lcom/viatech/camera/YoutubeLiveActivity;->getResources()Landroid/content/res/Resources;
move-result-object v2
const v3, 0x7f0700f5
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getText(I)Ljava/lang/CharSequence;
move-result-object v2
.line 446
invoke-static {v0, v1, v2, v4, v4}, Landroid/app/ProgressDialog;->show(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZZ)Landroid/app/ProgressDialog;
move-result-object v0
iput-object v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->progressDialog:Landroid/app/ProgressDialog;
.line 449
:cond_0
invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J
move-result-wide v0
iput-wide v0, p0, Lcom/viatech/camera/YoutubeLiveActivity$GetLiveEventsTask;->mStartTime:J
.line 450
return-void
.end method