Loading core/java/android/os/BatteryStats.java +1 −3 Original line number Diff line number Diff line Loading @@ -5160,9 +5160,7 @@ public abstract class BatteryStats implements Parcelable { Uid.Proc.ExcessivePower ew = ps.getExcessivePower(e); if (ew != null) { pw.print(prefix); pw.print(" * Killed for "); if (ew.type == Uid.Proc.ExcessivePower.TYPE_WAKE) { pw.print("wake lock"); } else if (ew.type == Uid.Proc.ExcessivePower.TYPE_CPU) { if (ew.type == Uid.Proc.ExcessivePower.TYPE_CPU) { pw.print("cpu"); } else { pw.print("unknown"); Loading core/java/android/provider/Settings.java +5 −3 Original line number Diff line number Diff line Loading @@ -9185,9 +9185,11 @@ public final class Settings { * gc_min_interval (long) * full_pss_min_interval (long) * full_pss_lowered_interval (long) * power_check_delay (long) * wake_lock_min_check_duration (long) * cpu_min_check_duration (long) * power_check_interval (long) * power_check_max_cpu_1 (int) * power_check_max_cpu_2 (int) * power_check_max_cpu_3 (int) * power_check_max_cpu_4 (int) * service_usage_interaction_time (long) * usage_stats_interaction_interval (long) * service_restart_duration (long) Loading core/java/com/android/internal/app/procstats/ProcessState.java +6 −25 Original line number Diff line number Diff line Loading @@ -196,7 +196,6 @@ public final class ProcessState { ProcessState pnew = new ProcessState(this, mPackage, mUid, mVersion, mName, now); pnew.mDurations.addDurations(mDurations); pnew.mPssTable.copyFrom(mPssTable, PSS_COUNT); pnew.mNumExcessiveWake = mNumExcessiveWake; pnew.mNumExcessiveCpu = mNumExcessiveCpu; pnew.mNumCachedKill = mNumCachedKill; pnew.mMinCachedKillPss = mMinCachedKillPss; Loading Loading @@ -250,7 +249,6 @@ public final class ProcessState { public void add(ProcessState other) { mDurations.addDurations(other.mDurations); mPssTable.mergeStats(other.mPssTable); mNumExcessiveWake += other.mNumExcessiveWake; mNumExcessiveCpu += other.mNumExcessiveCpu; if (other.mNumCachedKill > 0) { addCachedKill(other.mNumCachedKill, other.mMinCachedKillPss, Loading @@ -264,7 +262,6 @@ public final class ProcessState { mStartTime = now; mLastPssState = STATE_NOTHING; mLastPssTime = 0; mNumExcessiveWake = 0; mNumExcessiveCpu = 0; mNumCachedKill = 0; mMinCachedKillPss = mAvgCachedKillPss = mMaxCachedKillPss = 0; Loading @@ -286,7 +283,7 @@ public final class ProcessState { out.writeInt(mMultiPackage ? 1 : 0); mDurations.writeToParcel(out); mPssTable.writeToParcel(out); out.writeInt(mNumExcessiveWake); out.writeInt(0); // was mNumExcessiveWake out.writeInt(mNumExcessiveCpu); out.writeInt(mNumCachedKill); if (mNumCachedKill > 0) { Loading @@ -309,7 +306,7 @@ public final class ProcessState { if (!mPssTable.readFromParcel(in)) { return false; } mNumExcessiveWake = in.readInt(); in.readInt(); // was mNumExcessiveWake mNumExcessiveCpu = in.readInt(); mNumCachedKill = in.readInt(); if (mNumCachedKill > 0) { Loading Loading @@ -493,18 +490,6 @@ public final class ProcessState { } } public void reportExcessiveWake(ArrayMap<String, ProcessStateHolder> pkgList) { ensureNotDead(); mCommonProcess.mNumExcessiveWake++; if (!mCommonProcess.mMultiPackage) { return; } for (int ip=pkgList.size()-1; ip>=0; ip--) { pullFixedProc(pkgList, ip).mNumExcessiveWake++; } } public void reportExcessiveCpu(ArrayMap<String, ProcessStateHolder> pkgList) { ensureNotDead(); mCommonProcess.mNumExcessiveCpu++; Loading Loading @@ -895,10 +880,6 @@ public final class ProcessState { } } } if (mNumExcessiveWake != 0) { pw.print(prefix); pw.print("Killed for excessive wake locks: "); pw.print(mNumExcessiveWake); pw.println(" times"); } if (mNumExcessiveCpu != 0) { pw.print(prefix); pw.print("Killed for excessive CPU use: "); pw.print(mNumExcessiveCpu); pw.println(" times"); Loading Loading @@ -1072,7 +1053,7 @@ public final class ProcessState { dumpAllPssCheckin(pw); pw.println(); } if (mNumExcessiveWake > 0 || mNumExcessiveCpu > 0 || mNumCachedKill > 0) { if (mNumExcessiveCpu > 0 || mNumCachedKill > 0) { pw.print("pkgkills,"); pw.print(pkgName); pw.print(","); Loading @@ -1082,7 +1063,7 @@ public final class ProcessState { pw.print(","); pw.print(DumpUtils.collapseString(pkgName, itemName)); pw.print(","); pw.print(mNumExcessiveWake); pw.print("0"); // was mNumExcessiveWake pw.print(","); pw.print(mNumExcessiveCpu); pw.print(","); Loading Loading @@ -1114,13 +1095,13 @@ public final class ProcessState { dumpAllPssCheckin(pw); pw.println(); } if (mNumExcessiveWake > 0 || mNumExcessiveCpu > 0 || mNumCachedKill > 0) { if (mNumExcessiveCpu > 0 || mNumCachedKill > 0) { pw.print("kills,"); pw.print(procName); pw.print(","); pw.print(uid); pw.print(","); pw.print(mNumExcessiveWake); pw.print("0"); // was mNumExcessiveWake pw.print(","); pw.print(mNumExcessiveCpu); pw.print(","); Loading core/java/com/android/internal/os/BatteryStatsImpl.java +0 −26 Original line number Diff line number Diff line Loading @@ -3987,14 +3987,6 @@ public class BatteryStatsImpl extends BatteryStats { return 0; } public void reportExcessiveWakeLocked(int uid, String proc, long overTime, long usedTime) { uid = mapUid(uid); Uid u = mUidStats.get(uid); if (u != null) { u.reportExcessiveWakeLocked(proc, overTime, usedTime); } } public void reportExcessiveCpuLocked(int uid, String proc, long overTime, long usedTime) { uid = mapUid(uid); Uid u = mUidStats.get(uid); Loading Loading @@ -7745,17 +7737,6 @@ public class BatteryStatsImpl extends BatteryStats { return null; } public void addExcessiveWake(long overTime, long usedTime) { if (mExcessivePower == null) { mExcessivePower = new ArrayList<ExcessivePower>(); } ExcessivePower ew = new ExcessivePower(); ew.type = ExcessivePower.TYPE_WAKE; ew.overTime = overTime; ew.usedTime = usedTime; mExcessivePower.add(ew); } public void addExcessiveCpu(long overTime, long usedTime) { if (mExcessivePower == null) { mExcessivePower = new ArrayList<ExcessivePower>(); Loading Loading @@ -8570,13 +8551,6 @@ public class BatteryStatsImpl extends BatteryStats { } } public void reportExcessiveWakeLocked(String proc, long overTime, long usedTime) { Proc p = getProcessStatsLocked(proc); if (p != null) { p.addExcessiveWake(overTime, usedTime); } } public void reportExcessiveCpuLocked(String proc, long overTime, long usedTime) { Proc p = getProcessStatsLocked(proc); if (p != null) { Loading services/core/java/com/android/server/am/ActivityManagerConstants.java +48 −28 Original line number Diff line number Diff line Loading @@ -48,9 +48,11 @@ final class ActivityManagerConstants extends ContentObserver { private static final String KEY_GC_MIN_INTERVAL = "gc_min_interval"; private static final String KEY_FULL_PSS_MIN_INTERVAL = "full_pss_min_interval"; private static final String KEY_FULL_PSS_LOWERED_INTERVAL = "full_pss_lowered_interval"; private static final String KEY_POWER_CHECK_DELAY = "power_check_delay"; private static final String KEY_WAKE_LOCK_MIN_CHECK_DURATION = "wake_lock_min_check_duration"; private static final String KEY_CPU_MIN_CHECK_DURATION = "cpu_min_check_duration"; private static final String KEY_POWER_CHECK_INTERVAL = "power_check_interval"; private static final String KEY_POWER_CHECK_MAX_CPU_1 = "power_check_max_cpu_1"; private static final String KEY_POWER_CHECK_MAX_CPU_2 = "power_check_max_cpu_2"; private static final String KEY_POWER_CHECK_MAX_CPU_3 = "power_check_max_cpu_3"; private static final String KEY_POWER_CHECK_MAX_CPU_4 = "power_check_max_cpu_4"; private static final String KEY_SERVICE_USAGE_INTERACTION_TIME = "service_usage_interaction_time"; private static final String KEY_USAGE_STATS_INTERACTION_INTERVAL Loading @@ -73,11 +75,11 @@ final class ActivityManagerConstants extends ContentObserver { private static final long DEFAULT_GC_MIN_INTERVAL = 60*1000; private static final long DEFAULT_FULL_PSS_MIN_INTERVAL = 10*60*1000; private static final long DEFAULT_FULL_PSS_LOWERED_INTERVAL = 2*60*1000; private static final long DEFAULT_POWER_CHECK_DELAY = (DEBUG_POWER_QUICK ? 2 : 15) * 60*1000; private static final long DEFAULT_WAKE_LOCK_MIN_CHECK_DURATION = (DEBUG_POWER_QUICK ? 1 : 5) * 60*1000; private static final long DEFAULT_CPU_MIN_CHECK_DURATION = (DEBUG_POWER_QUICK ? 1 : 5) * 60*1000; private static final long DEFAULT_POWER_CHECK_INTERVAL = (DEBUG_POWER_QUICK ? 1 : 5) * 60*1000; private static final int DEFAULT_POWER_CHECK_MAX_CPU_1 = 25; private static final int DEFAULT_POWER_CHECK_MAX_CPU_2 = 25; private static final int DEFAULT_POWER_CHECK_MAX_CPU_3 = 10; private static final int DEFAULT_POWER_CHECK_MAX_CPU_4 = 2; private static final long DEFAULT_SERVICE_USAGE_INTERACTION_TIME = 30*60*1000; private static final long DEFAULT_USAGE_STATS_INTERACTION_INTERVAL = 24*60*60*1000L; private static final long DEFAULT_SERVICE_RESTART_DURATION = 1*1000; Loading Loading @@ -133,16 +135,26 @@ final class ActivityManagerConstants extends ContentObserver { // when the request is due to the memory state being lowered. long FULL_PSS_LOWERED_INTERVAL = DEFAULT_FULL_PSS_LOWERED_INTERVAL; // The rate at which we check for apps using excessive power -- 15 mins. long POWER_CHECK_DELAY = DEFAULT_POWER_CHECK_DELAY; // The minimum sample duration we will allow before deciding we have // enough data on wake locks to start killing things. long WAKE_LOCK_MIN_CHECK_DURATION = DEFAULT_WAKE_LOCK_MIN_CHECK_DURATION; // The minimum sample duration we will allow before deciding we have // enough data on CPU usage to start killing things. long CPU_MIN_CHECK_DURATION = DEFAULT_CPU_MIN_CHECK_DURATION; long POWER_CHECK_INTERVAL = DEFAULT_POWER_CHECK_INTERVAL; // The maximum CPU (as a percentage) a process is allowed to use over the first // power check interval that it is cached. int POWER_CHECK_MAX_CPU_1 = DEFAULT_POWER_CHECK_MAX_CPU_1; // The maximum CPU (as a percentage) a process is allowed to use over the second // power check interval that it is cached. The home app will never check for less // CPU than this (it will not test against the 3 or 4 levels). int POWER_CHECK_MAX_CPU_2 = DEFAULT_POWER_CHECK_MAX_CPU_2; // The maximum CPU (as a percentage) a process is allowed to use over the third // power check interval that it is cached. int POWER_CHECK_MAX_CPU_3 = DEFAULT_POWER_CHECK_MAX_CPU_3; // The maximum CPU (as a percentage) a process is allowed to use over the fourth // power check interval that it is cached. int POWER_CHECK_MAX_CPU_4 = DEFAULT_POWER_CHECK_MAX_CPU_4; // This is the amount of time an app needs to be running a foreground service before // we will consider it to be doing interaction for usage stats. Loading Loading @@ -270,12 +282,16 @@ final class ActivityManagerConstants extends ContentObserver { DEFAULT_FULL_PSS_MIN_INTERVAL); FULL_PSS_LOWERED_INTERVAL = mParser.getLong(KEY_FULL_PSS_LOWERED_INTERVAL, DEFAULT_FULL_PSS_LOWERED_INTERVAL); POWER_CHECK_DELAY = mParser.getLong(KEY_POWER_CHECK_DELAY, DEFAULT_POWER_CHECK_DELAY); WAKE_LOCK_MIN_CHECK_DURATION = mParser.getLong(KEY_WAKE_LOCK_MIN_CHECK_DURATION, DEFAULT_WAKE_LOCK_MIN_CHECK_DURATION); CPU_MIN_CHECK_DURATION = mParser.getLong(KEY_CPU_MIN_CHECK_DURATION, DEFAULT_CPU_MIN_CHECK_DURATION); POWER_CHECK_INTERVAL = mParser.getLong(KEY_POWER_CHECK_INTERVAL, DEFAULT_POWER_CHECK_INTERVAL); POWER_CHECK_MAX_CPU_1 = mParser.getInt(KEY_POWER_CHECK_MAX_CPU_1, DEFAULT_POWER_CHECK_MAX_CPU_1); POWER_CHECK_MAX_CPU_2 = mParser.getInt(KEY_POWER_CHECK_MAX_CPU_2, DEFAULT_POWER_CHECK_MAX_CPU_2); POWER_CHECK_MAX_CPU_3 = mParser.getInt(KEY_POWER_CHECK_MAX_CPU_3, DEFAULT_POWER_CHECK_MAX_CPU_3); POWER_CHECK_MAX_CPU_4 = mParser.getInt(KEY_POWER_CHECK_MAX_CPU_4, DEFAULT_POWER_CHECK_MAX_CPU_4); SERVICE_USAGE_INTERACTION_TIME = mParser.getLong(KEY_SERVICE_USAGE_INTERACTION_TIME, DEFAULT_SERVICE_USAGE_INTERACTION_TIME); USAGE_STATS_INTERACTION_INTERVAL = mParser.getLong(KEY_USAGE_STATS_INTERACTION_INTERVAL, Loading Loading @@ -335,12 +351,16 @@ final class ActivityManagerConstants extends ContentObserver { pw.println(FULL_PSS_MIN_INTERVAL); pw.print(" "); pw.print(KEY_FULL_PSS_LOWERED_INTERVAL); pw.print("="); pw.println(FULL_PSS_LOWERED_INTERVAL); pw.print(" "); pw.print(KEY_POWER_CHECK_DELAY); pw.print("="); pw.println(POWER_CHECK_DELAY); pw.print(" "); pw.print(KEY_WAKE_LOCK_MIN_CHECK_DURATION); pw.print("="); pw.println(WAKE_LOCK_MIN_CHECK_DURATION); pw.print(" "); pw.print(KEY_CPU_MIN_CHECK_DURATION); pw.print("="); pw.println(CPU_MIN_CHECK_DURATION); pw.print(" "); pw.print(KEY_POWER_CHECK_INTERVAL); pw.print("="); pw.println(POWER_CHECK_INTERVAL); pw.print(" "); pw.print(KEY_POWER_CHECK_MAX_CPU_1); pw.print("="); pw.println(POWER_CHECK_MAX_CPU_1); pw.print(" "); pw.print(KEY_POWER_CHECK_MAX_CPU_2); pw.print("="); pw.println(POWER_CHECK_MAX_CPU_2); pw.print(" "); pw.print(KEY_POWER_CHECK_MAX_CPU_3); pw.print("="); pw.println(POWER_CHECK_MAX_CPU_3); pw.print(" "); pw.print(KEY_POWER_CHECK_MAX_CPU_4); pw.print("="); pw.println(POWER_CHECK_MAX_CPU_4); pw.print(" "); pw.print(KEY_SERVICE_USAGE_INTERACTION_TIME); pw.print("="); pw.println(SERVICE_USAGE_INTERACTION_TIME); pw.print(" "); pw.print(KEY_USAGE_STATS_INTERACTION_INTERVAL); pw.print("="); Loading Loading
core/java/android/os/BatteryStats.java +1 −3 Original line number Diff line number Diff line Loading @@ -5160,9 +5160,7 @@ public abstract class BatteryStats implements Parcelable { Uid.Proc.ExcessivePower ew = ps.getExcessivePower(e); if (ew != null) { pw.print(prefix); pw.print(" * Killed for "); if (ew.type == Uid.Proc.ExcessivePower.TYPE_WAKE) { pw.print("wake lock"); } else if (ew.type == Uid.Proc.ExcessivePower.TYPE_CPU) { if (ew.type == Uid.Proc.ExcessivePower.TYPE_CPU) { pw.print("cpu"); } else { pw.print("unknown"); Loading
core/java/android/provider/Settings.java +5 −3 Original line number Diff line number Diff line Loading @@ -9185,9 +9185,11 @@ public final class Settings { * gc_min_interval (long) * full_pss_min_interval (long) * full_pss_lowered_interval (long) * power_check_delay (long) * wake_lock_min_check_duration (long) * cpu_min_check_duration (long) * power_check_interval (long) * power_check_max_cpu_1 (int) * power_check_max_cpu_2 (int) * power_check_max_cpu_3 (int) * power_check_max_cpu_4 (int) * service_usage_interaction_time (long) * usage_stats_interaction_interval (long) * service_restart_duration (long) Loading
core/java/com/android/internal/app/procstats/ProcessState.java +6 −25 Original line number Diff line number Diff line Loading @@ -196,7 +196,6 @@ public final class ProcessState { ProcessState pnew = new ProcessState(this, mPackage, mUid, mVersion, mName, now); pnew.mDurations.addDurations(mDurations); pnew.mPssTable.copyFrom(mPssTable, PSS_COUNT); pnew.mNumExcessiveWake = mNumExcessiveWake; pnew.mNumExcessiveCpu = mNumExcessiveCpu; pnew.mNumCachedKill = mNumCachedKill; pnew.mMinCachedKillPss = mMinCachedKillPss; Loading Loading @@ -250,7 +249,6 @@ public final class ProcessState { public void add(ProcessState other) { mDurations.addDurations(other.mDurations); mPssTable.mergeStats(other.mPssTable); mNumExcessiveWake += other.mNumExcessiveWake; mNumExcessiveCpu += other.mNumExcessiveCpu; if (other.mNumCachedKill > 0) { addCachedKill(other.mNumCachedKill, other.mMinCachedKillPss, Loading @@ -264,7 +262,6 @@ public final class ProcessState { mStartTime = now; mLastPssState = STATE_NOTHING; mLastPssTime = 0; mNumExcessiveWake = 0; mNumExcessiveCpu = 0; mNumCachedKill = 0; mMinCachedKillPss = mAvgCachedKillPss = mMaxCachedKillPss = 0; Loading @@ -286,7 +283,7 @@ public final class ProcessState { out.writeInt(mMultiPackage ? 1 : 0); mDurations.writeToParcel(out); mPssTable.writeToParcel(out); out.writeInt(mNumExcessiveWake); out.writeInt(0); // was mNumExcessiveWake out.writeInt(mNumExcessiveCpu); out.writeInt(mNumCachedKill); if (mNumCachedKill > 0) { Loading @@ -309,7 +306,7 @@ public final class ProcessState { if (!mPssTable.readFromParcel(in)) { return false; } mNumExcessiveWake = in.readInt(); in.readInt(); // was mNumExcessiveWake mNumExcessiveCpu = in.readInt(); mNumCachedKill = in.readInt(); if (mNumCachedKill > 0) { Loading Loading @@ -493,18 +490,6 @@ public final class ProcessState { } } public void reportExcessiveWake(ArrayMap<String, ProcessStateHolder> pkgList) { ensureNotDead(); mCommonProcess.mNumExcessiveWake++; if (!mCommonProcess.mMultiPackage) { return; } for (int ip=pkgList.size()-1; ip>=0; ip--) { pullFixedProc(pkgList, ip).mNumExcessiveWake++; } } public void reportExcessiveCpu(ArrayMap<String, ProcessStateHolder> pkgList) { ensureNotDead(); mCommonProcess.mNumExcessiveCpu++; Loading Loading @@ -895,10 +880,6 @@ public final class ProcessState { } } } if (mNumExcessiveWake != 0) { pw.print(prefix); pw.print("Killed for excessive wake locks: "); pw.print(mNumExcessiveWake); pw.println(" times"); } if (mNumExcessiveCpu != 0) { pw.print(prefix); pw.print("Killed for excessive CPU use: "); pw.print(mNumExcessiveCpu); pw.println(" times"); Loading Loading @@ -1072,7 +1053,7 @@ public final class ProcessState { dumpAllPssCheckin(pw); pw.println(); } if (mNumExcessiveWake > 0 || mNumExcessiveCpu > 0 || mNumCachedKill > 0) { if (mNumExcessiveCpu > 0 || mNumCachedKill > 0) { pw.print("pkgkills,"); pw.print(pkgName); pw.print(","); Loading @@ -1082,7 +1063,7 @@ public final class ProcessState { pw.print(","); pw.print(DumpUtils.collapseString(pkgName, itemName)); pw.print(","); pw.print(mNumExcessiveWake); pw.print("0"); // was mNumExcessiveWake pw.print(","); pw.print(mNumExcessiveCpu); pw.print(","); Loading Loading @@ -1114,13 +1095,13 @@ public final class ProcessState { dumpAllPssCheckin(pw); pw.println(); } if (mNumExcessiveWake > 0 || mNumExcessiveCpu > 0 || mNumCachedKill > 0) { if (mNumExcessiveCpu > 0 || mNumCachedKill > 0) { pw.print("kills,"); pw.print(procName); pw.print(","); pw.print(uid); pw.print(","); pw.print(mNumExcessiveWake); pw.print("0"); // was mNumExcessiveWake pw.print(","); pw.print(mNumExcessiveCpu); pw.print(","); Loading
core/java/com/android/internal/os/BatteryStatsImpl.java +0 −26 Original line number Diff line number Diff line Loading @@ -3987,14 +3987,6 @@ public class BatteryStatsImpl extends BatteryStats { return 0; } public void reportExcessiveWakeLocked(int uid, String proc, long overTime, long usedTime) { uid = mapUid(uid); Uid u = mUidStats.get(uid); if (u != null) { u.reportExcessiveWakeLocked(proc, overTime, usedTime); } } public void reportExcessiveCpuLocked(int uid, String proc, long overTime, long usedTime) { uid = mapUid(uid); Uid u = mUidStats.get(uid); Loading Loading @@ -7745,17 +7737,6 @@ public class BatteryStatsImpl extends BatteryStats { return null; } public void addExcessiveWake(long overTime, long usedTime) { if (mExcessivePower == null) { mExcessivePower = new ArrayList<ExcessivePower>(); } ExcessivePower ew = new ExcessivePower(); ew.type = ExcessivePower.TYPE_WAKE; ew.overTime = overTime; ew.usedTime = usedTime; mExcessivePower.add(ew); } public void addExcessiveCpu(long overTime, long usedTime) { if (mExcessivePower == null) { mExcessivePower = new ArrayList<ExcessivePower>(); Loading Loading @@ -8570,13 +8551,6 @@ public class BatteryStatsImpl extends BatteryStats { } } public void reportExcessiveWakeLocked(String proc, long overTime, long usedTime) { Proc p = getProcessStatsLocked(proc); if (p != null) { p.addExcessiveWake(overTime, usedTime); } } public void reportExcessiveCpuLocked(String proc, long overTime, long usedTime) { Proc p = getProcessStatsLocked(proc); if (p != null) { Loading
services/core/java/com/android/server/am/ActivityManagerConstants.java +48 −28 Original line number Diff line number Diff line Loading @@ -48,9 +48,11 @@ final class ActivityManagerConstants extends ContentObserver { private static final String KEY_GC_MIN_INTERVAL = "gc_min_interval"; private static final String KEY_FULL_PSS_MIN_INTERVAL = "full_pss_min_interval"; private static final String KEY_FULL_PSS_LOWERED_INTERVAL = "full_pss_lowered_interval"; private static final String KEY_POWER_CHECK_DELAY = "power_check_delay"; private static final String KEY_WAKE_LOCK_MIN_CHECK_DURATION = "wake_lock_min_check_duration"; private static final String KEY_CPU_MIN_CHECK_DURATION = "cpu_min_check_duration"; private static final String KEY_POWER_CHECK_INTERVAL = "power_check_interval"; private static final String KEY_POWER_CHECK_MAX_CPU_1 = "power_check_max_cpu_1"; private static final String KEY_POWER_CHECK_MAX_CPU_2 = "power_check_max_cpu_2"; private static final String KEY_POWER_CHECK_MAX_CPU_3 = "power_check_max_cpu_3"; private static final String KEY_POWER_CHECK_MAX_CPU_4 = "power_check_max_cpu_4"; private static final String KEY_SERVICE_USAGE_INTERACTION_TIME = "service_usage_interaction_time"; private static final String KEY_USAGE_STATS_INTERACTION_INTERVAL Loading @@ -73,11 +75,11 @@ final class ActivityManagerConstants extends ContentObserver { private static final long DEFAULT_GC_MIN_INTERVAL = 60*1000; private static final long DEFAULT_FULL_PSS_MIN_INTERVAL = 10*60*1000; private static final long DEFAULT_FULL_PSS_LOWERED_INTERVAL = 2*60*1000; private static final long DEFAULT_POWER_CHECK_DELAY = (DEBUG_POWER_QUICK ? 2 : 15) * 60*1000; private static final long DEFAULT_WAKE_LOCK_MIN_CHECK_DURATION = (DEBUG_POWER_QUICK ? 1 : 5) * 60*1000; private static final long DEFAULT_CPU_MIN_CHECK_DURATION = (DEBUG_POWER_QUICK ? 1 : 5) * 60*1000; private static final long DEFAULT_POWER_CHECK_INTERVAL = (DEBUG_POWER_QUICK ? 1 : 5) * 60*1000; private static final int DEFAULT_POWER_CHECK_MAX_CPU_1 = 25; private static final int DEFAULT_POWER_CHECK_MAX_CPU_2 = 25; private static final int DEFAULT_POWER_CHECK_MAX_CPU_3 = 10; private static final int DEFAULT_POWER_CHECK_MAX_CPU_4 = 2; private static final long DEFAULT_SERVICE_USAGE_INTERACTION_TIME = 30*60*1000; private static final long DEFAULT_USAGE_STATS_INTERACTION_INTERVAL = 24*60*60*1000L; private static final long DEFAULT_SERVICE_RESTART_DURATION = 1*1000; Loading Loading @@ -133,16 +135,26 @@ final class ActivityManagerConstants extends ContentObserver { // when the request is due to the memory state being lowered. long FULL_PSS_LOWERED_INTERVAL = DEFAULT_FULL_PSS_LOWERED_INTERVAL; // The rate at which we check for apps using excessive power -- 15 mins. long POWER_CHECK_DELAY = DEFAULT_POWER_CHECK_DELAY; // The minimum sample duration we will allow before deciding we have // enough data on wake locks to start killing things. long WAKE_LOCK_MIN_CHECK_DURATION = DEFAULT_WAKE_LOCK_MIN_CHECK_DURATION; // The minimum sample duration we will allow before deciding we have // enough data on CPU usage to start killing things. long CPU_MIN_CHECK_DURATION = DEFAULT_CPU_MIN_CHECK_DURATION; long POWER_CHECK_INTERVAL = DEFAULT_POWER_CHECK_INTERVAL; // The maximum CPU (as a percentage) a process is allowed to use over the first // power check interval that it is cached. int POWER_CHECK_MAX_CPU_1 = DEFAULT_POWER_CHECK_MAX_CPU_1; // The maximum CPU (as a percentage) a process is allowed to use over the second // power check interval that it is cached. The home app will never check for less // CPU than this (it will not test against the 3 or 4 levels). int POWER_CHECK_MAX_CPU_2 = DEFAULT_POWER_CHECK_MAX_CPU_2; // The maximum CPU (as a percentage) a process is allowed to use over the third // power check interval that it is cached. int POWER_CHECK_MAX_CPU_3 = DEFAULT_POWER_CHECK_MAX_CPU_3; // The maximum CPU (as a percentage) a process is allowed to use over the fourth // power check interval that it is cached. int POWER_CHECK_MAX_CPU_4 = DEFAULT_POWER_CHECK_MAX_CPU_4; // This is the amount of time an app needs to be running a foreground service before // we will consider it to be doing interaction for usage stats. Loading Loading @@ -270,12 +282,16 @@ final class ActivityManagerConstants extends ContentObserver { DEFAULT_FULL_PSS_MIN_INTERVAL); FULL_PSS_LOWERED_INTERVAL = mParser.getLong(KEY_FULL_PSS_LOWERED_INTERVAL, DEFAULT_FULL_PSS_LOWERED_INTERVAL); POWER_CHECK_DELAY = mParser.getLong(KEY_POWER_CHECK_DELAY, DEFAULT_POWER_CHECK_DELAY); WAKE_LOCK_MIN_CHECK_DURATION = mParser.getLong(KEY_WAKE_LOCK_MIN_CHECK_DURATION, DEFAULT_WAKE_LOCK_MIN_CHECK_DURATION); CPU_MIN_CHECK_DURATION = mParser.getLong(KEY_CPU_MIN_CHECK_DURATION, DEFAULT_CPU_MIN_CHECK_DURATION); POWER_CHECK_INTERVAL = mParser.getLong(KEY_POWER_CHECK_INTERVAL, DEFAULT_POWER_CHECK_INTERVAL); POWER_CHECK_MAX_CPU_1 = mParser.getInt(KEY_POWER_CHECK_MAX_CPU_1, DEFAULT_POWER_CHECK_MAX_CPU_1); POWER_CHECK_MAX_CPU_2 = mParser.getInt(KEY_POWER_CHECK_MAX_CPU_2, DEFAULT_POWER_CHECK_MAX_CPU_2); POWER_CHECK_MAX_CPU_3 = mParser.getInt(KEY_POWER_CHECK_MAX_CPU_3, DEFAULT_POWER_CHECK_MAX_CPU_3); POWER_CHECK_MAX_CPU_4 = mParser.getInt(KEY_POWER_CHECK_MAX_CPU_4, DEFAULT_POWER_CHECK_MAX_CPU_4); SERVICE_USAGE_INTERACTION_TIME = mParser.getLong(KEY_SERVICE_USAGE_INTERACTION_TIME, DEFAULT_SERVICE_USAGE_INTERACTION_TIME); USAGE_STATS_INTERACTION_INTERVAL = mParser.getLong(KEY_USAGE_STATS_INTERACTION_INTERVAL, Loading Loading @@ -335,12 +351,16 @@ final class ActivityManagerConstants extends ContentObserver { pw.println(FULL_PSS_MIN_INTERVAL); pw.print(" "); pw.print(KEY_FULL_PSS_LOWERED_INTERVAL); pw.print("="); pw.println(FULL_PSS_LOWERED_INTERVAL); pw.print(" "); pw.print(KEY_POWER_CHECK_DELAY); pw.print("="); pw.println(POWER_CHECK_DELAY); pw.print(" "); pw.print(KEY_WAKE_LOCK_MIN_CHECK_DURATION); pw.print("="); pw.println(WAKE_LOCK_MIN_CHECK_DURATION); pw.print(" "); pw.print(KEY_CPU_MIN_CHECK_DURATION); pw.print("="); pw.println(CPU_MIN_CHECK_DURATION); pw.print(" "); pw.print(KEY_POWER_CHECK_INTERVAL); pw.print("="); pw.println(POWER_CHECK_INTERVAL); pw.print(" "); pw.print(KEY_POWER_CHECK_MAX_CPU_1); pw.print("="); pw.println(POWER_CHECK_MAX_CPU_1); pw.print(" "); pw.print(KEY_POWER_CHECK_MAX_CPU_2); pw.print("="); pw.println(POWER_CHECK_MAX_CPU_2); pw.print(" "); pw.print(KEY_POWER_CHECK_MAX_CPU_3); pw.print("="); pw.println(POWER_CHECK_MAX_CPU_3); pw.print(" "); pw.print(KEY_POWER_CHECK_MAX_CPU_4); pw.print("="); pw.println(POWER_CHECK_MAX_CPU_4); pw.print(" "); pw.print(KEY_SERVICE_USAGE_INTERACTION_TIME); pw.print("="); pw.println(SERVICE_USAGE_INTERACTION_TIME); pw.print(" "); pw.print(KEY_USAGE_STATS_INTERACTION_INTERVAL); pw.print("="); Loading