diff options
author | Steve Kondik <shade@chemlab.org> | 2012-05-28 16:30:06 +0400 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.cyanogenmod.com> | 2012-05-28 16:30:06 +0400 |
commit | cb8a826a93195e91b6cc696186dd77f574fa228b (patch) | |
tree | ef60d8114251181a602c3e483c8d94e950ef534d /services | |
parent | 75ec6d46bfde898a6f4d96b0f91c7924183f245c (diff) | |
parent | 02cead2389bf9f2aee66360a418550b16e7148c4 (diff) | |
download | frameworks_base-cb8a826a93195e91b6cc696186dd77f574fa228b.zip frameworks_base-cb8a826a93195e91b6cc696186dd77f574fa228b.tar.gz frameworks_base-cb8a826a93195e91b6cc696186dd77f574fa228b.tar.bz2 |
Merge "CpuGovernorService for all, optional iobusy server thread" into ics
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/CpuGovernorService.java | 22 | ||||
-rw-r--r-- | services/java/com/android/server/SystemServer.java | 10 |
2 files changed, 21 insertions, 11 deletions
diff --git a/services/java/com/android/server/CpuGovernorService.java b/services/java/com/android/server/CpuGovernorService.java index 88bfac8..dfa12db 100644 --- a/services/java/com/android/server/CpuGovernorService.java +++ b/services/java/com/android/server/CpuGovernorService.java @@ -51,10 +51,14 @@ import android.util.Log; class CpuGovernorService { private final String TAG = "CpuGovernorService"; private Context mContext; + + private final boolean DBG = false; + private final boolean mUseIOBusyFeature = true; + private SamplingRateChangeProcessor mSamplingRateChangeProcessor = new SamplingRateChangeProcessor(); - private IOBusyVoteProcessor mIOBusyVoteChangeProcessor = - new IOBusyVoteProcessor(); + + private IOBusyVoteProcessor mIOBusyVoteChangeProcessor = null; public CpuGovernorService(Context context) { mContext = context; @@ -62,10 +66,16 @@ class CpuGovernorService { intentFilter.addAction(Intent.ACTION_SCREEN_ON); intentFilter.addAction(Intent.ACTION_SCREEN_OFF); - intentFilter.addAction(IOBusyVoteProcessor.ACTION_IOBUSY_VOTE); - intentFilter.addAction(IOBusyVoteProcessor.ACTION_IOBUSY_UNVOTE); new Thread(mSamplingRateChangeProcessor).start(); - new Thread(mIOBusyVoteChangeProcessor).start(); + + if (mUseIOBusyFeature) { + // IOBusy feature requires kernel >= 2.6.35 + intentFilter.addAction(IOBusyVoteProcessor.ACTION_IOBUSY_VOTE); + intentFilter.addAction(IOBusyVoteProcessor.ACTION_IOBUSY_UNVOTE); + + mIOBusyVoteChangeProcessor = new IOBusyVoteProcessor(); + new Thread(mIOBusyVoteChangeProcessor).start(); + } mContext.registerReceiver(mReceiver, intentFilter); } @@ -74,7 +84,7 @@ class CpuGovernorService { public void onReceive(Context context, Intent intent) { boolean changeAdded = false; - Log.i(TAG, "intent action: " + intent.getAction()); + if (DBG) Log.d(TAG, "intent action: " + intent.getAction()); if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) { if (SystemProperties.getInt("dev.pm.dyn_samplingrate", 0) != 0) { diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index ad78a3c..17a4b5d 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -270,13 +270,13 @@ class ServerThread extends Thread { if (SystemProperties.QCOM_HARDWARE) { Slog.i(TAG, "DynamicMemoryManager Service"); dmm = new DynamicMemoryManagerService(context); + } - cpuGovernorManager = new CpuGovernorService(context); - - if (cpuGovernorManager == null) { - Slog.e(TAG, "CpuGovernorService failed to start"); - } + cpuGovernorManager = new CpuGovernorService(context); + if (cpuGovernorManager == null) { + Slog.e(TAG, "CpuGovernorService failed to start"); } + } catch (RuntimeException e) { Slog.e("System", "******************************************"); Slog.e("System", "************ Failure starting core service", e); |