Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f8f4482 authored by Shyama Prasad Mondal's avatar Shyama Prasad Mondal Committed by Giulio Cervera
Browse files

Browser sets up the min freq while scrolling

CRs-Fixed: 341058

Change-Id: Iee9067113819fe2bfc28740b919f5cd44cc2a5bd
parent 384ba005
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2007 The Android Open Source Project
 * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -30,6 +31,7 @@ import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.os.SystemProperties;
import android.provider.MediaStore;
import android.util.Log;
import android.util.SparseBooleanArray;
@@ -46,8 +48,11 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
import org.json.*;

import junit.framework.Assert;
import org.codeaurora.Performance;

/**
 * @hide
@@ -671,6 +676,8 @@ public final class WebViewCore {
        private static final int INITIALIZE = 0;
        private static final int REDUCE_PRIORITY = 1;
        private static final int RESUME_PRIORITY = 2;
        private static Performance mPerf = new Performance();
        private static final int MIN_FREQ_DURING_SCROLLING = 10;

        public void run() {
            Looper.prepare();
@@ -690,11 +697,23 @@ public final class WebViewCore {
                                Process.setThreadPriority(
                                        Process.THREAD_PRIORITY_DEFAULT + 3 *
                                        Process.THREAD_PRIORITY_LESS_FAVORABLE);
                                if (SystemProperties.QCOM_HARDWARE ) {
                                    /* Disable power collapse and setup the min frequency */
                                    /* 0 means disabling power collapse */
                                    mPerf.cpuSetOptions(Performance.CPUOPT_CPU0_PWRCLSP,0);
                                    mPerf.cpuSetOptions(Performance.CPUOPT_CPU0_FREQMIN,MIN_FREQ_DURING_SCROLLING);
                                }
                                break;

                            case RESUME_PRIORITY:
                                Process.setThreadPriority(
                                        Process.THREAD_PRIORITY_DEFAULT);
                                if (SystemProperties.QCOM_HARDWARE ) {
                                    /* Enable power collapse and reset the min frequency */
                                    /* 1 means enabling power collapse */
                                    mPerf.cpuSetOptions(Performance.CPUOPT_CPU0_PWRCLSP,1);
                                    mPerf.cpuSetOptions(Performance.CPUOPT_CPU0_FREQMIN,0);
                                }
                                break;

                            case EventHub.ADD_PACKAGE_NAME: