Themers - Anyone know how to hide the statusbar clock


Last Updated:

  1. Fadelight

    Fadelight Well-Known Member This Topic's Starter

    Joined:
    Oct 29, 2009
    Messages:
    1,393
    Likes Received:
    95
    For the sake of keeping this from going the way every other thread I've seen on the subject always goes: Yes, I am fully aware that adw launcher and launcher pro give you the option of hiding your whole statusbar. No, that is not what I am after, nor is that what this post is about.

    This is a question for theme developers...

    Is there anyone out there that knows how to hide the statusbar clock in FroYo? I've been poking around for the past two days trying to figure this one out on my own, but it's not going as smoothly as I would like it to be.

    Most of what I've been reading points to the Services.jar file. (Specifically com\android\server\status\StatusBarIcon.smali)... but any of the threads I've found mention changing the border. I can't find anything in the StatusBarIcon.smali file that indicates border spacing at all.

    Am I even on the right track here, or am I looking in completely the wrong place?


    This is the StatusBarIcon.smali file...

    Code (Text):
    1. .class Lcom/android/server/status/StatusBarIcon;
    2. .super Ljava/lang/Object;
    3. .source "StatusBarIcon.java"
    4.  
    5.  
    6. # static fields
    7. .field private static final ICON_GAP:I = 0x8
    8.  
    9. .field private static final ICON_HEIGHT:I = 0x19
    10.  
    11. .field private static final ICON_WIDTH:I = 0x19
    12.  
    13.  
    14. # instance fields
    15. .field mData:Lcom/android/server/status/IconData;
    16.  
    17. .field private mImageView:Lcom/android/server/status/AnimatedImageView;
    18.  
    19. .field private mNumberView:Landroid/widget/TextView;
    20.  
    21. .field private mTextView:Landroid/widget/TextView;
    22.  
    23. .field public view:Landroid/view/View;
    24.  
    25.  
    26. # direct methods
    27. .method public constructor <init>(Landroid/content/Context;Lcom/android/server/status/IconData;Landroid/view/ViewGroup;)V
    28.     .registers 13
    29.     .parameter "context"
    30.     .parameter "data"
    31.     .parameter "parent"
    32.  
    33.     .prologue
    34.     const/4 v8, 0x0
    35.  
    36.     .line 49
    37.     invoke-direct {p0}, Ljava/lang/Object;-><init>()V
    38.  
    39.     .line 50
    40.     invoke-virtual {p2}, Lcom/android/server/status/IconData;->clone()Lcom/android/server/status/IconData;
    41.  
    42.     move-result-object v6
    43.  
    44.     iput-object v6, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    45.  
    46.     .line 52
    47.     iget v6, p2, Lcom/android/server/status/IconData;->type:I
    48.  
    49.     packed-switch v6, :pswitch_data_9c
    50.  
    51.     .line 96
    52.     :goto_f
    53.     return-void
    54.  
    55.     .line 55
    56.     :pswitch_10
    57.     new-instance v4, Landroid/widget/TextView;
    58.  
    59.     invoke-direct {v4, p1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V
    60.  
    61.     .line 56
    62.     .local v4, t:Landroid/widget/TextView;
    63.     iput-object v4, p0, Lcom/android/server/status/StatusBarIcon;->mTextView:Landroid/widget/TextView;
    64.  
    65.     .line 57
    66.     new-instance v2, Landroid/widget/LinearLayout$LayoutParams;
    67.  
    68.     const/4 v6, -0x2
    69.  
    70.     const/4 v7, -0x1
    71.  
    72.     invoke-direct {v2, v6, v7}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V
    73.  
    74.     .line 60
    75.     .local v2, layoutParams:Landroid/widget/LinearLayout$LayoutParams;
    76.     const/high16 v6, 0x4180
    77.  
    78.     invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextSize(F)V
    79.  
    80.     .line 61
    81.     const/high16 v6, -0x100
    82.  
    83.     invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextColor(I)V
    84.  
    85.     .line 62
    86.     sget-object v6, Landroid/graphics/Typeface;->DEFAULT_BOLD:Landroid/graphics/Typeface;
    87.  
    88.     invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V
    89.  
    90.     .line 63
    91.     const/16 v6, 0x13
    92.  
    93.     invoke-virtual {v4, v6}, Landroid/widget/TextView;->setGravity(I)V
    94.  
    95.     .line 64
    96.     const/4 v6, 0x6
    97.  
    98.     invoke-virtual {v4, v6, v8, v8, v8}, Landroid/widget/TextView;->setPadding(IIII)V
    99.  
    100.     .line 65
    101.     invoke-virtual {v4, v2}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V
    102.  
    103.     .line 66
    104.     iget-object v6, p2, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
    105.  
    106.     invoke-virtual {v4, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    107.  
    108.     .line 67
    109.     iput-object v4, p0, Lcom/android/server/status/StatusBarIcon;->view:Landroid/view/View;
    110.  
    111.     goto :goto_f
    112.  
    113.     .line 73
    114.     .end local v2           #layoutParams:Landroid/widget/LinearLayout$LayoutParams;
    115.     .end local v4           #t:Landroid/widget/TextView;
    116.     :pswitch_41
    117.     const-string v6, "layout_inflater"
    118.  
    119.     invoke-virtual {p1, v6}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
    120.  
    121.     move-result-object v1
    122.  
    123.     check-cast v1, Landroid/view/LayoutInflater;
    124.  
    125.     .line 75
    126.     .local v1, inflater:Landroid/view/LayoutInflater;
    127.     const v6, 0x1090064
    128.  
    129.     invoke-virtual {v1, v6, p3, v8}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
    130.  
    131.     move-result-object v5
    132.  
    133.     .line 76
    134.     .local v5, v:Landroid/view/View;
    135.     iput-object v5, p0, Lcom/android/server/status/StatusBarIcon;->view:Landroid/view/View;
    136.  
    137.     .line 79
    138.     const v6, 0x1020176
    139.  
    140.     invoke-virtual {v5, v6}, Landroid/view/View;->findViewById(I)Landroid/view/View;
    141.  
    142.     move-result-object v0
    143.  
    144.     check-cast v0, Lcom/android/server/status/AnimatedImageView;
    145.  
    146.     .line 80
    147.     .local v0, im:Lcom/android/server/status/AnimatedImageView;
    148.     invoke-static {p1, p2}, Lcom/android/server/status/StatusBarIcon;->getIcon(Landroid/content/Context;Lcom/android/server/status/IconData;)Landroid/graphics/drawable/Drawable;
    149.  
    150.     move-result-object v6
    151.  
    152.     invoke-virtual {v0, v6}, Lcom/android/server/status/AnimatedImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V
    153.  
    154.     .line 81
    155.     iget v6, p2, Lcom/android/server/status/IconData;->iconLevel:I
    156.  
    157.     invoke-virtual {v0, v6}, Lcom/android/server/status/AnimatedImageView;->setImageLevel(I)V
    158.  
    159.     .line 82
    160.     iput-object v0, p0, Lcom/android/server/status/StatusBarIcon;->mImageView:Lcom/android/server/status/AnimatedImageView;
    161.  
    162.     .line 85
    163.     const v6, 0x1020055
    164.  
    165.     invoke-virtual {v5, v6}, Landroid/view/View;->findViewById(I)Landroid/view/View;
    166.  
    167.     move-result-object v3
    168.  
    169.     check-cast v3, Landroid/widget/TextView;
    170.  
    171.     .line 86
    172.     .local v3, nv:Landroid/widget/TextView;
    173.     iput-object v3, p0, Lcom/android/server/status/StatusBarIcon;->mNumberView:Landroid/widget/TextView;
    174.  
    175.     .line 87
    176.     iget v6, p2, Lcom/android/server/status/IconData;->number:I
    177.  
    178.     if-lez v6, :cond_95
    179.  
    180.     .line 88
    181.     new-instance v6, Ljava/lang/StringBuilder;
    182.  
    183.     invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
    184.  
    185.     const-string v7, ""
    186.  
    187.     invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    188.  
    189.     move-result-object v6
    190.  
    191.     iget v7, p2, Lcom/android/server/status/IconData;->number:I
    192.  
    193.     invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
    194.  
    195.     move-result-object v6
    196.  
    197.     invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    198.  
    199.     move-result-object v6
    200.  
    201.     invoke-virtual {v3, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    202.  
    203.     .line 89
    204.     invoke-virtual {v3, v8}, Landroid/widget/TextView;->setVisibility(I)V
    205.  
    206.     goto/16 :goto_f
    207.  
    208.     .line 91
    209.     :cond_95
    210.     const/16 v6, 0x8
    211.  
    212.     invoke-virtual {v3, v6}, Landroid/widget/TextView;->setVisibility(I)V
    213.  
    214.     goto/16 :goto_f
    215.  
    216.     .line 52
    217.     :pswitch_data_9c
    218.     .packed-switch 0x1
    219.         :pswitch_10
    220.         :pswitch_41
    221.     .end packed-switch
    222. .end method
    223.  
    224. .method static getIcon(Landroid/content/Context;Lcom/android/server/status/IconData;)Landroid/graphics/drawable/Drawable;
    225.     .registers 11
    226.     .parameter "context"
    227.     .parameter "data"
    228.  
    229.     .prologue
    230.     const/4 v7, 0x0
    231.  
    232.     const-string v8, "StatusBar"
    233.  
    234.     .line 164
    235.     iget-object v5, p1, Lcom/android/server/status/IconData;->iconUri:Landroid/net/Uri;
    236.  
    237.     if-eqz v5, :cond_7f
    238.  
    239.     .line 165
    240.     const/4 v0, 0x0
    241.  
    242.     .line 166
    243.     .local v0, d:Landroid/graphics/drawable/Drawable;
    244.     const-string v5, "content"
    245.  
    246.     iget-object v6, p1, Lcom/android/server/status/IconData;->iconUri:Landroid/net/Uri;
    247.  
    248.     invoke-virtual {v6}, Landroid/net/Uri;->getScheme()Ljava/lang/String;
    249.  
    250.     move-result-object v6
    251.  
    252.     invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
    253.  
    254.     move-result v5
    255.  
    256.     if-eqz v5, :cond_74
    257.  
    258.     .line 168
    259.     const/4 v3, 0x0
    260.  
    261.     .line 170
    262.     .local v3, is:Ljava/io/InputStream;
    263.     :try_start_17
    264.     invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
    265.  
    266.     move-result-object v5
    267.  
    268.     iget-object v6, p1, Lcom/android/server/status/IconData;->iconUri:Landroid/net/Uri;
    269.  
    270.     invoke-virtual {v5, v6}, Landroid/content/ContentResolver;->openInputStream(Landroid/net/Uri;)Ljava/io/InputStream;
    271.  
    272.     move-result-object v3
    273.  
    274.     .line 171
    275.     const/4 v5, 0x0
    276.  
    277.     invoke-static {v3, v5}, Landroid/graphics/drawable/Drawable;->createFromStream(Ljava/io/InputStream;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;
    278.     :try_end_25
    279.     .catchall {:try_start_17 .. :try_end_25} :catchall_6d
    280.     .catch Ljava/lang/Throwable; {:try_start_17 .. :try_end_25} :catch_49
    281.  
    282.     move-result-object v0
    283.  
    284.     .line 177
    285.     if-eqz v3, :cond_2b
    286.  
    287.     .line 179
    288.     :try_start_28
    289.     invoke-virtual {v3}, Ljava/io/InputStream;->close()V
    290.     :try_end_2b
    291.     .catch Ljava/io/IOException; {:try_start_28 .. :try_end_2b} :catch_6b
    292.  
    293.     .line 190
    294.     .end local v3           #is:Ljava/io/InputStream;
    295.     :cond_2b
    296.     :goto_2b
    297.     if-nez v0, :cond_47
    298.  
    299.     .line 191
    300.     const-string v5, "StatusBar"
    301.  
    302.     new-instance v5, Ljava/lang/StringBuilder;
    303.  
    304.     invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
    305.  
    306.     const-string v6, "Failed to load drawable from uri: "
    307.  
    308.     invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    309.  
    310.     move-result-object v5
    311.  
    312.     iget-object v6, p1, Lcom/android/server/status/IconData;->iconUri:Landroid/net/Uri;
    313.  
    314.     invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    315.  
    316.     move-result-object v5
    317.  
    318.     invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    319.  
    320.     move-result-object v5
    321.  
    322.     invoke-static {v8, v5}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;)I
    323.  
    324.     :cond_47
    325.     move-object v5, v0
    326.  
    327.     .line 222
    328.     .end local v0           #d:Landroid/graphics/drawable/Drawable;
    329.     :goto_48
    330.     return-object v5
    331.  
    332.     .line 174
    333.     .restart local v0       #d:Landroid/graphics/drawable/Drawable;
    334.     .restart local v3       #is:Ljava/io/InputStream;
    335.     :catch_49
    336.     move-exception v5
    337.  
    338.     move-object v1, v5
    339.  
    340.     .line 175
    341.     .local v1, e:Ljava/lang/Throwable;
    342.     :try_start_4b
    343.     const-string v5, "StatusBar"
    344.  
    345.     new-instance v6, Ljava/lang/StringBuilder;
    346.  
    347.     invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
    348.  
    349.     const-string v7, "Unable to open content: "
    350.  
    351.     invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    352.  
    353.     move-result-object v6
    354.  
    355.     iget-object v7, p1, Lcom/android/server/status/IconData;->iconUri:Landroid/net/Uri;
    356.  
    357.     invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    358.  
    359.     move-result-object v6
    360.  
    361.     invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    362.  
    363.     move-result-object v6
    364.  
    365.     invoke-static {v5, v6, v1}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    366.     :try_end_65
    367.     .catchall {:try_start_4b .. :try_end_65} :catchall_6d
    368.  
    369.     .line 177
    370.     if-eqz v3, :cond_2b
    371.  
    372.     .line 179
    373.     :try_start_67
    374.     invoke-virtual {v3}, Ljava/io/InputStream;->close()V
    375.     :try_end_6a
    376.     .catch Ljava/io/IOException; {:try_start_67 .. :try_end_6a} :catch_6b
    377.  
    378.     goto :goto_2b
    379.  
    380.     .line 180
    381.     .end local v1           #e:Ljava/lang/Throwable;
    382.     :catch_6b
    383.     move-exception v5
    384.  
    385.     goto :goto_2b
    386.  
    387.     .line 177
    388.     :catchall_6d
    389.     move-exception v5
    390.  
    391.     if-eqz v3, :cond_73
    392.  
    393.     .line 179
    394.     :try_start_70
    395.     invoke-virtual {v3}, Ljava/io/InputStream;->close()V
    396.     :try_end_73
    397.     .catch Ljava/io/IOException; {:try_start_70 .. :try_end_73} :catch_114
    398.  
    399.     .line 177
    400.     :cond_73
    401.     :goto_73
    402.     throw v5
    403.  
    404.     .line 187
    405.     .end local v3           #is:Ljava/io/InputStream;
    406.     :cond_74
    407.     iget-object v5, p1, Lcom/android/server/status/IconData;->iconUri:Landroid/net/Uri;
    408.  
    409.     invoke-virtual {v5}, Landroid/net/Uri;->toString()Ljava/lang/String;
    410.  
    411.     move-result-object v5
    412.  
    413.     invoke-static {v5}, Landroid/graphics/drawable/Drawable;->createFromPath(Ljava/lang/String;)Landroid/graphics/drawable/Drawable;
    414.  
    415.     move-result-object v0
    416.  
    417.     goto :goto_2b
    418.  
    419.     .line 196
    420.     .end local v0           #d:Landroid/graphics/drawable/Drawable;
    421.     :cond_7f
    422.     const/4 v4, 0x0
    423.  
    424.     .line 198
    425.     .local v4, r:Landroid/content/res/Resources;
    426.     iget-object v5, p1, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
    427.  
    428.     if-eqz v5, :cond_cd
    429.  
    430.     .line 200
    431.     :try_start_84
    432.     invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
    433.  
    434.     move-result-object v5
    435.  
    436.     iget-object v6, p1, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
    437.  
    438.     invoke-virtual {v5, v6}, Landroid/content/pm/PackageManager;->getResourcesForApplication(Ljava/lang/String;)Landroid/content/res/Resources;
    439.     :try_end_8d
    440.     .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_84 .. :try_end_8d} :catch_ae
    441.  
    442.     move-result-object v4
    443.  
    444.     .line 209
    445.     :goto_8e
    446.     iget v5, p1, Lcom/android/server/status/IconData;->iconId:I
    447.  
    448.     if-nez v5, :cond_d2
    449.  
    450.     .line 210
    451.     const-string v5, "StatusBar"
    452.  
    453.     new-instance v5, Ljava/lang/StringBuilder;
    454.  
    455.     invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
    456.  
    457.     const-string v6, "No icon ID for slot "
    458.  
    459.     invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    460.  
    461.     move-result-object v5
    462.  
    463.     iget-object v6, p1, Lcom/android/server/status/IconData;->slot:Ljava/lang/String;
    464.  
    465.     invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    466.  
    467.     move-result-object v5
    468.  
    469.     invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    470.  
    471.     move-result-object v5
    472.  
    473.     invoke-static {v8, v5}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;)I
    474.  
    475.     move-object v5, v7
    476.  
    477.     .line 211
    478.     goto :goto_48
    479.  
    480.     .line 201
    481.     :catch_ae
    482.     move-exception v5
    483.  
    484.     move-object v2, v5
    485.  
    486.     .line 202
    487.     .local v2, ex:Landroid/content/pm/PackageManager$NameNotFoundException;
    488.     const-string v5, "StatusBar"
    489.  
    490.     new-instance v5, Ljava/lang/StringBuilder;
    491.  
    492.     invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
    493.  
    494.     const-string v6, "Icon package not found: "
    495.  
    496.     invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    497.  
    498.     move-result-object v5
    499.  
    500.     iget-object v6, p1, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
    501.  
    502.     invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    503.  
    504.     move-result-object v5
    505.  
    506.     invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    507.  
    508.     move-result-object v5
    509.  
    510.     invoke-static {v8, v5, v2}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    511.  
    512.     move-object v5, v7
    513.  
    514.     .line 203
    515.     goto/16 :goto_48
    516.  
    517.     .line 206
    518.     .end local v2           #ex:Landroid/content/pm/PackageManager$NameNotFoundException;
    519.     :cond_cd
    520.     invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
    521.  
    522.     move-result-object v4
    523.  
    524.     goto :goto_8e
    525.  
    526.     .line 215
    527.     :cond_d2
    528.     :try_start_d2
    529.     iget v5, p1, Lcom/android/server/status/IconData;->iconId:I
    530.  
    531.     invoke-virtual {v4, v5}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
    532.     :try_end_d7
    533.     .catch Ljava/lang/RuntimeException; {:try_start_d2 .. :try_end_d7} :catch_da
    534.  
    535.     move-result-object v5
    536.  
    537.     goto/16 :goto_48
    538.  
    539.     .line 216
    540.     :catch_da
    541.     move-exception v5
    542.  
    543.     move-object v1, v5
    544.  
    545.     .line 217
    546.     .local v1, e:Ljava/lang/RuntimeException;
    547.     const-string v5, "StatusBar"
    548.  
    549.     new-instance v5, Ljava/lang/StringBuilder;
    550.  
    551.     invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
    552.  
    553.     const-string v6, "Icon not found in "
    554.  
    555.     invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    556.  
    557.     move-result-object v5
    558.  
    559.     iget-object v6, p1, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
    560.  
    561.     if-eqz v6, :cond_111
    562.  
    563.     iget v6, p1, Lcom/android/server/status/IconData;->iconId:I
    564.  
    565.     invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
    566.  
    567.     move-result-object v6
    568.  
    569.     :goto_f3
    570.     invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    571.  
    572.     move-result-object v5
    573.  
    574.     const-string v6, ": "
    575.  
    576.     invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    577.  
    578.     move-result-object v5
    579.  
    580.     iget v6, p1, Lcom/android/server/status/IconData;->iconId:I
    581.  
    582.     invoke-static {v6}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
    583.  
    584.     move-result-object v6
    585.  
    586.     invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    587.  
    588.     move-result-object v5
    589.  
    590.     invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    591.  
    592.     move-result-object v5
    593.  
    594.     invoke-static {v8, v5}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;)I
    595.  
    596.     move-object v5, v7
    597.  
    598.     .line 222
    599.     goto/16 :goto_48
    600.  
    601.     .line 217
    602.     :cond_111
    603.     const-string v6, "<system>"
    604.  
    605.     goto :goto_f3
    606.  
    607.     .line 180
    608.     .end local v1           #e:Ljava/lang/RuntimeException;
    609.     .end local v4           #r:Landroid/content/res/Resources;
    610.     .restart local v0       #d:Landroid/graphics/drawable/Drawable;
    611.     .restart local v3       #is:Ljava/io/InputStream;
    612.     :catch_114
    613.     move-exception v6
    614.  
    615.     goto/16 :goto_73
    616. .end method
    617.  
    618.  
    619. # virtual methods
    620. .method getNumber()I
    621.     .registers 2
    622.  
    623.     .prologue
    624.     .line 226
    625.     iget-object v0, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    626.  
    627.     iget v0, v0, Lcom/android/server/status/IconData;->number:I
    628.  
    629.     return v0
    630. .end method
    631.  
    632. .method public update(I)V
    633.     .registers 6
    634.     .parameter "number"
    635.  
    636.     .prologue
    637.     const-string v3, ""
    638.  
    639.     .line 140
    640.     iget-object v1, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    641.  
    642.     iget v1, v1, Lcom/android/server/status/IconData;->number:I
    643.  
    644.     if-eq v1, p1, :cond_22
    645.  
    646.     .line 141
    647.     iget-object v0, p0, Lcom/android/server/status/StatusBarIcon;->mNumberView:Landroid/widget/TextView;
    648.  
    649.     .line 142
    650.     .local v0, nv:Landroid/widget/TextView;
    651.     if-lez p1, :cond_27
    652.  
    653.     .line 143
    654.     new-instance v1, Ljava/lang/StringBuilder;
    655.  
    656.     invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
    657.  
    658.     const-string v2, ""
    659.  
    660.     invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    661.  
    662.     move-result-object v1
    663.  
    664.     invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
    665.  
    666.     move-result-object v1
    667.  
    668.     invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    669.  
    670.     move-result-object v1
    671.  
    672.     invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    673.  
    674.     .line 148
    675.     .end local v0           #nv:Landroid/widget/TextView;
    676.     :cond_22
    677.     :goto_22
    678.     iget-object v1, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    679.  
    680.     iput p1, v1, Lcom/android/server/status/IconData;->number:I
    681.  
    682.     .line 149
    683.     return-void
    684.  
    685.     .line 145
    686.     .restart local v0       #nv:Landroid/widget/TextView;
    687.     :cond_27
    688.     const-string v1, ""
    689.  
    690.     invoke-virtual {v0, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    691.  
    692.     goto :goto_22
    693. .end method
    694.  
    695. .method public update(Landroid/content/Context;Lcom/android/server/status/IconData;)V
    696.     .registers 10
    697.     .parameter "context"
    698.     .parameter "data"
    699.     .annotation system Ldalvik/annotation/Throws;
    700.         value = {
    701.             Lcom/android/server/status/StatusBarException;
    702.         }
    703.     .end annotation
    704.  
    705.     .prologue
    706.     const-string v6, ""
    707.  
    708.     .line 99
    709.     iget-object v4, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    710.  
    711.     iget v4, v4, Lcom/android/server/status/IconData;->type:I
    712.  
    713.     iget v5, p2, Lcom/android/server/status/IconData;->type:I
    714.  
    715.     if-eq v4, v5, :cond_12
    716.  
    717.     .line 100
    718.     new-instance v4, Lcom/android/server/status/StatusBarException;
    719.  
    720.     const-string v5, "status bar entry type can\'t change"
    721.  
    722.     invoke-direct {v4, v5}, Lcom/android/server/status/StatusBarException;-><init>(Ljava/lang/String;)V
    723.  
    724.     throw v4
    725.  
    726.     .line 102
    727.     :cond_12
    728.     iget v4, p2, Lcom/android/server/status/IconData;->type:I
    729.  
    730.     packed-switch v4, :pswitch_data_b8
    731.  
    732.     .line 136
    733.     :cond_17
    734.     :goto_17
    735.     iget-object v4, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    736.  
    737.     invoke-virtual {v4, p2}, Lcom/android/server/status/IconData;->copyFrom(Lcom/android/server/status/IconData;)V
    738.  
    739.     .line 137
    740.     return-void
    741.  
    742.     .line 104
    743.     :pswitch_1d
    744.     iget-object v4, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    745.  
    746.     iget-object v4, v4, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
    747.  
    748.     iget-object v5, p2, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
    749.  
    750.     invoke-static {v4, v5}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
    751.  
    752.     move-result v4
    753.  
    754.     if-nez v4, :cond_17
    755.  
    756.     .line 105
    757.     iget-object v2, p0, Lcom/android/server/status/StatusBarIcon;->mTextView:Landroid/widget/TextView;
    758.  
    759.     .line 106
    760.     .local v2, tv:Landroid/widget/TextView;
    761.     iget-object v4, p2, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
    762.  
    763.     invoke-virtual {v2, v4}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    764.  
    765.     goto :goto_17
    766.  
    767.     .line 111
    768.     .end local v2           #tv:Landroid/widget/TextView;
    769.     :pswitch_31
    770.     const/4 v3, 0x0
    771.  
    772.     .line 112
    773.     .local v3, updateIcon:Z
    774.     iget-object v4, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    775.  
    776.     iget-object v4, v4, Lcom/android/server/status/IconData;->iconUri:Landroid/net/Uri;
    777.  
    778.     if-eqz v4, :cond_88
    779.  
    780.     iget-object v4, p2, Lcom/android/server/status/IconData;->iconUri:Landroid/net/Uri;
    781.  
    782.     if-eqz v4, :cond_88
    783.  
    784.     iget-object v4, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    785.  
    786.     iget-object v4, v4, Lcom/android/server/status/IconData;->iconUri:Landroid/net/Uri;
    787.  
    788.     invoke-virtual {v4}, Landroid/net/Uri;->toString()Ljava/lang/String;
    789.  
    790.     move-result-object v4
    791.  
    792.     iget-object v5, p2, Lcom/android/server/status/IconData;->iconUri:Landroid/net/Uri;
    793.  
    794.     invoke-virtual {v5}, Landroid/net/Uri;->toString()Ljava/lang/String;
    795.  
    796.     move-result-object v5
    797.  
    798.     invoke-static {v4, v5}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
    799.  
    800.     move-result v4
    801.  
    802.     if-nez v4, :cond_88
    803.  
    804.     .line 114
    805.     const/4 v3, 0x1
    806.  
    807.     .line 121
    808.     :cond_51
    809.     :goto_51
    810.     if-eqz v3, :cond_61
    811.  
    812.     .line 122
    813.     iget-object v0, p0, Lcom/android/server/status/StatusBarIcon;->mImageView:Lcom/android/server/status/AnimatedImageView;
    814.  
    815.     .line 123
    816.     .local v0, im:Landroid/widget/ImageView;
    817.     invoke-static {p1, p2}, Lcom/android/server/status/StatusBarIcon;->getIcon(Landroid/content/Context;Lcom/android/server/status/IconData;)Landroid/graphics/drawable/Drawable;
    818.  
    819.     move-result-object v4
    820.  
    821.     invoke-virtual {v0, v4}, Lcom/android/server/status/AnimatedImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V
    822.  
    823.     .line 124
    824.     iget v4, p2, Lcom/android/server/status/IconData;->iconLevel:I
    825.  
    826.     invoke-virtual {v0, v4}, Lcom/android/server/status/AnimatedImageView;->setImageLevel(I)V
    827.  
    828.     .line 126
    829.     .end local v0           #im:Landroid/widget/ImageView;
    830.     :cond_61
    831.     iget-object v4, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    832.  
    833.     iget v4, v4, Lcom/android/server/status/IconData;->number:I
    834.  
    835.     iget v5, p2, Lcom/android/server/status/IconData;->number:I
    836.  
    837.     if-eq v4, v5, :cond_17
    838.  
    839.     .line 127
    840.     iget-object v1, p0, Lcom/android/server/status/StatusBarIcon;->mNumberView:Landroid/widget/TextView;
    841.  
    842.     .line 128
    843.     .local v1, nv:Landroid/widget/TextView;
    844.     iget v4, p2, Lcom/android/server/status/IconData;->number:I
    845.  
    846.     if-lez v4, :cond_b0
    847.  
    848.     .line 129
    849.     new-instance v4, Ljava/lang/StringBuilder;
    850.  
    851.     invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
    852.  
    853.     const-string v5, ""
    854.  
    855.     invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    856.  
    857.     move-result-object v4
    858.  
    859.     iget v5, p2, Lcom/android/server/status/IconData;->number:I
    860.  
    861.     invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
    862.  
    863.     move-result-object v4
    864.  
    865.     invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    866.  
    867.     move-result-object v4
    868.  
    869.     invoke-virtual {v1, v4}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    870.  
    871.     goto :goto_17
    872.  
    873.     .line 115
    874.     .end local v1           #nv:Landroid/widget/TextView;
    875.     :cond_88
    876.     iget-object v4, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    877.  
    878.     iget-object v4, v4, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
    879.  
    880.     if-eqz v4, :cond_9e
    881.  
    882.     iget-object v4, p2, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
    883.  
    884.     if-eqz v4, :cond_9e
    885.  
    886.     iget-object v4, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    887.  
    888.     iget-object v4, v4, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
    889.  
    890.     iget-object v5, p2, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
    891.  
    892.     invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
    893.  
    894.     move-result v4
    895.  
    896.     if-eqz v4, :cond_ae
    897.  
    898.     :cond_9e
    899.     iget-object v4, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    900.  
    901.     iget v4, v4, Lcom/android/server/status/IconData;->iconId:I
    902.  
    903.     iget v5, p2, Lcom/android/server/status/IconData;->iconId:I
    904.  
    905.     if-ne v4, v5, :cond_ae
    906.  
    907.     iget-object v4, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
    908.  
    909.     iget v4, v4, Lcom/android/server/status/IconData;->iconLevel:I
    910.  
    911.     iget v5, p2, Lcom/android/server/status/IconData;->iconLevel:I
    912.  
    913.     if-eq v4, v5, :cond_51
    914.  
    915.     .line 119
    916.     :cond_ae
    917.     const/4 v3, 0x1
    918.  
    919.     goto :goto_51
    920.  
    921.     .line 131
    922.     .restart local v1       #nv:Landroid/widget/TextView;
    923.     :cond_b0
    924.     const-string v4, ""
    925.  
    926.     invoke-virtual {v1, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
    927.  
    928.     goto/16 :goto_17
    929.  
    930.     .line 102
    931.     nop
    932.  
    933.     :pswitch_data_b8
    934.     .packed-switch 0x1
    935.         :pswitch_1d
    936.         :pswitch_31
    937.     .end packed-switch
    938. .end method
    939.  
    I tried to take the easy way out and just use xUltimate, but it keeps kicking back the error message: "Dont patch files that have already been modded!" It will, however, change the clock color with no problems at all. I'm not sure why that would happen.

    Any ideas?
     

    Advertisement
  2. Fadelight

    Fadelight Well-Known Member This Topic's Starter

    Joined:
    Oct 29, 2009
    Messages:
    1,393
    Likes Received:
    95
    Looks like I owe Fab a beer! Thank's for the point in the right direction!

    [​IMG]
     
  3. Airmaxx23

    Airmaxx23 Well-Known Member

    Joined:
    Jun 21, 2010
    Messages:
    3,142
    Likes Received:
    1,039
    Nice, so how did you go about doing it? It's something I wouldn't mind doing also.
     
  4. Fadelight

    Fadelight Well-Known Member This Topic's Starter

    Joined:
    Oct 29, 2009
    Messages:
    1,393
    Likes Received:
    95
    Decompile services.jar, edit StatusBarPolicy.smali, then recompile everything.


    If there is enough interest, I could do a writeup... but it sounded like Fab was interested in making this an option for his themes, so you may want to hold off and see where he goes with that.
     
  5. eraursls1984

    eraursls1984 Well-Known Member

    Joined:
    Sep 7, 2010
    Messages:
    800
    Likes Received:
    76
    I vote for a how to write up
     
  6. Fabolous

    Fabolous Superuser VIP Member

    Joined:
    Nov 7, 2009
    Messages:
    3,635
    Likes Received:
    2,126
  7. binary visions

    binary visions Well-Known Member

    Joined:
    May 14, 2010
    Messages:
    3,334
    Likes Received:
    1,443
    Hmm.. Is there a way to just hide the AM/PM? Always felt like it'd be better to have room for another icon instead of assuming I can't figure out the time to the nearest 12 hours ;)

    edit: read further into the thread, looks like it's not easily done. I switched it to 24 hour mode but would still rather have the standard time without the am/pm.
     
  8. Airmaxx23

    Airmaxx23 Well-Known Member

    Joined:
    Jun 21, 2010
    Messages:
    3,142
    Likes Received:
    1,039
  9. Fadelight

    Fadelight Well-Known Member This Topic's Starter

    Joined:
    Oct 29, 2009
    Messages:
    1,393
    Likes Received:
    95

Share This Page

Loading...