[Q] Adding a Status Bar signal option to Settings.apk

200 posts
Thanks Meter: 120
By gakio12, Senior Member on 17th February 2014, 09:07 AM
Post Reply Subscribe to Thread Email Thread
I hope this is the correct forum

I am doing this to Cyanogenmod 11.

I want to add an option to Settings > Interface > Status Bar > Signal Status Style. I am so close to having it done, but there is one thing I am missing, and that is actually getting the radio button to switch the Icon to the correct .java. Here is what I have done so far:

Added to Setting/res/values/cm_strings.xml;
<string name="status_bar_signal_style_always">Always show type</string>
Added two lines to Settings/res/values/cm_arrays.xml;(marked with *'s)
<string-array name="entries_status_bar_signal" translatable="false">

    <string-array name="values_status_bar_signal" translatable="false">
Created a new java file named in SystemUI/src/com/android/systemui/statusbar and signal_cluster_always_view.xml in SystemUI/res/layout, respectively;

Added to SystemUI/res/layout/status_bar.xml;
<include layout="@layout/signal_cluster_always_view"
Added (changed STYLE_HIDDEN to 3) in SystemUI/src/com/android/systemui/statusbar/
public static final int STYLE_ALWAYS = 2;
Really all I am trying to do is create a setting to show network type even while WiFi is connected. This is accomplished by simply clearing this line from,
                !mWifiVisible ? View.VISIBLE : View.GONE);
and changing android:layout_marginEnd to 3dip in signal_cluster_view.xml.

I can't seem to figure out how the existing setting for a text only network icon sends that to SystemUI. I've explored in the Settings.apk source, and I think the issue may be in this line,
int signalStyle = Settings.System.getInt(resolver, Settings.System.STATUS_BAR_SIGNAL_TEXT, 0);
where it is setting the value of the option selected to Settings.System.STATUS_BAR_SIGNAL_TEXT. I think it is properly setting the value to 2, like I want, but it still sees 2 as HIDDEN instead of ALWAYS; or that it does see I want ALWAYS, but doesn't know to refer to in SystemUI.

What am I missing? Is there an easier way to do this?

Sorry if this is in the wrong thread.
17th February 2014, 09:55 PM |#2  
gakio12's Avatar
OP Senior Member
Thanks Meter: 120
Donate to Me
I just checked, and yes, the value of STATUS_BAR_SIGNAL is changing to my intended values. My one missing link is defining what those values do.

Where is the file that contains the value assignments? i.e. STATUS_BAR_SIGNAL = 1 starts in systemui, while 2 and 3 don't do anything. I don't care about 3, just need to make 2 start (or that process, obviously it isn't .java once compiled).
19th February 2014, 02:10 PM |#3  
gakio12's Avatar
OP Senior Member
Thanks Meter: 120
Donate to Me
I answered my own question here:
Post Reply Subscribe to Thread

cyanogenmod, option, settings, source, systemui

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes