http://androidxref.com/4.4.4_r1/xref/frameworks/base/packages/SystemUI/src/com/android/systemui/LoadAverageService.java139 mIrqPaint = new Paint();
140 mIrqPaint.setARGB(0x80, 0, 0, 0xff);
141 mIrqPaint.setShadowLayer(2, 0, 0, 0xff000000);
142 mSystemPaint = new Paint();
143 mSystemPaint.setARGB(0x80, 0xff, 0, 0);
144 mSystemPaint.setShadowLayer(2, 0, 0, 0xff000000);
145 mUserPaint = new Paint();
146 mUserPaint.setARGB(0x80, 0, 0xff, 0);
147 mSystemPaint.setShadowLayer(2, 0, 0, 0xff000000);
148
183 final int userTime = stats.getLastUserTime();
184 final int systemTime = stats.getLastSystemTime();
185 final int iowaitTime = stats.getLastIoWaitTime();
186 final int irqTime = stats.getLastIrqTime();
187 final int softIrqTime = stats.getLastSoftIrqTime();
188 final int idleTime = stats.getLastIdleTime();
194 int userW = (userTime*W)/totalTime;
195 int systemW = (systemTime*W)/totalTime;
196 int irqW = ((iowaitTime+irqTime+softIrqTime)*W)/totalTime;
202 if (irqW > 0) {
203 canvas.drawRect(x-irqW, top, x, bottom, mIrqPaint);
204 x -= irqW;
205 }
206 if (systemW > 0) {
207 canvas.drawRect(x-systemW, top, x, bottom, mSystemPaint);
208 x -= systemW;
209 }
210 if (userW > 0) {
211 canvas.drawRect(x-userW, top, x, bottom, mUserPaint);
212 x -= userW;
213 }