FORUMS
Remove All Ads from XDA

[MOD][GUIDE]Add CPU usage in notification panel

521 posts
Thanks Meter: 630
 
By meawww, Senior Member on 7th May 2014, 04:39 PM
Post Reply Email Thread
I never seen any guide how to add the cpu usage into notification panel to this is a guide how to do it!

Files need modification
Smali
\SystemUI\smali\com\android\systemui\statusbar\pol icy

XML's
status_bar_expanded_header.xml
id.xml
strings.xml
public.xml


1: Decompile the SystemUI.apk using apktool.
2: Now download the cpu_smali attachment and put the smalis inside the folder \SystemUI\smali\com\android\systemui\statusbar\pol icy
3: Open the file \SystemUI\res\values\id.xml and scroll down at the bottom and add these lines

Code:
<item type="id" name="cpu">false</item>
<item type="id" name="sys_id">false</item>
4: Open the file \SystemUI\res\values\strings.xml and scroll down at the bottom and add these lines

Code:
<string name="cpu_idle">idle</string>
<string name="cpu_text">CPU Usage</string>
5: Open the file \SystemUI\res\layout\status_bar_expanded_header.xm l and look for the line

Code:
<com.android.systemui.statusbar.policy.ClockStock android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock" android:textColor="@color/notification_header_clock_color" android:gravity="bottom" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/notification_panel_header_clock_margin_left" android:singleLine="true" systemui:ampmSmall="true" />
<com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date" android:textColor="@color/notification_header_date_color" android:gravity="bottom" android:id="@id/date" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_header_date_margin_left" android:layout_marginRight="@dimen/notification_panel_header_date_margin_right" android:layout_marginBottom="@dimen/notification_panel_header_date_margin_bottom" android:layout_toEndOf="@id/clock" />
Now we gonna comment out these codes just incase u want the date and clock back in the future so we need to do is replace with these codes

Code:
<!--
<com.android.systemui.statusbar.policy.ClockStock android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock" android:textColor="@color/notification_header_clock_color" android:gravity="bottom" android:id="@id/clock" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/notification_panel_header_clock_margin_left" android:singleLine="true" systemui:ampmSmall="true" />
<com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date" android:textColor="@color/notification_header_date_color" android:gravity="bottom" android:id="@id/date" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_header_date_margin_left" android:layout_marginRight="@dimen/notification_panel_header_date_margin_right" android:layout_marginBottom="@dimen/notification_panel_header_date_margin_bottom" android:layout_toEndOf="@id/clock" />
-->
6: Now right under the lince we just comment out we will add these lines

Code:
<LinearLayout android:gravity="left" android:orientation="vertical" android:id="@id/cpu" android:background="#ff000000" android:layout_width="fill_parent" android:layout_height="fill_parent">
<TextView android:textSize="15.0dip" android:textColor="#ffffffff" android:id="@id/sys_id" android:paddingLeft="11.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/cpu_text" android:layout_marginLeft="@dimen/status_bar_expanded_notification_margin" />
<com.android.systemui.statusbar.policy.CpuUsageView android:textSize="12.0dip" android:textColor="#ffffffff" android:paddingLeft="23.0px" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
7: Now save everything and lets compile the SystemUI.apk and sign it.

8: Take the SystemUI.apk we just compiled and signed and decompile it again using apktool

9: Now we open the file public.xml and look for the line <public type="string" name="cpu_idle" id=" now all we needed is the id inside the id=""

10: Now we open the file \SystemUI\smali\com\android\systemui\statusbar\pol icy\CpuUsageView$1.smali and search for # virtual methods few lines below you will see const v9, 0x7f0a01ad and all we need to do is change the 0x7f0a01ad to the one we found in public.xml

11: Save everything Compile & Sign and push it inside your system\priv-app.

12: Enjoy
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2014-05-07-17-33-47.jpg
Views:	6378
Size:	102.5 KB
ID:	2730727  
Attached Files
File Type: rar smali.rar - [Click for QR Code] (5.4 KB, 777 views)
The Following 13 Users Say Thank You to meawww For This Useful Post: [ View ] Gift meawww Ad-Free
 
 
7th May 2014, 05:24 PM |#2  
Junior Member
Flag Wiltshire
Thanks Meter: 9
 
More
Do you need root for this?

Sent from my SM-N9005 using XDA Premium 4 mobile app
7th May 2014, 05:45 PM |#3  
speedyjay's Avatar
Senior Member
Flag Farnborough
Thanks Meter: 623
 
Donate to Me
More
Does ram booster pro actually work??

Sent from my SM-N9005 using XDA Premium 4 mobile app
7th May 2014, 05:58 PM |#4  
meawww's Avatar
OP Senior Member
Flag Rome
Thanks Meter: 630
 
Donate to Me
More
Quote:
Originally Posted by HaloTwenty3

Do you need root for this?

Sent from my SM-N9005 using XDA Premium 4 mobile app

Yes

Quote:
Originally Posted by speedyjay

Does ram booster pro actually work??

Sent from my SM-N9005 using XDA Premium 4 mobile app

Yes i think been using it since i got my note 3
7th May 2014, 06:32 PM |#5  
TheDriller's Avatar
Senior Member
Flag Fort Collins, CO
Thanks Meter: 6,698
 
Donate to Me
More
Awesome job
The Following User Says Thank You to TheDriller For This Useful Post: [ View ] Gift TheDriller Ad-Free
10th May 2014, 07:17 PM |#6  
kadiremrah's Avatar
Senior Member
Flag Nigde
Thanks Meter: 629
 
Donate to Me
More
Hi meawww,

Is it possible to add CPU Freq value like "CPU Usage: @1600mHz"
10th May 2014, 08:21 PM |#7  
DrawnToLife's Avatar
Senior Member
Toronto
Thanks Meter: 1,628
 
More
What toggles are those? They look so nice..
11th May 2014, 08:25 AM |#8  
meawww's Avatar
OP Senior Member
Flag Rome
Thanks Meter: 630
 
Donate to Me
More
Quote:
Originally Posted by kadiremrah

Hi meawww,

Is it possible to add CPU Freq value like "CPU Usage: @1600mHz"

Nope

Quote:
Originally Posted by DrawnToLife

What toggles are those? They look so nice..

Made those while ago and never been released
12th May 2014, 11:01 AM |#9  
carlospr21's Avatar
Senior Member
Flag P.R. Levittown
Thanks Meter: 1,567
 
Donate to Me
More
Can anyone make a vrtheme flashable zip with the modded .xml only please

Sent from my SM-N900A using XDA Premium 4 mobile app
13th May 2014, 04:45 AM |#10  
carlospr21's Avatar
Senior Member
Flag P.R. Levittown
Thanks Meter: 1,567
 
Donate to Me
More
Anyone???

Sent from my SM-N900A using XDA Premium 4 mobile app

---------- Post added at 11:45 PM ---------- Previous post was at 11:41 PM ----------

@dr.ketan pleasee
13th May 2014, 07:30 AM |#11  
Goldie's Avatar
Inactive Recognized Developer
Thanks Meter: 22,977
 
Donate to Me
More
Why do you only want the xml?

Sent from my SM-G900F using Tapatalk
Post Reply Subscribe to Thread

Tags
cpu notification, cpu systemui, systemui mod

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

Advanced Search
Display Modes