[Q] Adding a Status Bar signal option to Settings.apk
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 SignalClusterAlwaysView.java 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;
Added (changed STYLE_HIDDEN to 3) in SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java.
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 SignalClusterView.java,
!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 StatusBar.java 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 SignalClusterAlwaysView.java in SystemUI.
What am I missing? Is there an easier way to do this?
Sorry if this is in the wrong thread.