am 245408d2: Merge "Do not hold direct ref BatteryStatsImpl" into klp-dev
* commit '245408d29018fee4b1231e52f5da1edcc3283c4a': Do not hold direct ref BatteryStatsImpl$Uid$Proc
This commit is contained in:
@@ -2149,7 +2149,8 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
totalUTime += otherUTime;
|
totalUTime += otherUTime;
|
||||||
totalSTime += otherSTime;
|
totalSTime += otherSTime;
|
||||||
if (pr != null) {
|
if (pr != null) {
|
||||||
BatteryStatsImpl.Uid.Proc ps = pr.batteryStats;
|
BatteryStatsImpl.Uid.Proc ps = bstats.getProcessStatsLocked(
|
||||||
|
st.name, st.pid);
|
||||||
ps.addCpuTimeLocked(st.rel_utime-otherUTime,
|
ps.addCpuTimeLocked(st.rel_utime-otherUTime,
|
||||||
st.rel_stime-otherSTime);
|
st.rel_stime-otherSTime);
|
||||||
ps.addSpeedStepTimes(cpuSpeedTimes);
|
ps.addSpeedStepTimes(cpuSpeedTimes);
|
||||||
@@ -2769,10 +2770,10 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
app.processName, uid, uid, gids, debugFlags, mountExternal,
|
app.processName, uid, uid, gids, debugFlags, mountExternal,
|
||||||
app.info.targetSdkVersion, app.info.seinfo, null);
|
app.info.targetSdkVersion, app.info.seinfo, null);
|
||||||
|
|
||||||
BatteryStatsImpl bs = app.batteryStats.getBatteryStats();
|
BatteryStatsImpl bs = mBatteryStatsService.getActiveStatistics();
|
||||||
synchronized (bs) {
|
synchronized (bs) {
|
||||||
if (bs.isOnBattery()) {
|
if (bs.isOnBattery()) {
|
||||||
app.batteryStats.incStartsLocked();
|
bs.getProcessStatsLocked(app.uid, app.processName).incStartsLocked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8150,10 +8151,7 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
synchronized (stats) {
|
return new ProcessRecord(stats, info, proc, uid);
|
||||||
ps = stats.getProcessStatsLocked(info.uid, proc);
|
|
||||||
}
|
|
||||||
return new ProcessRecord(ps, info, proc, uid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final ProcessRecord addAppLocked(ApplicationInfo info, boolean isolated) {
|
final ProcessRecord addAppLocked(ApplicationInfo info, boolean isolated) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ import java.util.ArrayList;
|
|||||||
* is currently running.
|
* is currently running.
|
||||||
*/
|
*/
|
||||||
final class ProcessRecord {
|
final class ProcessRecord {
|
||||||
final BatteryStatsImpl.Uid.Proc batteryStats; // where to collect runtime statistics
|
private final BatteryStatsImpl mBatteryStats; // where to collect runtime statistics
|
||||||
final ApplicationInfo info; // all about the first app in the process
|
final ApplicationInfo info; // all about the first app in the process
|
||||||
final boolean isolated; // true if this is a special isolated process
|
final boolean isolated; // true if this is a special isolated process
|
||||||
final int uid; // uid of process; may be different from 'info' if isolated
|
final int uid; // uid of process; may be different from 'info' if isolated
|
||||||
@@ -273,8 +273,8 @@ final class ProcessRecord {
|
|||||||
}
|
}
|
||||||
if (!keeping) {
|
if (!keeping) {
|
||||||
long wtime;
|
long wtime;
|
||||||
synchronized (batteryStats.getBatteryStats()) {
|
synchronized (mBatteryStats) {
|
||||||
wtime = batteryStats.getBatteryStats().getProcessWakeTime(info.uid,
|
wtime = mBatteryStats.getProcessWakeTime(info.uid,
|
||||||
pid, SystemClock.elapsedRealtime());
|
pid, SystemClock.elapsedRealtime());
|
||||||
}
|
}
|
||||||
long timeUsed = wtime - lastWakeTime;
|
long timeUsed = wtime - lastWakeTime;
|
||||||
@@ -359,9 +359,9 @@ final class ProcessRecord {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessRecord(BatteryStatsImpl.Uid.Proc _batteryStats, ApplicationInfo _info,
|
ProcessRecord(BatteryStatsImpl _batteryStats, ApplicationInfo _info,
|
||||||
String _processName, int _uid) {
|
String _processName, int _uid) {
|
||||||
batteryStats = _batteryStats;
|
mBatteryStats = _batteryStats;
|
||||||
info = _info;
|
info = _info;
|
||||||
isolated = _info.uid != _uid;
|
isolated = _info.uid != _uid;
|
||||||
uid = _uid;
|
uid = _uid;
|
||||||
|
|||||||
Reference in New Issue
Block a user