granularity level: instruction
.class public Lcom/google/firebase/messaging/FirebaseMessagingService;
.super Lcom/google/firebase/messaging/EnhancedIntentService;
.source "FirebaseMessagingService.java"
.field public static final ACTION_DIRECT_BOOT_REMOTE_INTENT:Ljava/lang/String; = "com.google.firebase.messaging.RECEIVE_DIRECT_BOOT"
.field static final ACTION_NEW_TOKEN:Ljava/lang/String; = "com.google.firebase.messaging.NEW_TOKEN"
.field static final ACTION_REMOTE_INTENT:Ljava/lang/String; = "com.google.android.c2dm.intent.RECEIVE"
.field static final EXTRA_TOKEN:Ljava/lang/String; = "token"
.field private static final RECENTLY_RECEIVED_MESSAGE_IDS_MAX_SIZE:I = 0xa
.field private static final recentlyReceivedMessageIds:Ljava/util/Queue;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Queue<",
"Ljava/lang/String;",
">;"
}
.end annotation
.end field
.method static constructor <clinit>()V
.locals 2
new-instance v0, Ljava/util/ArrayDeque;
const/16 v1, 0xa
invoke-direct {v0, v1}, Ljava/util/ArrayDeque;-><init>(I)V
sput-object v0, Lcom/google/firebase/messaging/FirebaseMessagingService;->recentlyReceivedMessageIds:Ljava/util/Queue;
return-void
.end method
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Lcom/google/firebase/messaging/EnhancedIntentService;-><init>()V
return-void
.end method
.method private alreadyReceivedMessage(Ljava/lang/String;)Z
.locals 4
invoke-static {p1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v0
const/4 v1, 0x0
if-eqz v0, :cond_0
return v1
:cond_0
sget-object v0, Lcom/google/firebase/messaging/FirebaseMessagingService;->recentlyReceivedMessageIds:Ljava/util/Queue;
invoke-interface {v0, p1}, Ljava/util/Queue;->contains(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_2
const/4 v0, 0x3
const-string v1, "FirebaseMessaging"
invoke-static {v1, v0}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
move-result v0
if-eqz v0, :cond_1
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Received duplicate message: "
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-static {v1, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
:cond_1
const/4 p1, 0x1
return p1
:cond_2
invoke-interface {v0}, Ljava/util/Queue;->size()I
move-result v2
const/16 v3, 0xa
if-lt v2, v3, :cond_3
invoke-interface {v0}, Ljava/util/Queue;->remove()Ljava/lang/Object;
:cond_3
invoke-interface {v0, p1}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z
return v1
.end method
.method private dispatchMessage(Landroid/content/Intent;)V
.locals 4
invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
move-result-object v0
if-nez v0, :cond_0
new-instance v0, Landroid/os/Bundle;
invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
:cond_0
const-string v1, "androidx.content.wakelockid"
invoke-virtual {v0, v1}, Landroid/os/Bundle;->remove(Ljava/lang/String;)V
invoke-static {v0}, Lcom/google/firebase/messaging/NotificationParams;->isNotification(Landroid/os/Bundle;)Z
move-result v1
if-eqz v1, :cond_2
new-instance v1, Lcom/google/firebase/messaging/NotificationParams;
invoke-direct {v1, v0}, Lcom/google/firebase/messaging/NotificationParams;-><init>(Landroid/os/Bundle;)V
invoke-static {}, Lcom/google/firebase/messaging/FcmExecutors;->newNetworkIOExecutor()Ljava/util/concurrent/ExecutorService;
move-result-object v2
new-instance v3, Lcom/google/firebase/messaging/DisplayNotification;
invoke-direct {v3, p0, v1, v2}, Lcom/google/firebase/messaging/DisplayNotification;-><init>(Landroid/content/Context;Lcom/google/firebase/messaging/NotificationParams;Ljava/util/concurrent/ExecutorService;)V
:try_start_0
invoke-virtual {v3}, Lcom/google/firebase/messaging/DisplayNotification;->handleNotification()Z
move-result v1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz v1, :cond_1
invoke-interface {v2}, Ljava/util/concurrent/ExecutorService;->shutdown()V
return-void
:cond_1
invoke-interface {v2}, Ljava/util/concurrent/ExecutorService;->shutdown()V
invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->shouldUploadScionMetrics(Landroid/content/Intent;)Z
move-result v1
if-eqz v1, :cond_2
invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->logNotificationForeground(Landroid/content/Intent;)V
goto :goto_0
:catchall_0
move-exception p1
invoke-interface {v2}, Ljava/util/concurrent/ExecutorService;->shutdown()V
throw p1
:goto_0
:cond_2
new-instance p1, Lcom/google/firebase/messaging/RemoteMessage;
invoke-direct {p1, v0}, Lcom/google/firebase/messaging/RemoteMessage;-><init>(Landroid/os/Bundle;)V
invoke-virtual {p0, p1}, Lcom/google/firebase/messaging/FirebaseMessagingService;->onMessageReceived(Lcom/google/firebase/messaging/RemoteMessage;)V
return-void
.end method
.method private getMessageId(Landroid/content/Intent;)Ljava/lang/String;
.locals 1
const-string v0, "google.message_id"
invoke-virtual {p1, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
if-nez v0, :cond_0
const-string v0, "message_id"
invoke-virtual {p1, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
:cond_0
return-object v0
.end method
.method private handleMessageIntent(Landroid/content/Intent;)V
.locals 1
const-string v0, "google.message_id"
invoke-virtual {p1, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
invoke-direct {p0, v0}, Lcom/google/firebase/messaging/FirebaseMessagingService;->alreadyReceivedMessage(Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_0
invoke-direct {p0, p1}, Lcom/google/firebase/messaging/FirebaseMessagingService;->passMessageIntentToSdk(Landroid/content/Intent;)V
:cond_0
return-void
.end method
.method private passMessageIntentToSdk(Landroid/content/Intent;)V
.locals 4
const-string v0, "message_type"
invoke-virtual {p1, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
const-string v1, "gcm"
if-nez v0, :cond_0
move-object v0, v1
:cond_0
invoke-virtual {v0}, Ljava/lang/String;->hashCode()I
const/4 v2, -0x1
invoke-virtual {v0}, Ljava/lang/String;->hashCode()I
move-result v3
sparse-switch v3, :sswitch_data_0
goto :goto_0
:sswitch_0
const-string v1, "send_event"
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-nez v1, :cond_1
goto :goto_0
:cond_1
const/4 v2, 0x3
goto :goto_0
:sswitch_1
const-string v1, "send_error"
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-nez v1, :cond_2
goto :goto_0
:cond_2
const/4 v2, 0x2
goto :goto_0
:sswitch_2
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-nez v1, :cond_3
goto :goto_0
:cond_3
const/4 v2, 0x1
goto :goto_0
:sswitch_3
const-string v1, "deleted_messages"
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-nez v1, :cond_4
goto :goto_0
:cond_4
const/4 v2, 0x0
:goto_0
packed-switch v2, :pswitch_data_0
new-instance p1, Ljava/lang/StringBuilder;
invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "Received message with unknown type: "
invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
const-string v0, "FirebaseMessaging"
invoke-static {v0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_1
:pswitch_0
const-string v0, "google.message_id"
invoke-virtual {p1, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
invoke-virtual {p0, p1}, Lcom/google/firebase/messaging/FirebaseMessagingService;->onMessageSent(Ljava/lang/String;)V
goto :goto_1
:pswitch_1
invoke-direct {p0, p1}, Lcom/google/firebase/messaging/FirebaseMessagingService;->getMessageId(Landroid/content/Intent;)Ljava/lang/String;
move-result-object v0
new-instance v1, Lcom/google/firebase/messaging/SendException;
const-string v2, "error"
invoke-virtual {p1, v2}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
invoke-direct {v1, p1}, Lcom/google/firebase/messaging/SendException;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, v0, v1}, Lcom/google/firebase/messaging/FirebaseMessagingService;->onSendError(Ljava/lang/String;Ljava/lang/Exception;)V
goto :goto_1
:pswitch_2
invoke-static {p1}, Lcom/google/firebase/messaging/MessagingAnalytics;->logNotificationReceived(Landroid/content/Intent;)V
invoke-direct {p0, p1}, Lcom/google/firebase/messaging/FirebaseMessagingService;->dispatchMessage(Landroid/content/Intent;)V
goto :goto_1
:pswitch_3
invoke-virtual {p0}, Lcom/google/firebase/messaging/FirebaseMessagingService;->onDeletedMessages()V
:goto_1
return-void
:pswitch_data_0
.packed-switch 0x0
:pswitch_3
:pswitch_2
:pswitch_1
:pswitch_0
.end packed-switch
:sswitch_data_0
.sparse-switch
-0x7aedf14e -> :sswitch_3
0x18f11 -> :sswitch_2
0x308f3e91 -> :sswitch_1
0x3090df23 -> :sswitch_0
.end sparse-switch
.end method
.method static resetForTesting()V
.locals 1
sget-object v0, Lcom/google/firebase/messaging/FirebaseMessagingService;->recentlyReceivedMessageIds:Ljava/util/Queue;
invoke-interface {v0}, Ljava/util/Queue;->clear()V
return-void
.end method
.method protected getStartCommandIntent(Landroid/content/Intent;)Landroid/content/Intent;
.locals 0
invoke-static {}, Lcom/google/firebase/messaging/ServiceStarter;->getInstance()Lcom/google/firebase/messaging/ServiceStarter;
move-result-object p1
invoke-virtual {p1}, Lcom/google/firebase/messaging/ServiceStarter;->getMessagingEvent()Landroid/content/Intent;
move-result-object p1
return-object p1
.end method
.method public handleIntent(Landroid/content/Intent;)V
.locals 2
invoke-virtual {p1}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v0
const-string v1, "com.google.android.c2dm.intent.RECEIVE"
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-nez v1, :cond_2
const-string v1, "com.google.firebase.messaging.RECEIVE_DIRECT_BOOT"
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
goto :goto_0
:cond_0
const-string v1, "com.google.firebase.messaging.NEW_TOKEN"
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_1
const-string v0, "token"
invoke-virtual {p1, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
invoke-virtual {p0, p1}, Lcom/google/firebase/messaging/FirebaseMessagingService;->onNewToken(Ljava/lang/String;)V
goto :goto_1
:cond_1
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
const-string v1, "Unknown intent action: "
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p1}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object p1
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
const-string v0, "FirebaseMessaging"
invoke-static {v0, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_1
:cond_2
:goto_0
invoke-direct {p0, p1}, Lcom/google/firebase/messaging/FirebaseMessagingService;->handleMessageIntent(Landroid/content/Intent;)V
:goto_1
return-void
.end method
.method public onDeletedMessages()V
.locals 0
return-void
.end method
.method public onMessageReceived(Lcom/google/firebase/messaging/RemoteMessage;)V
.locals 0
return-void
.end method
.method public onMessageSent(Ljava/lang/String;)V
.locals 0
return-void
.end method
.method public onNewToken(Ljava/lang/String;)V
.locals 0
return-void
.end method
.method public onSendError(Ljava/lang/String;Ljava/lang/Exception;)V
.locals 0
return-void
.end method