Loading services/java/com/android/server/CpuGovernorService.java +16 −6 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -62,10 +66,16 @@ class CpuGovernorService { intentFilter.addAction(Intent.ACTION_SCREEN_ON); intentFilter.addAction(Intent.ACTION_SCREEN_OFF); new Thread(mSamplingRateChangeProcessor).start(); if (mUseIOBusyFeature) { // IOBusy feature requires kernel >= 2.6.35 intentFilter.addAction(IOBusyVoteProcessor.ACTION_IOBUSY_VOTE); intentFilter.addAction(IOBusyVoteProcessor.ACTION_IOBUSY_UNVOTE); new Thread(mSamplingRateChangeProcessor).start(); mIOBusyVoteChangeProcessor = new IOBusyVoteProcessor(); new Thread(mIOBusyVoteChangeProcessor).start(); } mContext.registerReceiver(mReceiver, intentFilter); } Loading @@ -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) { Loading services/java/com/android/server/SystemServer.java +5 −5 Original line number Diff line number Diff line Loading @@ -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"); } } } catch (RuntimeException e) { Slog.e("System", "******************************************"); Slog.e("System", "************ Failure starting core service", e); Loading Loading
services/java/com/android/server/CpuGovernorService.java +16 −6 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -62,10 +66,16 @@ class CpuGovernorService { intentFilter.addAction(Intent.ACTION_SCREEN_ON); intentFilter.addAction(Intent.ACTION_SCREEN_OFF); new Thread(mSamplingRateChangeProcessor).start(); if (mUseIOBusyFeature) { // IOBusy feature requires kernel >= 2.6.35 intentFilter.addAction(IOBusyVoteProcessor.ACTION_IOBUSY_VOTE); intentFilter.addAction(IOBusyVoteProcessor.ACTION_IOBUSY_UNVOTE); new Thread(mSamplingRateChangeProcessor).start(); mIOBusyVoteChangeProcessor = new IOBusyVoteProcessor(); new Thread(mIOBusyVoteChangeProcessor).start(); } mContext.registerReceiver(mReceiver, intentFilter); } Loading @@ -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) { Loading
services/java/com/android/server/SystemServer.java +5 −5 Original line number Diff line number Diff line Loading @@ -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"); } } } catch (RuntimeException e) { Slog.e("System", "******************************************"); Slog.e("System", "************ Failure starting core service", e); Loading