[Samsung Galaxy W I8150] NuriJ:
How to make "Me" button

usable

;

Open \com\android\systemui\statusbar\phone\

PhoneStatusBar.smali

Add these fields:

.field mQuickPanelUserButton:Landroid/view/View;

.field private mQuickPanelUserButtonListener:Landroid/view/View$OnClickListener;

.field private mQuickPanelUserButtonLongListener:Landroid/view/View$OnLongClickListener;

Find this line:

invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setQuickPanelUserButtonInfo()V

Just below, insert:

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

const v5, [COLOR="RoyalBlue"]0x7f0c00b9[/COLOR]

invoke-virtual {v0, v5}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object v0

iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQuickPanelUserButton:Landroid/view/View;

.line 191
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQuickPanelUserButton:Landroid/view/View;

iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQuickPanelUserButtonListener:Landroid/view/View$OnClickListener;

invoke-virtual {v0, v5}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

.line 192
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQuickPanelUserButton:Landroid/view/View;

iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQuickPanelUserButtonLongListener:Landroid/view/View$OnLongClickListener;

invoke-virtual {v0, v5}, Landroid/view/View;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V

The blue ID number must match "user_button" in public.xml

Search for ".method public start()V"

Insert below that method:

.method public startMeProfileContact(Z)V
.locals 8
.parameter "startEditing"

.prologue
const/4 v3, 0x0

.line 43
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

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

move-result-object v0

sget-object v1, Landroid/provider/ContactsContract$Profile;->CONTENT_URI:Landroid/net/Uri;

const/4 v2, 0x1

new-array v2, v2, [Ljava/lang/String;

const/4 v4, 0x0

const-string v5, "_id"

aput-object v5, v2, v4

move-object v4, v3

move-object v5, v3

invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

move-result-object v6

.line 44
.local v6, cursor:Landroid/database/Cursor;
if-eqz v6, :cond_1

.line 48
:try_start_0
invoke-interface {v6}, Landroid/database/Cursor;->moveToFirst()Z

move-result v0

if-eqz v0, :cond_0

.line 50
sget-object v0, Landroid/provider/ContactsContract$Contacts;->CONTENT_URI:Landroid/net/Uri;

const-string v1, "_id"

invoke-interface {v6, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

move-result v1

invoke-interface {v6, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

move-result-object v1

invoke-static {v0, v1}, Landroid/net/Uri;->withAppendedPath(Landroid/net/Uri;Ljava/lang/String;)Landroid/net/Uri;

move-result-object v7

.line 51
.local v7, uriMe:Landroid/net/Uri;
if-eqz p1, :cond_2

.line 53
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

new-instance v1, Landroid/content/Intent;

const-string v2, "android.intent.action.EDIT"

invoke-direct {v1, v2, v7}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

const/high16 v2, 0x1000

invoke-virtual {v1, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

move-result-object v1

invoke-virtual {v0, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0

.line 64
.end local v7 #uriMe:Landroid/net/Uri;
:cond_0
:goto_0
invoke-interface {v6}, Landroid/database/Cursor;->close()V

.line 68
:cond_1
return-void

.line 57
.restart local v7 #uriMe:Landroid/net/Uri;
:cond_2
:try_start_1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

new-instance v1, Landroid/content/Intent;

const-string v2, "android.intent.action.VIEW"

invoke-direct {v1, v2, v7}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

const/high16 v2, 0x1000

invoke-virtual {v1, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

move-result-object v1

invoke-virtual {v0, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0

goto :goto_0

.line 62
.end local v7 #uriMe:Landroid/net/Uri;
:catchall_0
move-exception v0

.line 64
invoke-interface {v6}, Landroid/database/Cursor;->close()V

.line 66
throw v0
.end method

Extract View attachment user_button.zip and let the PhoneStatusBar$XX numbers match your files. Place it in \com\android\systemui\statusbar\phone\

Define them in PhoneStatusbar.smali; Add this is the end of .method public constructor <init>()V and match the blue code

new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$[COLOR="RoyalBlue"]42[/COLOR];

invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$[COLOR="RoyalBlue"]42[/COLOR];-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V

iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQuickPanelUserButtonListener:Landroid/view/View$OnClickListener;

new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$[COLOR="RoyalBlue"]43[/COLOR];

invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$[COLOR="RoyalBlue"]43[/COLOR];-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V

iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQuickPanelUserButtonLongListener:Landroid/view/View$OnLongClickListener;

Enjoy usable Me Profile button.. :)

Single press should show "Me" contact

Long press should edit "Me" contact