[Hero CDMA Q&A, Help & Troubleshooting] evilvoice:
I have been looking at this mod for the past 2 days and cant seem to figure out where the problem lies. I edit Settings.apk correctly and the options show correctly, the problem is that all right-side icons disappear from the status bar when "Do not display AM/PM" is unchecked. To give a little background, the mod consists of 2 mods actually - hide clock altogether and hide am/pm from the clock. The hide/unhide clock option works and the hide am/pm option works, but the show am/pm option does not work. It actually has to do with the editing of services.jar. Through testing 3 different versions, I found that the method to hide am/pm without an option of turning it on/off worked perfectly, it is only when adding the method to use the checkbox under settings that it gets borked.

These are the threads:

Method trying to implement: here

Method that worked originally but without a way to turn on/off: here

Original method that inspired the previous 2: here

This is the code that does not seem to work, if anyone has any ideas as to how to fix this, please let me know. Again, the method for hiding is fine, its the method for showing that does not work

.method private final updateClock()V
.locals 7

.prologue
.line 940
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mCalendar:Ljava/util/Calendar;

invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

move-result-wide v1

invoke-virtual {v0, v1, v2}, Ljava/util/Calendar;->setTimeInMillis(J)V

.line 941
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;

iget-object v1, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;

invoke-static {v1}, Landroid/text/format/DateFormat;->getTimeFormat(Landroid/content/Context;)Ljava/text/DateFormat;

move-result-object v1

iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mCalendar:Ljava/util/Calendar;

invoke-virtual {v2}, Ljava/util/Calendar;->getTime()Ljava/util/Date;

move-result-object v2

invoke-virtual {v1, v2}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;

move-result-object v1

iget-object v4, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;

invoke-virtual {v4}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v4

const-string v2, "am_pm"

const/4 v3, 0x0

invoke-static {v4, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v4

if-eqz v4, :cond_1

const-string v5, " PM"

const-string v6, ""

invoke-virtual {v1, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

move-result-object v1

const-string v5, " AM"

const-string v6, ""

invoke-virtual {v1, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

move-result-object v1

:goto_0
iget-object v4, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;

invoke-virtual {v4}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v4

const-string v2, "time_display"

const/4 v3, 0x1

invoke-static {v4, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v4

if-nez v4, :cond_0

const-string v1, ""

:cond_0
iput-object v1, v0, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;

.line 942
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mService:Lcom/android/server/status/StatusBarService;

iget-object v1, p0, Lcom/android/server/status/StatusBarPolicy;->mClockIcon:Landroid/os/IBinder;

iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;

const/4 v3, 0x0

invoke-virtual {v0, v1, v2, v3}, Lcom/android/server/status/StatusBarService;->updateIcon(Landroid/os/IBinder;Lcom/android/server/status/IconData;Lcom/android/server/status/NotificationData;)V

.line 943
return-void

:cond_1
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;

invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->getSmallTime()Ljava/lang/CharSequence;

move-result-object v1

goto :goto_0
.end method

This is actually what our StatusBarPolicy.smali SHOULD look like - the original mod is for the EVO and possibly 2,2 also, and I am trying to use it on 2,1

.method private final updateClock()V
.locals 7

.prologue
.line 849
const-string v0, "persist.sys.timezone"

invoke-static {v0}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

invoke-static {v0}, Ljava/util/TimeZone;->getTimeZone(Ljava/lang/String;)Ljava/util/TimeZone;

move-result-object v0

invoke-static {v0}, Ljava/util/Calendar;->getInstance(Ljava/util/TimeZone;)Ljava/util/Calendar;

move-result-object v0

iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mCalendar:Ljava/util/Calendar;

invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

move-result-wide v1

invoke-virtual {v0, v1, v2}, Ljava/util/Calendar;->setTimeInMillis(J)V

.line 941
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;

iget-object v1, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;

invoke-static {v1}, Landroid/text/format/DateFormat;->getTimeFormat(Landroid/content/Context;)Ljava/text/DateFormat;

move-result-object v1

iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mCalendar:Ljava/util/Calendar;

invoke-virtual {v2}, Ljava/util/Calendar;->getTime()Ljava/util/Date;

move-result-object v2

invoke-virtual {v1, v2}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;

move-result-object v1

iget-object v4, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;

invoke-virtual {v4}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v4

const-string v2, "am_pm"

const/4 v3, 0x0

invoke-static {v4, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v4

if-eqz v4, :cond_1

const-string v5, " PM"

const-string v6, ""

invoke-virtual {v1, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

move-result-object v1

const-string v5, " AM"

const-string v6, ""

invoke-virtual {v1, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

move-result-object v1

:goto_0
iget-object v4, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;

invoke-virtual {v4}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v4

const-string v2, "time_display"

const/4 v3, 0x1

invoke-static {v4, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v4

if-nez v4, :cond_0

const-string v1, ""

:cond_0
iput-object v1, v0, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;

.line 942
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mService:Lcom/android/server/status/StatusBarService;

iget-object v1, p0, Lcom/android/server/status/StatusBarPolicy;->mClockIcon:Landroid/os/IBinder;

iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;

const/4 v3, 0x0

invoke-virtual {v0, v1, v2, v3}, Lcom/android/server/status/StatusBarService;->updateIcon(Landroid/os/IBinder;Lcom/android/server/status/IconData;Lcom/android/server/status/NotificationData;)V

.line 943
return-void

:cond_1
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;

invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->getSmallTime()Ljava/lang/CharSequence;

move-result-object v1

goto :goto_0
.end method

Thanks to JsChiSurf for creating this awesome mod