[Sony Xperia P, U, Sola, Go] neectron:
[How-To]Removing Battery Percentage and Adding Toggles to Statusbar​

Adding/porting toggles to Statusbar.

Decompile SystemUI.apk

Copy both folders from lidroid.zip to /systemui/smali.

Copy icons from the quickpanel-icons.zip to /systemui/res/drawable-hdpi.

Copy 3 xmls from power.zip to /systemui/res/layout.

Copy arrays.xml to /systemui/res/values.

Resource modifications:​

Edit "systemui\res\values\ids.xml" and add these Id:

<item type="id" name="power_widget_button_image">false</item>
<item type="id" name="power_widget_button_text">false</item>
<item type="id" name="power_widget_button_indic">false</item>
<item type="id" name="power_widget_button">false</item>

Edit "systemui\res\values\strings.xml" and add these strings:

<string name="quickpanel_sound_text">Sound</string>
<string name="quickpanel_sound_vibration_text">Sound</string>
<string name="quickpanel_silent_text">Silent</string>
<string name="quickpanel_vibration_text">Vibration</string>
<string name="quickpanel_rotation_text">Rotation</string>
<string name="quickpanel_bluetooth_text">Bluetooth</string>
<string name="quickpanel_gps_text">GPS</string>
<string name="quickpanel_autosync_text">Auto Sync</string>
<string name="quickpanel_brightness_text">Brightness</string>
<string name="quickpanel_screen_timeout_text">Timeout</string>
<string name="quickpanel_lockscreen_text">Lockscreen</string>
<string name="quickpanel_airplane_text">Flight</string>
<string name="quickpanel_flashlight_text">Flashlight</string>
<string name="quickpanel_reboot_text">Reboot</string>
<string name="quickpanel_shutdown_text">Shutdown</string>
<string name="airplane_mode">In Flight mode</string>
<string name="shutdown_confirm">Your phone will shut down.</string>
<string name="screen_timeout_seconds">Screen timeout set to: %d second(s)</string>
<string name="screen_timeout_minutes">Screen timeout set to: %d minute(s)</string>
<string name="screen_timeout_hours">Screen timeout set to: %d hour(s)</string>
<string name="hamster">Phone Options</string>
<string name="yes">OK</string>
<string name="no">Cancel</string>
<string name="reboot">Reboot</string>
<string name="reboot_recovery">Recovery</string>
<string name="quickpanel_dc_text">Data</string>
<string name="reboot_download">Download</string>
<string name="quickpanel_network_mode_text">Network</string>
<string name="quickpanel_wifi_text">WiFi</string>

Edit "systemui\res\values\public.xml" and add these:

Add after the last drawable declared:

<public type="drawable" name="stat_2g3g_off" id="0x7f0200e1" />
<public type="drawable" name="stat_2g3g_on" id="0x7f0200e2" />
<public type="drawable" name="stat_3g_on" id="0x7f0200e3" />
<public type="drawable" name="stat_airplane_off" id="0x7f0200e4" />
<public type="drawable" name="stat_airplane_on" id="0x7f0200e5" />
<public type="drawable" name="stat_bg_ing" id="0x7f0200e6" />
<public type="drawable" name="stat_bg_off" id="0x7f0200e7" />
<public type="drawable" name="stat_bg_on" id="0x7f0200e8" />
<public type="drawable" name="stat_bluetooth_off" id="0x7f0200e9" />
<public type="drawable" name="stat_bluetooth_on" id="0x7f0200ea" />
<public type="drawable" name="stat_brightness_auto" id="0x7f0200eb" />
<public type="drawable" name="stat_brightness_mid" id="0x7f0200ec" />
<public type="drawable" name="stat_brightness_off" id="0x7f0200ed" />
<public type="drawable" name="stat_brightness_on" id="0x7f0200ee" />
<public type="drawable" name="stat_data_off" id="0x7f0200ef" />
<public type="drawable" name="stat_data_on" id="0x7f0200f0" />
<public type="drawable" name="stat_flashlight_off" id="0x7f0200f1" />
<public type="drawable" name="stat_flashlight_on" id="0x7f0200f2" />
<public type="drawable" name="stat_gps_off" id="0x7f0200f3" />
<public type="drawable" name="stat_gps_on" id="0x7f0200f4" />
<public type="drawable" name="stat_lock_screen_off" id="0x7f0200f5" />
<public type="drawable" name="stat_lock_screen_on" id="0x7f0200f6" />
<public type="drawable" name="stat_wifi_on" id="0x7f0200f7" />
<public type="drawable" name="stat_orientation_off" id="0x7f0200f8" />
<public type="drawable" name="stat_orientation_on" id="0x7f0200f9" />
<public type="drawable" name="stat_reboot" id="0x7f0200fc" />
<public type="drawable" name="stat_ring_on" id="0x7f0200fd" />
<public type="drawable" name="stat_ring_vibrate_on" id="0x7f0200fe" />
<public type="drawable" name="stat_screen_timeout_10m" id="0x7f0200ff" />
<public type="drawable" name="stat_screen_timeout_15s" id="0x7f020100" />
<public type="drawable" name="stat_screen_timeout_1m" id="0x7f020101" />
<public type="drawable" name="stat_screen_timeout_2m" id="0x7f020102" />
<public type="drawable" name="stat_screen_timeout_30s" id="0x7f020103" />
<public type="drawable" name="stat_screen_timeout_off" id="0x7f020104" />
<public type="drawable" name="stat_screen_timeout_on" id="0x7f020105" />
<public type="drawable" name="stat_screen_timeout_unknown" id="0x7f020106" />
<public type="drawable" name="stat_shutdown" id="0x7f020107" />
<public type="drawable" name="stat_silent" id="0x7f020108" />
<public type="drawable" name="stat_sync_off" id="0x7f020109" />
<public type="drawable" name="stat_sync_on" id="0x7f02010a" />
<public type="drawable" name="stat_vibrate_off" id="0x7f02010b" />
<public type="drawable" name="stat_wifi_off" id="0x7f02010c" />

