151 lines
3.9 KiB
Smali
151 lines
3.9 KiB
Smali
.class public Lme/leolin/shortcutbadger/impl/NewHtcHomeBadger;
|
|
.super Ljava/lang/Object;
|
|
.source "NewHtcHomeBadger.java"
|
|
|
|
# interfaces
|
|
.implements Lme/leolin/shortcutbadger/Badger;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 18
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a()Ljava/util/List;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/String;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 48
|
|
new-array v0, v0, [Ljava/lang/String;
|
|
|
|
const-string v1, "com.htc.launcher"
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
invoke-static {v0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public a(Landroid/content/Context;Landroid/content/ComponentName;I)V
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lme/leolin/shortcutbadger/ShortcutBadgeException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 30
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-string v1, "com.htc.launcher.action.SET_NOTIFICATION"
|
|
|
|
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string v1, "com.htc.launcher.extra.COMPONENT"
|
|
|
|
.line 31
|
|
invoke-virtual {p2}, Landroid/content/ComponentName;->flattenToShortString()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
const-string v1, "com.htc.launcher.extra.COUNT"
|
|
|
|
.line 32
|
|
invoke-virtual {v0, v1, p3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;
|
|
|
|
.line 34
|
|
new-instance v1, Landroid/content/Intent;
|
|
|
|
const-string v2, "com.htc.launcher.action.UPDATE_SHORTCUT"
|
|
|
|
invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
const-string v2, "packagename"
|
|
|
|
.line 35
|
|
invoke-virtual {p2}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {v1, v2, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
const-string p2, "count"
|
|
|
|
.line 36
|
|
invoke-virtual {v1, p2, p3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;
|
|
|
|
.line 38
|
|
invoke-static {p1, v0}, Lme/leolin/shortcutbadger/util/BroadcastHelper;->a(Landroid/content/Context;Landroid/content/Intent;)Z
|
|
|
|
move-result p2
|
|
|
|
if-nez p2, :cond_1
|
|
|
|
invoke-static {p1, v1}, Lme/leolin/shortcutbadger/util/BroadcastHelper;->a(Landroid/content/Context;Landroid/content/Intent;)Z
|
|
|
|
move-result p2
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 42
|
|
:cond_0
|
|
new-instance p1, Lme/leolin/shortcutbadger/ShortcutBadgeException;
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string p3, "unable to resolve intent: "
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Landroid/content/Intent;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Lme/leolin/shortcutbadger/ShortcutBadgeException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 39
|
|
:cond_1
|
|
:goto_0
|
|
invoke-virtual {p1, v0}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
|
|
|
|
.line 40
|
|
invoke-virtual {p1, v1}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
|
|
|
|
return-void
|
|
.end method
|