[Galaxy S6 General] daxgirl:
So... I see no daring people, huh?

Ok, so lets see...

Status bar carrier text with toggling visibility

First, you follow this guide by [MENTION=5204709]Adi Aisiteru Reborn[/MENTION] (the amazing!)

For samsung devices you will have to add the line in status_bar.xml like so (blue) (well as long as you add it inside a linear layout with horizontal orientation BEFORE the more):

<com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:orientation="horizontal" android:id="@id/notification_icon_area" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
<com.android.keyguard.AlphaOptimizedLinearLayout android:id="@id/notification_icon_area_inner" android:layout_width="fill_parent" android:layout_height="fill_parent">
[COLOR="Blue"]<com.android.systemui.statusbar.phone.CarrierLabel android:id="@id/adi_carrier_label" android:textAppearance="@style/TextAppearance.StatusBar.Clock" android:gravity="left|center" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />[/COLOR]
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentStart="true" />
</com.android.keyguard.AlphaOptimizedLinearLayout>
</com.android.systemui.statusbar.AlphaOptimizedFrameLayout>

Note! I gave it an id! we need to go to ids and add it in ids.xml!!!!

You do not need to recompile and decompile to get the number! The method I build uses id name and not id number. What's important is if you change the id text (really no need), then you change it in the method below!!! Or you will get one beautiful FC in your face.

Now to the fun part... sssmmmmmaaallliiiiiii

Open com/android/systemui/statusbar/phone and drop the 2 smalis from Adi there for Carrier text view

Look for #virtual methods and add right after it a method I wrote like so:

# virtual methods

[COLOR="blue"].method setCarrierTextVisibility()V
.registers 7

.prologue
const/4 v1, 0x0

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

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

move-result-object v2

const-string v3, "adi_carrier_label"

const-string v4, "id"

iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

invoke-virtual {v5}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

move-result-object v5

invoke-virtual {v2, v3, v4, v5}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

move-result v0

.line 34
.local v0, "id":I
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

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

move-result-object v2

const-string v3, "dax_sb_carrier_label"

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

move-result v2

const/4 v3, 0x1

if-ne v2, v3, :cond_2e

.line 35
.local v1, "visibility":I
:goto_24
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

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

move-result-object v2

invoke-virtual {v2, v1}, Landroid/view/View;->setVisibility(I)V

.line 36
return-void

.line 34
.end local v1 # "visibility":I
:cond_2e
const/16 v1, 0x8

goto :goto_24
.end method[/COLOR]

Now we go to my favourite method (there is like no method longer than this one in the history of java I think, [MENTION=5493353]Wuby986[/MENTION] also loves it ALOT) .method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

Now here is the tricky part... we need to invoke our method BEFORE this method returns the object. So any place before return-object v4 (or whatever register it is assigned to).

For landmarking, lets drop it in the middle of all other invocations...... like so:

iget-object v8, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryTextObserver:Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;

invoke-virtual {v4, v5, v6, v8}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

move-object/from16 v0, p0

iget-object v4, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryTextObserver:Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;

const/4 v5, 0x0

invoke-virtual {v4, v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;->onChange(Z)V

[COLOR="blue"]move-object/from16 v0, p0

invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setCarrierTextVisibility()V[/COLOR]

new-instance v7, Landroid/content/IntentFilter;

invoke-direct {v7}, Landroid/content/IntentFilter;-><init>()V

const-string v4, "android.intent.action.CLOSE_SYSTEM_DIALOGS"

Done... recompile and enjoy.

Rom control part for anyone who needs:

<SwitchPreference
android:defaultValue="true"
android:key="dax_sb_carrier_label"
android:summaryOff="Carrier text hidden"
android:summaryOn="Carrier text shown"
android:title="Carrier text visibility"/>

If tyou need changes to apply on the fly, you need to figure out the observer. We do it in a different way than in [MENTION=1042140]tdunham[/MENTION] observer guide. So I won't bother you with confusions.