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

Commit d9137ca8 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Add time stamp to content provider connection.

For help in tracking down memory use issues, seeing how long
a connection has been held that is keeping other processes around.

Let's call this for issue #6577613: Unbelievably sluggish nexus-S

Change-Id: Ia3d016c5ed9d2155eea18ec884047e1e1d8a0ad5
parent 3c144c3e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.server.am;

import android.os.Binder;
import android.os.SystemClock;
import android.util.TimeUtils;

/**
 * Represents a link between a content provider and client.
@@ -24,6 +26,7 @@ import android.os.Binder;
public class ContentProviderConnection extends Binder {
    public final ContentProviderRecord provider;
    public final ProcessRecord client;
    public final long createTime;
    public int stableCount;
    public int unstableCount;
    // The client of this connection is currently waiting for the provider to appear.
@@ -39,6 +42,7 @@ public class ContentProviderConnection extends Binder {
    public ContentProviderConnection(ContentProviderRecord _provider, ProcessRecord _client) {
        provider = _provider;
        client = _client;
        createTime = SystemClock.elapsedRealtime();
    }

    public String toString() {
@@ -83,5 +87,8 @@ public class ContentProviderConnection extends Binder {
        if (dead) {
            sb.append(" DEAD");
        }
        long nowReal = SystemClock.elapsedRealtime();
        sb.append(" ");
        TimeUtils.formatDuration(nowReal-createTime, sb);
    }
}