.class public abstract Landroidx/legacy/content/WakefulBroadcastReceiver; .super Landroid/content/BroadcastReceiver; .source "WakefulBroadcastReceiver.java" # annotations .annotation runtime Ljava/lang/Deprecated; .end annotation # static fields .field private static final EXTRA_WAKE_LOCK_ID:Ljava/lang/String; = "androidx.contentpager.content.wakelockid" .field private static mNextId:I .field private static final sActiveWakeLocks:Landroid/util/SparseArray; .annotation system Ldalvik/annotation/Signature; value = { "Landroid/util/SparseArray<", "Landroid/os/PowerManager$WakeLock;", ">;" } .end annotation .end field # direct methods .method static constructor ()V .locals 1 .line 76 new-instance v0, Landroid/util/SparseArray; invoke-direct {v0}, Landroid/util/SparseArray;->()V sput-object v0, Landroidx/legacy/content/WakefulBroadcastReceiver;->sActiveWakeLocks:Landroid/util/SparseArray; const/4 v0, 0x1 sput v0, Landroidx/legacy/content/WakefulBroadcastReceiver;->mNextId:I return-void .end method .method public constructor ()V .locals 0 .line 73 invoke-direct {p0}, Landroid/content/BroadcastReceiver;->()V return-void .end method .method public static completeWakefulIntent(Landroid/content/Intent;)Z .locals 5 const-string v0, "No active wake lock id #" const-string v1, "androidx.contentpager.content.wakelockid" const/4 v2, 0x0 .line 126 invoke-virtual {p0, v1, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I move-result p0 if-nez p0, :cond_0 return v2 :cond_0 sget-object v1, Landroidx/legacy/content/WakefulBroadcastReceiver;->sActiveWakeLocks:Landroid/util/SparseArray; .line 130 monitor-enter v1 .line 131 :try_start_0 invoke-virtual {v1, p0}, Landroid/util/SparseArray;->get(I)Ljava/lang/Object; move-result-object v2 check-cast v2, Landroid/os/PowerManager$WakeLock; const/4 v3, 0x1 if-eqz v2, :cond_1 .line 133 invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V .line 134 invoke-virtual {v1, p0}, Landroid/util/SparseArray;->remove(I)V .line 135 monitor-exit v1 return v3 :cond_1 const-string v2, "WakefulBroadcastReceiv." .line 143 new-instance v4, Ljava/lang/StringBuilder; invoke-direct {v4, v0}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {v4, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 invoke-static {v2, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I .line 144 monitor-exit v1 return v3 :catchall_0 move-exception p0 .line 145 monitor-exit v1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 throw p0 .end method .method public static startWakefulService(Landroid/content/Context;Landroid/content/Intent;)Landroid/content/ComponentName; .locals 5 const-string v0, "androidx.core:wake:" sget-object v1, Landroidx/legacy/content/WakefulBroadcastReceiver;->sActiveWakeLocks:Landroid/util/SparseArray; .line 94 monitor-enter v1 :try_start_0 sget v2, Landroidx/legacy/content/WakefulBroadcastReceiver;->mNextId:I add-int/lit8 v3, v2, 0x1 sput v3, Landroidx/legacy/content/WakefulBroadcastReceiver;->mNextId:I const/4 v4, 0x1 if-gtz v3, :cond_0 sput v4, Landroidx/legacy/content/WakefulBroadcastReceiver;->mNextId:I :cond_0 const-string v3, "androidx.contentpager.content.wakelockid" .line 101 invoke-virtual {p1, v3, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent; .line 102 invoke-virtual {p0, p1}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName; move-result-object p1 if-nez p1, :cond_1 .line 104 monitor-exit v1 const/4 p0, 0x0 return-object p0 :cond_1 const-string v3, "power" .line 107 invoke-virtual {p0, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object p0 check-cast p0, Landroid/os/PowerManager; .line 108 new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3, v0}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V .line 109 invoke-virtual {p1}, Landroid/content/ComponentName;->flattenToShortString()Ljava/lang/String; move-result-object v0 invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 .line 108 invoke-virtual {p0, v4, v0}, Landroid/os/PowerManager;->newWakeLock(ILjava/lang/String;)Landroid/os/PowerManager$WakeLock; move-result-object p0 const/4 v0, 0x0 .line 110 invoke-virtual {p0, v0}, Landroid/os/PowerManager$WakeLock;->setReferenceCounted(Z)V const-wide/32 v3, 0xea60 .line 111 invoke-virtual {p0, v3, v4}, Landroid/os/PowerManager$WakeLock;->acquire(J)V .line 112 invoke-virtual {v1, v2, p0}, Landroid/util/SparseArray;->put(ILjava/lang/Object;)V .line 113 monitor-exit v1 return-object p1 :catchall_0 move-exception p0 .line 114 monitor-exit v1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 throw p0 .end method