[Desire HD Android Development] Sybregunne:
Still no APM... I am looking at GlobalActions.smali line 530 seems to be where the power menu gets created. from here I don't know how to proceed. :D

edit: I take it back, the dialogue gets created at line

688 .local v8, ab:Lcom/htc/widget/HtcAlertDialog$Builder;

.local v8, ab:Lcom/htc/widget/HtcAlertDialog$Builder;
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->isSense2Mode()Z

move-result v0

if-eqz v0, :cond_3

.line 518
const v10, 0x20c00c9

.line 523
.local v10, idTitle:I
:goto_1
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAdapter:Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;

invoke-virtual {v8, v0, p0}, Lcom/htc/widget/HtcAlertDialog$Builder;->setAdapter(Landroid/widget/ListAdapter;Landroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;

move-result-object v0

const/4 v1, 0x1

invoke-virtual {v0, v1}, Lcom/htc/widget/HtcAlertDialog$Builder;->setInverseBackgroundForced(Z)Lcom/htc/widget/HtcAlertDialog$Builder;

move-result-object v0

invoke-virtual {v0, v10}, Lcom/htc/widget/HtcAlertDialog$Builder;->setTitle(I)Lcom/htc/widget/HtcAlertDialog$Builder;

.line 527
invoke-virtual {v8}, Lcom/htc/widget/HtcAlertDialog$Builder;->create()Lcom/htc/widget/HtcAlertDialog;

move-result-object v9

.line 529
.local v9, dialog:Lcom/htc/widget/HtcAlertDialog;
invoke-virtual {v9}, Lcom/htc/widget/HtcAlertDialog;->getWindow()Landroid/view/Window;

move-result-object v0

const/16 v1, 0x7d8

invoke-virtual {v0, v1}, Landroid/view/Window;->setType(I)V

.line 530
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;

invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

move-result-object v0

const v1, 0x10d0001

invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getBoolean(I)Z

move-result v0

if-nez v0, :cond_0

.line 532
invoke-virtual {v9}, Lcom/htc/widget/HtcAlertDialog;->getWindow()Landroid/view/Window;

move-result-object v0

const/4 v1, 0x4

const/4 v2, 0x4

invoke-virtual {v0, v1, v2}, Landroid/view/Window;->setFlags(II)V

.line 536
:cond_0
invoke-virtual {v9, p0}, Lcom/htc/widget/HtcAlertDialog;->setOnDismissListener(Landroid/content/DialogInterface$OnDismissListener;)V

.line 538
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->isSense2Mode()Z

move-result v0

if-eqz v0, :cond_1

.line 539
invoke-virtual {v9, p0}, Lcom/htc/widget/HtcAlertDialog;->setOnKeyListener(Landroid/content/DialogInterface$OnKeyListener;)V

.line 542
:cond_1
return-object v9

.line 455
.end local v8 #ab:Lcom/htc/widget/HtcAlertDialog$Builder;
.end local v9 #dialog:Lcom/htc/widget/HtcAlertDialog;
.end local v10 #idTitle:I
:cond_2
const/4 v0, 0x4

new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;

const/4 v1, 0x0

new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$8;

const v3, 0x2080069

const v4, 0x104015c

invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

aput-object v2, v0, v1

const/4 v1, 0x1

iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

aput-object v2, v0, v1

const/4 v1, 0x2

iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mVibrationModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

aput-object v2, v0, v1

const/4 v1, 0x3

iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

aput-object v2, v0, v1

invoke-static {v0}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;

move-result-object v0

iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

goto :goto_0

.line 520
.restart local v8 #ab:Lcom/htc/widget/HtcAlertDialog$Builder;
:cond_3
const v10, 0x104015a

.restart local v10 #idTitle:I
goto :goto_1

actually this is the whole portion responsible for showing the power off, Airplane Mode and Restart dialogue box. So how to add the APM ?