Add after the last layout declared:

<public type="layout" name="power_widget_button" id="0x7f03001b" />
<public type="layout" name="power_widget_layout" id="0x7f03001c" />
<public type="layout" name="power_widget_scrollview" id="0x7f03001d" />

Add after the last string declared:

<public type="string" name="quickpanel_sound_text" id="0x7f08007f" />
<public type="string" name="quickpanel_sound_vibration_text" id="0x7f080080" />
<public type="string" name="quickpanel_silent_text" id="0x7f080081" />
<public type="string" name="quickpanel_vibration_text" id="0x7f080082" />
<public type="string" name="quickpanel_rotation_text" id="0x7f080083" />
<public type="string" name="quickpanel_bluetooth_text" id="0x7f080084" />
<public type="string" name="quickpanel_gps_text" id="0x7f080085" />
<public type="string" name="quickpanel_autosync_text" id="0x7f080086" />
<public type="string" name="quickpanel_brightness_text" id="0x7f080087" />
<public type="string" name="quickpanel_screen_timeout_text" id="0x7f080088" />
<public type="string" name="quickpanel_lockscreen_text" id="0x7f080089" />
<public type="string" name="quickpanel_airplane_text" id="0x7f08008a" />
<public type="string" name="quickpanel_flashlight_text" id="0x7f08008b" />
<public type="string" name="quickpanel_reboot_text" id="0x7f08008c" />
<public type="string" name="quickpanel_shutdown_text" id="0x7f08008d" />
<public type="string" name="airplane_mode" id="0x7f08008e" />
<public type="string" name="shutdown_confirm" id="0x7f08008f" />
<public type="string" name="screen_timeout_seconds" id="0x7f080090" />
<public type="string" name="screen_timeout_minutes" id="0x7f080091" />
<public type="string" name="screen_timeout_hours" id="0x7f080092" />
<public type="string" name="hamster" id="0x7f080093" />
<public type="string" name="yes" id="0x7f080094" />
<public type="string" name="no" id="0x7f080095" />
<public type="string" name="reboot" id="0x7f080096" />

Add after the last id decalred:

<public type="id" name="power_widget_button_image" id="0x7f0e0094" />
<public type="id" name="power_widget_button_text" id="0x7f0e0095" />
<public type="id" name="power_widget_button_indic" id="0x7f0e0096" />
<public type="id" name="power_widget_button" id="0x7f0e0097" />
<public type="array" name="config_cdmaDbmThresholds" id="0x7f0f0000" />
<public type="array" name="config_cdmaEcioThresholds" id="0x7f0f0001" />
<public type="array" name="config_evdoDbmThresholds" id="0x7f0f0002" />
<public type="array" name="config_evdoSnrThresholds" id="0x7f0f0003" />
<public type="array" name="shutdown_reboot_options" id="0x7f0f0004" />
<public type="array" name="shutdown_reboot_actions" id="0x7f0f0005" />

Smali modifications:​

Edit "systemui\smali\com\android\systemui\statusbar \phone\PhoneStatusBar.smali" and make these changes :

Add the only lines prefixed by ++;

invoke-virtual {v0, v9, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

++ const v6, 0x7f03001c

++ invoke-static {v0, v6, v11}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

++ move-result-object v5

++ check-cast v5, Lcom/lidroid/systemui/quickpanel/PowerWidget;

++ invoke-virtual {v5}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V

++ iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedView:Lcom/android/systemui/statusbar/phone/ExpandedView;

++ invoke-virtual {v6, v5, v11}, Lcom/android/systemui/statusbar/phone/ExpandedView;->addView(Landroid/view/View;I)V

return-object v4

Compile SystemUI.apk.

Copy Meta-Inf and AndroidManifest.xml from stock SystemUI.apk to your modded one.

That's it.

Waring:If the variables you are going to add to public.xml is already used,then you will have edit more smali.

Like if variable for "stat_data_on ": 0x7f0200f0 is already used,then you have to change it to 0x7f02xxxx,not used.

Then you have edit systemui\smali\com\lidroid\systemui\quickpanel\MobileDataButton.smali.

Find 0x7f0200f0 and change it to new 0x7f02xxxx you have addedin public.xml.Similarly for other variables also,if it is used change the respective .smali

Credit:I have used resources from this thread

**********************************************************************************************************************************************************************

Removing Battery Percentage from Statusbar​

Decompile SystemUI.apk

Open systemui/res/layout/status_bar.xml.

Find the line :

<TextView android:layout_gravity="left|center" android:id="@id/battery_text" android: paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_settings_settings_button" android:singleLine="true" style="@style/StatusBarNotificationText" />

Change that line to:

<TextView android:layout_gravity="left|center" android:id="@id/battery_text" android: paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_settings_settings_button" android:singleLine="true" [B]android:visibility="gone"[/B] style="@style/StatusBarNotificationText" />

Save the file.

Compile SystemUI.apk

Copy Meta-Inf and AndroidManifest.xml from stock SystemUI.apk to your modded one.

That's it.

Then copy it to /system,set permissions to -rw-r-r.

Then copy it to /system/app.

Reboot the phone.

Credit:Thanks to pvyParts for the tip.

Download:SystemUI w/o battery percentage[U/Sola]

***********************************************************************************************************************************************

Battery Mod

1% Battery Mod​