トラッキング コード

1/21/2012

CPU Usage

how to display of CPU usage

Settings -> Developer Options -> Show CPU usage

Screen overlay showing current CPU usage.

Setting CPU Usage in frameworks

DevelopmentSettings#onPreferenceTreeClick
- writeCpuUsageOptions()
  - startService "com.android.systemui.LoadAverageService" of SysttemUI.
  - LoadAverageService#onCreate()
    - new LoadView extends ProcessStats
        - new Stats
    - WindowManager#addView() with Overlay layer of SECURE_SYSTEM_OVERLAY_LAYER
        - WindowManagerImpl#addView
            - ViewRootImpl#setView
                - IWindowSession#add
                    - Session#add
                        - WindowManagerService#addWindow


check sorce file

\packages\apps\Settings\src\com\android\settings
- DevelopmentSettings.java

\frameworks\base\packages\SystemUI\src\com\android\systemui
- LoadAverageService.java

\frameworks\base\policy\src\com\android\internal\policy\impl
- PhoneWindowManager.java

\frameworks\base\core\java\com\android\internal\os
- ProcessStats.java



No comments:

Post a Comment