Loading services/core/java/com/android/server/am/ContentProviderConnection.java +12 −6 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ public final class ContentProviderConnection extends Binder implements public final String clientPackage; public AssociationState.SourceState association; public final long createTime; private Object mProcStatsLock; // Internal lock for accessing AssociationState private volatile Object mProcStatsLock; // Internal lock for accessing AssociationState /** * Internal lock that guards access to the two counters. Loading Loading @@ -118,21 +118,27 @@ public final class ContentProviderConnection extends Binder implements * Track the given proc state change. */ public void trackProcState(int procState, int seq) { if (association != null) { if (association == null) { return; // early exit to optimize on oomadj cycles } synchronized (mProcStatsLock) { if (association != null) { // due to race-conditions, association may have become null association.trackProcState(procState, seq, SystemClock.uptimeMillis()); } } } public void stopAssociation() { if (association != null) { if (association == null) { return; // early exit to optimize on oomadj cycles } synchronized (mProcStatsLock) { if (association != null) { // due to race-conditions, association may have become null association.stop(); } association = null; } } } public String toString() { StringBuilder sb = new StringBuilder(128); Loading Loading
services/core/java/com/android/server/am/ContentProviderConnection.java +12 −6 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ public final class ContentProviderConnection extends Binder implements public final String clientPackage; public AssociationState.SourceState association; public final long createTime; private Object mProcStatsLock; // Internal lock for accessing AssociationState private volatile Object mProcStatsLock; // Internal lock for accessing AssociationState /** * Internal lock that guards access to the two counters. Loading Loading @@ -118,21 +118,27 @@ public final class ContentProviderConnection extends Binder implements * Track the given proc state change. */ public void trackProcState(int procState, int seq) { if (association != null) { if (association == null) { return; // early exit to optimize on oomadj cycles } synchronized (mProcStatsLock) { if (association != null) { // due to race-conditions, association may have become null association.trackProcState(procState, seq, SystemClock.uptimeMillis()); } } } public void stopAssociation() { if (association != null) { if (association == null) { return; // early exit to optimize on oomadj cycles } synchronized (mProcStatsLock) { if (association != null) { // due to race-conditions, association may have become null association.stop(); } association = null; } } } public String toString() { StringBuilder sb = new StringBuilder(128); Loading