Loading api/system-current.txt +8 −0 Original line number Diff line number Diff line Loading @@ -5899,7 +5899,15 @@ package android.os { } public class WorkSource implements android.os.Parcelable { ctor public WorkSource(int); ctor public WorkSource(int, @NonNull String); method public android.os.WorkSource.WorkChain createWorkChain(); method @Nullable public String getPackageName(int); method public int getUid(int); method @Nullable public java.util.List<android.os.WorkSource.WorkChain> getWorkChains(); method public boolean isEmpty(); method public int size(); method @NonNull public android.os.WorkSource withoutNames(); } public static final class WorkSource.WorkChain implements android.os.Parcelable { Loading api/test-current.txt +4 −2 Original line number Diff line number Diff line Loading @@ -2185,10 +2185,12 @@ package android.os { method public boolean add(int); method public boolean add(int, String); method @Deprecated public android.os.WorkSource addReturningNewbs(android.os.WorkSource); method public int get(int); method public String getName(int); method @Nullable public String getPackageName(int); method public int getUid(int); method public boolean isEmpty(); method @Deprecated public android.os.WorkSource[] setReturningDiffs(android.os.WorkSource); method public int size(); method @NonNull public android.os.WorkSource withoutNames(); } } Loading core/java/android/os/StatsLogEventWrapper.java +1 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ public final class StatsLogEventWrapper implements Parcelable { out.writeLong(mElapsedTimeNs); out.writeLong(mWallClockTimeNs); if (mWorkSource != null) { ArrayList<android.os.WorkSource.WorkChain> workChains = mWorkSource.getWorkChains(); List<WorkSource.WorkChain> workChains = mWorkSource.getWorkChains(); // number of chains out.writeInt(workChains.size()); for (int i = 0; i < workChains.size(); i++) { Loading core/java/android/os/WorkSource.java +81 −19 Original line number Diff line number Diff line Loading @@ -13,13 +13,15 @@ import android.util.Log; import android.util.proto.ProtoOutputStream; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.Preconditions; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Describes the source of some work that may be done by someone else. * Currently the public representation of what a work source is is not * Currently the public representation of what a work source is not * defined; this is an opaque container. */ public class WorkSource implements Parcelable { Loading Loading @@ -48,7 +50,7 @@ public class WorkSource implements Parcelable { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) static WorkSource sNewbWork; /** * For returning gone work form a modification operation. * For returning gone work from a modification operation. */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) static WorkSource sGoneWork; Loading Loading @@ -91,9 +93,14 @@ public class WorkSource implements Parcelable { } } /** @hide */ @UnsupportedAppUsage /** * Creates a work source with the given uid. * @param uid the uid performing the work * @hide */ @TestApi @SystemApi public WorkSource(int uid) { mNum = 1; mUids = new int[] { uid, 0 }; Loading @@ -101,14 +108,18 @@ public class WorkSource implements Parcelable { mChains = null; } /** @hide */ public WorkSource(int uid, String name) { if (name == null) { throw new NullPointerException("Name can't be null"); } /** * Creates a work source with the given uid and package name. * @param uid the uid performing the work * @param packageName the package performing the work * @hide */ @SystemApi public WorkSource(int uid, @NonNull String packageName) { Preconditions.checkNotNull(packageName, "packageName can't be null"); mNum = 1; mUids = new int[] { uid, 0 }; mNames = new String[] { name, null }; mNames = new String[] { packageName, null }; mChains = null; } Loading Loading @@ -138,17 +149,34 @@ public class WorkSource implements Parcelable { Global.CHAINED_BATTERY_ATTRIBUTION_ENABLED, 0) == 1; } /** @hide */ @UnsupportedAppUsage /** * Returns the size of this work source. * @hide */ @TestApi @SystemApi public int size() { return mNum; } /** @hide */ /** * @deprecated use {{@link #getUid(int)}} instead. * @hide */ @UnsupportedAppUsage @TestApi @Deprecated public int get(int index) { return getUid(index); } /** * Get the uid at the given index. * If {@code index} < 0 or {@code index} >= {@link #size() N}, then the behavior is undefined. * @hide */ @TestApi @SystemApi public int getUid(int index) { return mUids[index]; } Loading @@ -167,10 +195,25 @@ public class WorkSource implements Parcelable { return mNum > 0 ? mUids[0] : mChains.get(0).getAttributionUid(); } /** @hide */ /** * @deprecated use {{@link #getPackageName(int)}} instead. * @hide */ @UnsupportedAppUsage @TestApi @Deprecated public String getName(int index) { return getPackageName(index); } /** * Get the package name at the given index. * If {@code index} < 0 or {@code index} >= {@link #size() N}, then the behavior is undefined. * @hide */ @TestApi @SystemApi @Nullable public String getPackageName(int index) { return mNames != null ? mNames[index] : null; } Loading @@ -179,9 +222,8 @@ public class WorkSource implements Parcelable { * intact. * * <p>Useful when combining with another WorkSource that doesn't have names. * @hide */ public void clearNames() { private void clearNames() { if (mNames != null) { mNames = null; // Clear out any duplicate uids now that we don't have names to disambiguate them. Loading Loading @@ -406,6 +448,22 @@ public class WorkSource implements Parcelable { } } /** * Returns a copy of this work source without any package names. * If any {@link WorkChain WorkChains} are present, they are left intact. * * @return a {@link WorkSource} without any package names. * @hide */ @SystemApi @TestApi @NonNull public WorkSource withoutNames() { final WorkSource copy = new WorkSource(this); copy.clearNames(); return copy; } /** * Legacy API: DO NOT USE. Only in use from unit tests. * Loading Loading @@ -524,6 +582,8 @@ public class WorkSource implements Parcelable { * * @hide for internal use only. */ @SystemApi @TestApi public boolean isEmpty() { return mNum == 0 && (mChains == null || mChains.isEmpty()); } Loading @@ -532,7 +592,9 @@ public class WorkSource implements Parcelable { * @return the list of {@code WorkChains} associated with this {@code WorkSource}. * @hide */ public ArrayList<WorkChain> getWorkChains() { @SystemApi @Nullable public List<WorkChain> getWorkChains() { return mChains; } Loading core/java/com/android/internal/os/BatteryStatsImpl.java +27 −27 Original line number Diff line number Diff line Loading @@ -4086,7 +4086,7 @@ public class BatteryStatsImpl extends BatteryStats { if (workSource != null) { for (int i = 0; i < workSource.size(); ++i) { uid = mapUid(workSource.get(i)); uid = mapUid(workSource.getUid(i)); if (mActiveEvents.updateState(historyItem, name, uid, 0)) { addHistoryEventLocked(elapsedRealtime, uptime, historyItem, name, uid); } Loading Loading @@ -4114,8 +4114,8 @@ public class BatteryStatsImpl extends BatteryStats { String tag) { if (workSource != null) { for (int i = 0; i < workSource.size(); ++i) { uid = workSource.get(i); final String workSourceName = workSource.getName(i); uid = workSource.getUid(i); final String workSourceName = workSource.getPackageName(i); if (isOnBattery()) { BatteryStatsImpl.Uid.Pkg pkg = getPackageStatsLocked(uid, Loading @@ -4124,7 +4124,7 @@ public class BatteryStatsImpl extends BatteryStats { } } ArrayList<WorkChain> workChains = workSource.getWorkChains(); List<WorkChain> workChains = workSource.getWorkChains(); if (workChains != null) { for (int i = 0; i < workChains.size(); ++i) { final WorkChain wc = workChains.get(i); Loading Loading @@ -4350,7 +4350,7 @@ public class BatteryStatsImpl extends BatteryStats { final long uptime = mClocks.uptimeMillis(); final int N = ws.size(); for (int i=0; i<N; i++) { noteStartWakeLocked(ws.get(i), pid, null, name, historyName, type, noteStartWakeLocked(ws.getUid(i), pid, null, name, historyName, type, unimportantForLogging, elapsedRealtime, uptime); } Loading Loading @@ -4379,7 +4379,7 @@ public class BatteryStatsImpl extends BatteryStats { // First the starts : final int NN = newWs.size(); for (int i=0; i<NN; i++) { noteStartWakeLocked(newWs.get(i), newPid, null, newName, newHistoryName, newType, noteStartWakeLocked(newWs.getUid(i), newPid, null, newName, newHistoryName, newType, newUnimportantForLogging, elapsedRealtime, uptime); } if (wcs != null) { Loading @@ -4397,7 +4397,7 @@ public class BatteryStatsImpl extends BatteryStats { // Then the stops : final int NO = ws.size(); for (int i=0; i<NO; i++) { noteStopWakeLocked(ws.get(i), pid, null, name, historyName, type, elapsedRealtime, noteStopWakeLocked(ws.getUid(i), pid, null, name, historyName, type, elapsedRealtime, uptime); } if (wcs != null) { Loading @@ -4418,7 +4418,7 @@ public class BatteryStatsImpl extends BatteryStats { final long uptime = mClocks.uptimeMillis(); final int N = ws.size(); for (int i=0; i<N; i++) { noteStopWakeLocked(ws.get(i), pid, null, name, historyName, type, elapsedRealtime, noteStopWakeLocked(ws.getUid(i), pid, null, name, historyName, type, elapsedRealtime, uptime); } Loading @@ -4441,11 +4441,11 @@ public class BatteryStatsImpl extends BatteryStats { WorkSource workSource) { final int N = workSource.size(); for (int i = 0; i < N; ++i) { final int uid = mapUid(workSource.get(i)); final int uid = mapUid(workSource.getUid(i)); noteLongPartialWakeLockStartInternal(name, historyName, uid); } final ArrayList<WorkChain> workChains = workSource.getWorkChains(); final List<WorkChain> workChains = workSource.getWorkChains(); if (workChains != null) { for (int i = 0; i < workChains.size(); ++i) { final WorkChain workChain = workChains.get(i); Loading Loading @@ -4478,11 +4478,11 @@ public class BatteryStatsImpl extends BatteryStats { WorkSource workSource) { final int N = workSource.size(); for (int i = 0; i < N; ++i) { final int uid = mapUid(workSource.get(i)); final int uid = mapUid(workSource.getUid(i)); noteLongPartialWakeLockFinishInternal(name, historyName, uid); } final ArrayList<WorkChain> workChains = workSource.getWorkChains(); final List<WorkChain> workChains = workSource.getWorkChains(); if (workChains != null) { for (int i = 0; i < workChains.size(); ++i) { final WorkChain workChain = workChains.get(i); Loading Loading @@ -4615,11 +4615,11 @@ public class BatteryStatsImpl extends BatteryStats { public void noteGpsChangedLocked(WorkSource oldWs, WorkSource newWs) { for (int i = 0; i < newWs.size(); ++i) { noteStartGpsLocked(newWs.get(i), null); noteStartGpsLocked(newWs.getUid(i), null); } for (int i = 0; i < oldWs.size(); ++i) { noteStopGpsLocked((oldWs.get(i)), null); noteStopGpsLocked((oldWs.getUid(i)), null); } List<WorkChain>[] wcs = WorkSource.diffChains(oldWs, newWs); Loading Loading @@ -5564,7 +5564,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteBluetoothScanStartedFromSourceLocked(WorkSource ws, boolean isUnoptimized) { final int N = ws.size(); for (int i = 0; i < N; i++) { noteBluetoothScanStartedLocked(null, ws.get(i), isUnoptimized); noteBluetoothScanStartedLocked(null, ws.getUid(i), isUnoptimized); } final List<WorkChain> workChains = ws.getWorkChains(); Loading Loading @@ -5602,7 +5602,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteBluetoothScanStoppedFromSourceLocked(WorkSource ws, boolean isUnoptimized) { final int N = ws.size(); for (int i = 0; i < N; i++) { noteBluetoothScanStoppedLocked(null, ws.get(i), isUnoptimized); noteBluetoothScanStoppedLocked(null, ws.getUid(i), isUnoptimized); } final List<WorkChain> workChains = ws.getWorkChains(); Loading Loading @@ -5633,7 +5633,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteBluetoothScanResultsFromSourceLocked(WorkSource ws, int numNewResults) { final int N = ws.size(); for (int i = 0; i < N; i++) { int uid = mapUid(ws.get(i)); int uid = mapUid(ws.getUid(i)); getUidStatsLocked(uid).noteBluetoothScanResultsLocked(numNewResults); } Loading Loading @@ -5692,7 +5692,7 @@ public class BatteryStatsImpl extends BatteryStats { mGlobalWifiRunningTimer.startRunningLocked(elapsedRealtime); int N = ws.size(); for (int i=0; i<N; i++) { int uid = mapUid(ws.get(i)); int uid = mapUid(ws.getUid(i)); getUidStatsLocked(uid).noteWifiRunningLocked(elapsedRealtime); } Loading @@ -5715,7 +5715,7 @@ public class BatteryStatsImpl extends BatteryStats { final long elapsedRealtime = mClocks.elapsedRealtime(); int N = oldWs.size(); for (int i=0; i<N; i++) { int uid = mapUid(oldWs.get(i)); int uid = mapUid(oldWs.getUid(i)); getUidStatsLocked(uid).noteWifiStoppedLocked(elapsedRealtime); } Loading @@ -5729,7 +5729,7 @@ public class BatteryStatsImpl extends BatteryStats { N = newWs.size(); for (int i=0; i<N; i++) { int uid = mapUid(newWs.get(i)); int uid = mapUid(newWs.getUid(i)); getUidStatsLocked(uid).noteWifiRunningLocked(elapsedRealtime); } Loading Loading @@ -5757,7 +5757,7 @@ public class BatteryStatsImpl extends BatteryStats { mGlobalWifiRunningTimer.stopRunningLocked(elapsedRealtime); int N = ws.size(); for (int i=0; i<N; i++) { int uid = mapUid(ws.get(i)); int uid = mapUid(ws.getUid(i)); getUidStatsLocked(uid).noteWifiStoppedLocked(elapsedRealtime); } Loading Loading @@ -5963,7 +5963,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteFullWifiLockAcquiredFromSourceLocked(WorkSource ws) { int N = ws.size(); for (int i=0; i<N; i++) { final int uid = mapUid(ws.get(i)); final int uid = mapUid(ws.getUid(i)); noteFullWifiLockAcquiredLocked(uid); } Loading @@ -5980,7 +5980,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteFullWifiLockReleasedFromSourceLocked(WorkSource ws) { int N = ws.size(); for (int i=0; i<N; i++) { final int uid = mapUid(ws.get(i)); final int uid = mapUid(ws.getUid(i)); noteFullWifiLockReleasedLocked(uid); } Loading @@ -5997,7 +5997,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteWifiScanStartedFromSourceLocked(WorkSource ws) { int N = ws.size(); for (int i=0; i<N; i++) { final int uid = mapUid(ws.get(i)); final int uid = mapUid(ws.getUid(i)); noteWifiScanStartedLocked(uid); } Loading @@ -6014,7 +6014,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteWifiScanStoppedFromSourceLocked(WorkSource ws) { int N = ws.size(); for (int i=0; i<N; i++) { final int uid = mapUid(ws.get(i)); final int uid = mapUid(ws.getUid(i)); noteWifiScanStoppedLocked(uid); } Loading @@ -6031,7 +6031,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteWifiBatchedScanStartedFromSourceLocked(WorkSource ws, int csph) { int N = ws.size(); for (int i=0; i<N; i++) { noteWifiBatchedScanStartedLocked(ws.get(i), csph); noteWifiBatchedScanStartedLocked(ws.getUid(i), csph); } final List<WorkChain> workChains = ws.getWorkChains(); Loading @@ -6045,7 +6045,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteWifiBatchedScanStoppedFromSourceLocked(WorkSource ws) { int N = ws.size(); for (int i=0; i<N; i++) { noteWifiBatchedScanStoppedLocked(ws.get(i)); noteWifiBatchedScanStoppedLocked(ws.getUid(i)); } final List<WorkChain> workChains = ws.getWorkChains(); Loading Loading
api/system-current.txt +8 −0 Original line number Diff line number Diff line Loading @@ -5899,7 +5899,15 @@ package android.os { } public class WorkSource implements android.os.Parcelable { ctor public WorkSource(int); ctor public WorkSource(int, @NonNull String); method public android.os.WorkSource.WorkChain createWorkChain(); method @Nullable public String getPackageName(int); method public int getUid(int); method @Nullable public java.util.List<android.os.WorkSource.WorkChain> getWorkChains(); method public boolean isEmpty(); method public int size(); method @NonNull public android.os.WorkSource withoutNames(); } public static final class WorkSource.WorkChain implements android.os.Parcelable { Loading
api/test-current.txt +4 −2 Original line number Diff line number Diff line Loading @@ -2185,10 +2185,12 @@ package android.os { method public boolean add(int); method public boolean add(int, String); method @Deprecated public android.os.WorkSource addReturningNewbs(android.os.WorkSource); method public int get(int); method public String getName(int); method @Nullable public String getPackageName(int); method public int getUid(int); method public boolean isEmpty(); method @Deprecated public android.os.WorkSource[] setReturningDiffs(android.os.WorkSource); method public int size(); method @NonNull public android.os.WorkSource withoutNames(); } } Loading
core/java/android/os/StatsLogEventWrapper.java +1 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ public final class StatsLogEventWrapper implements Parcelable { out.writeLong(mElapsedTimeNs); out.writeLong(mWallClockTimeNs); if (mWorkSource != null) { ArrayList<android.os.WorkSource.WorkChain> workChains = mWorkSource.getWorkChains(); List<WorkSource.WorkChain> workChains = mWorkSource.getWorkChains(); // number of chains out.writeInt(workChains.size()); for (int i = 0; i < workChains.size(); i++) { Loading
core/java/android/os/WorkSource.java +81 −19 Original line number Diff line number Diff line Loading @@ -13,13 +13,15 @@ import android.util.Log; import android.util.proto.ProtoOutputStream; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.Preconditions; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Describes the source of some work that may be done by someone else. * Currently the public representation of what a work source is is not * Currently the public representation of what a work source is not * defined; this is an opaque container. */ public class WorkSource implements Parcelable { Loading Loading @@ -48,7 +50,7 @@ public class WorkSource implements Parcelable { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) static WorkSource sNewbWork; /** * For returning gone work form a modification operation. * For returning gone work from a modification operation. */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) static WorkSource sGoneWork; Loading Loading @@ -91,9 +93,14 @@ public class WorkSource implements Parcelable { } } /** @hide */ @UnsupportedAppUsage /** * Creates a work source with the given uid. * @param uid the uid performing the work * @hide */ @TestApi @SystemApi public WorkSource(int uid) { mNum = 1; mUids = new int[] { uid, 0 }; Loading @@ -101,14 +108,18 @@ public class WorkSource implements Parcelable { mChains = null; } /** @hide */ public WorkSource(int uid, String name) { if (name == null) { throw new NullPointerException("Name can't be null"); } /** * Creates a work source with the given uid and package name. * @param uid the uid performing the work * @param packageName the package performing the work * @hide */ @SystemApi public WorkSource(int uid, @NonNull String packageName) { Preconditions.checkNotNull(packageName, "packageName can't be null"); mNum = 1; mUids = new int[] { uid, 0 }; mNames = new String[] { name, null }; mNames = new String[] { packageName, null }; mChains = null; } Loading Loading @@ -138,17 +149,34 @@ public class WorkSource implements Parcelable { Global.CHAINED_BATTERY_ATTRIBUTION_ENABLED, 0) == 1; } /** @hide */ @UnsupportedAppUsage /** * Returns the size of this work source. * @hide */ @TestApi @SystemApi public int size() { return mNum; } /** @hide */ /** * @deprecated use {{@link #getUid(int)}} instead. * @hide */ @UnsupportedAppUsage @TestApi @Deprecated public int get(int index) { return getUid(index); } /** * Get the uid at the given index. * If {@code index} < 0 or {@code index} >= {@link #size() N}, then the behavior is undefined. * @hide */ @TestApi @SystemApi public int getUid(int index) { return mUids[index]; } Loading @@ -167,10 +195,25 @@ public class WorkSource implements Parcelable { return mNum > 0 ? mUids[0] : mChains.get(0).getAttributionUid(); } /** @hide */ /** * @deprecated use {{@link #getPackageName(int)}} instead. * @hide */ @UnsupportedAppUsage @TestApi @Deprecated public String getName(int index) { return getPackageName(index); } /** * Get the package name at the given index. * If {@code index} < 0 or {@code index} >= {@link #size() N}, then the behavior is undefined. * @hide */ @TestApi @SystemApi @Nullable public String getPackageName(int index) { return mNames != null ? mNames[index] : null; } Loading @@ -179,9 +222,8 @@ public class WorkSource implements Parcelable { * intact. * * <p>Useful when combining with another WorkSource that doesn't have names. * @hide */ public void clearNames() { private void clearNames() { if (mNames != null) { mNames = null; // Clear out any duplicate uids now that we don't have names to disambiguate them. Loading Loading @@ -406,6 +448,22 @@ public class WorkSource implements Parcelable { } } /** * Returns a copy of this work source without any package names. * If any {@link WorkChain WorkChains} are present, they are left intact. * * @return a {@link WorkSource} without any package names. * @hide */ @SystemApi @TestApi @NonNull public WorkSource withoutNames() { final WorkSource copy = new WorkSource(this); copy.clearNames(); return copy; } /** * Legacy API: DO NOT USE. Only in use from unit tests. * Loading Loading @@ -524,6 +582,8 @@ public class WorkSource implements Parcelable { * * @hide for internal use only. */ @SystemApi @TestApi public boolean isEmpty() { return mNum == 0 && (mChains == null || mChains.isEmpty()); } Loading @@ -532,7 +592,9 @@ public class WorkSource implements Parcelable { * @return the list of {@code WorkChains} associated with this {@code WorkSource}. * @hide */ public ArrayList<WorkChain> getWorkChains() { @SystemApi @Nullable public List<WorkChain> getWorkChains() { return mChains; } Loading
core/java/com/android/internal/os/BatteryStatsImpl.java +27 −27 Original line number Diff line number Diff line Loading @@ -4086,7 +4086,7 @@ public class BatteryStatsImpl extends BatteryStats { if (workSource != null) { for (int i = 0; i < workSource.size(); ++i) { uid = mapUid(workSource.get(i)); uid = mapUid(workSource.getUid(i)); if (mActiveEvents.updateState(historyItem, name, uid, 0)) { addHistoryEventLocked(elapsedRealtime, uptime, historyItem, name, uid); } Loading Loading @@ -4114,8 +4114,8 @@ public class BatteryStatsImpl extends BatteryStats { String tag) { if (workSource != null) { for (int i = 0; i < workSource.size(); ++i) { uid = workSource.get(i); final String workSourceName = workSource.getName(i); uid = workSource.getUid(i); final String workSourceName = workSource.getPackageName(i); if (isOnBattery()) { BatteryStatsImpl.Uid.Pkg pkg = getPackageStatsLocked(uid, Loading @@ -4124,7 +4124,7 @@ public class BatteryStatsImpl extends BatteryStats { } } ArrayList<WorkChain> workChains = workSource.getWorkChains(); List<WorkChain> workChains = workSource.getWorkChains(); if (workChains != null) { for (int i = 0; i < workChains.size(); ++i) { final WorkChain wc = workChains.get(i); Loading Loading @@ -4350,7 +4350,7 @@ public class BatteryStatsImpl extends BatteryStats { final long uptime = mClocks.uptimeMillis(); final int N = ws.size(); for (int i=0; i<N; i++) { noteStartWakeLocked(ws.get(i), pid, null, name, historyName, type, noteStartWakeLocked(ws.getUid(i), pid, null, name, historyName, type, unimportantForLogging, elapsedRealtime, uptime); } Loading Loading @@ -4379,7 +4379,7 @@ public class BatteryStatsImpl extends BatteryStats { // First the starts : final int NN = newWs.size(); for (int i=0; i<NN; i++) { noteStartWakeLocked(newWs.get(i), newPid, null, newName, newHistoryName, newType, noteStartWakeLocked(newWs.getUid(i), newPid, null, newName, newHistoryName, newType, newUnimportantForLogging, elapsedRealtime, uptime); } if (wcs != null) { Loading @@ -4397,7 +4397,7 @@ public class BatteryStatsImpl extends BatteryStats { // Then the stops : final int NO = ws.size(); for (int i=0; i<NO; i++) { noteStopWakeLocked(ws.get(i), pid, null, name, historyName, type, elapsedRealtime, noteStopWakeLocked(ws.getUid(i), pid, null, name, historyName, type, elapsedRealtime, uptime); } if (wcs != null) { Loading @@ -4418,7 +4418,7 @@ public class BatteryStatsImpl extends BatteryStats { final long uptime = mClocks.uptimeMillis(); final int N = ws.size(); for (int i=0; i<N; i++) { noteStopWakeLocked(ws.get(i), pid, null, name, historyName, type, elapsedRealtime, noteStopWakeLocked(ws.getUid(i), pid, null, name, historyName, type, elapsedRealtime, uptime); } Loading @@ -4441,11 +4441,11 @@ public class BatteryStatsImpl extends BatteryStats { WorkSource workSource) { final int N = workSource.size(); for (int i = 0; i < N; ++i) { final int uid = mapUid(workSource.get(i)); final int uid = mapUid(workSource.getUid(i)); noteLongPartialWakeLockStartInternal(name, historyName, uid); } final ArrayList<WorkChain> workChains = workSource.getWorkChains(); final List<WorkChain> workChains = workSource.getWorkChains(); if (workChains != null) { for (int i = 0; i < workChains.size(); ++i) { final WorkChain workChain = workChains.get(i); Loading Loading @@ -4478,11 +4478,11 @@ public class BatteryStatsImpl extends BatteryStats { WorkSource workSource) { final int N = workSource.size(); for (int i = 0; i < N; ++i) { final int uid = mapUid(workSource.get(i)); final int uid = mapUid(workSource.getUid(i)); noteLongPartialWakeLockFinishInternal(name, historyName, uid); } final ArrayList<WorkChain> workChains = workSource.getWorkChains(); final List<WorkChain> workChains = workSource.getWorkChains(); if (workChains != null) { for (int i = 0; i < workChains.size(); ++i) { final WorkChain workChain = workChains.get(i); Loading Loading @@ -4615,11 +4615,11 @@ public class BatteryStatsImpl extends BatteryStats { public void noteGpsChangedLocked(WorkSource oldWs, WorkSource newWs) { for (int i = 0; i < newWs.size(); ++i) { noteStartGpsLocked(newWs.get(i), null); noteStartGpsLocked(newWs.getUid(i), null); } for (int i = 0; i < oldWs.size(); ++i) { noteStopGpsLocked((oldWs.get(i)), null); noteStopGpsLocked((oldWs.getUid(i)), null); } List<WorkChain>[] wcs = WorkSource.diffChains(oldWs, newWs); Loading Loading @@ -5564,7 +5564,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteBluetoothScanStartedFromSourceLocked(WorkSource ws, boolean isUnoptimized) { final int N = ws.size(); for (int i = 0; i < N; i++) { noteBluetoothScanStartedLocked(null, ws.get(i), isUnoptimized); noteBluetoothScanStartedLocked(null, ws.getUid(i), isUnoptimized); } final List<WorkChain> workChains = ws.getWorkChains(); Loading Loading @@ -5602,7 +5602,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteBluetoothScanStoppedFromSourceLocked(WorkSource ws, boolean isUnoptimized) { final int N = ws.size(); for (int i = 0; i < N; i++) { noteBluetoothScanStoppedLocked(null, ws.get(i), isUnoptimized); noteBluetoothScanStoppedLocked(null, ws.getUid(i), isUnoptimized); } final List<WorkChain> workChains = ws.getWorkChains(); Loading Loading @@ -5633,7 +5633,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteBluetoothScanResultsFromSourceLocked(WorkSource ws, int numNewResults) { final int N = ws.size(); for (int i = 0; i < N; i++) { int uid = mapUid(ws.get(i)); int uid = mapUid(ws.getUid(i)); getUidStatsLocked(uid).noteBluetoothScanResultsLocked(numNewResults); } Loading Loading @@ -5692,7 +5692,7 @@ public class BatteryStatsImpl extends BatteryStats { mGlobalWifiRunningTimer.startRunningLocked(elapsedRealtime); int N = ws.size(); for (int i=0; i<N; i++) { int uid = mapUid(ws.get(i)); int uid = mapUid(ws.getUid(i)); getUidStatsLocked(uid).noteWifiRunningLocked(elapsedRealtime); } Loading @@ -5715,7 +5715,7 @@ public class BatteryStatsImpl extends BatteryStats { final long elapsedRealtime = mClocks.elapsedRealtime(); int N = oldWs.size(); for (int i=0; i<N; i++) { int uid = mapUid(oldWs.get(i)); int uid = mapUid(oldWs.getUid(i)); getUidStatsLocked(uid).noteWifiStoppedLocked(elapsedRealtime); } Loading @@ -5729,7 +5729,7 @@ public class BatteryStatsImpl extends BatteryStats { N = newWs.size(); for (int i=0; i<N; i++) { int uid = mapUid(newWs.get(i)); int uid = mapUid(newWs.getUid(i)); getUidStatsLocked(uid).noteWifiRunningLocked(elapsedRealtime); } Loading Loading @@ -5757,7 +5757,7 @@ public class BatteryStatsImpl extends BatteryStats { mGlobalWifiRunningTimer.stopRunningLocked(elapsedRealtime); int N = ws.size(); for (int i=0; i<N; i++) { int uid = mapUid(ws.get(i)); int uid = mapUid(ws.getUid(i)); getUidStatsLocked(uid).noteWifiStoppedLocked(elapsedRealtime); } Loading Loading @@ -5963,7 +5963,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteFullWifiLockAcquiredFromSourceLocked(WorkSource ws) { int N = ws.size(); for (int i=0; i<N; i++) { final int uid = mapUid(ws.get(i)); final int uid = mapUid(ws.getUid(i)); noteFullWifiLockAcquiredLocked(uid); } Loading @@ -5980,7 +5980,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteFullWifiLockReleasedFromSourceLocked(WorkSource ws) { int N = ws.size(); for (int i=0; i<N; i++) { final int uid = mapUid(ws.get(i)); final int uid = mapUid(ws.getUid(i)); noteFullWifiLockReleasedLocked(uid); } Loading @@ -5997,7 +5997,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteWifiScanStartedFromSourceLocked(WorkSource ws) { int N = ws.size(); for (int i=0; i<N; i++) { final int uid = mapUid(ws.get(i)); final int uid = mapUid(ws.getUid(i)); noteWifiScanStartedLocked(uid); } Loading @@ -6014,7 +6014,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteWifiScanStoppedFromSourceLocked(WorkSource ws) { int N = ws.size(); for (int i=0; i<N; i++) { final int uid = mapUid(ws.get(i)); final int uid = mapUid(ws.getUid(i)); noteWifiScanStoppedLocked(uid); } Loading @@ -6031,7 +6031,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteWifiBatchedScanStartedFromSourceLocked(WorkSource ws, int csph) { int N = ws.size(); for (int i=0; i<N; i++) { noteWifiBatchedScanStartedLocked(ws.get(i), csph); noteWifiBatchedScanStartedLocked(ws.getUid(i), csph); } final List<WorkChain> workChains = ws.getWorkChains(); Loading @@ -6045,7 +6045,7 @@ public class BatteryStatsImpl extends BatteryStats { public void noteWifiBatchedScanStoppedFromSourceLocked(WorkSource ws) { int N = ws.size(); for (int i=0; i<N; i++) { noteWifiBatchedScanStoppedLocked(ws.get(i)); noteWifiBatchedScanStoppedLocked(ws.getUid(i)); } final List<WorkChain> workChains = ws.getWorkChains(); Loading