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

Commit 8c48b4a5 authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Android Git Automerger
Browse files

am 1a337547: Merge "Add bugreport info about network feature use. DO NOT MERGE" into eclair

Merge commit '1a337547' into eclair-plus-aosp

* commit '1a337547':
  Add bugreport info about network feature use. DO NOT MERGE
parents 70660425 1a337547
Loading
Loading
Loading
Loading
+37 −8
Original line number Diff line number Diff line
@@ -454,6 +454,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
        IBinder mBinder;
        int mPid;
        int mUid;
        long mCreateTime;

        FeatureUser(int type, String feature, IBinder binder) {
            super();
@@ -462,6 +463,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
            mBinder = binder;
            mPid = getCallingPid();
            mUid = getCallingUid();
            mCreateTime = System.currentTimeMillis();

            try {
                mBinder.linkToDeath(this, 0);
@@ -476,15 +478,22 @@ public class ConnectivityService extends IConnectivityManager.Stub {

        public void binderDied() {
            Log.d(TAG, "ConnectivityService FeatureUser binderDied(" +
                    mNetworkType + ", " + mFeature + ", " + mBinder);
                    mNetworkType + ", " + mFeature + ", " + mBinder + "), created " +
                    (System.currentTimeMillis() - mCreateTime) + " mSec ago");
            stopUsingNetworkFeature(this, false);
        }

        public void expire() {
            Log.d(TAG, "ConnectivityService FeatureUser expire(" +
                    mNetworkType + ", " + mFeature + ", " + mBinder);
                    mNetworkType + ", " + mFeature + ", " + mBinder +"), created " +
                    (System.currentTimeMillis() - mCreateTime) + " mSec ago");
            stopUsingNetworkFeature(this, false);
        }

        public String toString() {
            return "FeatureUser("+mNetworkType+","+mFeature+","+mPid+","+mUid+"), created " +
                    (System.currentTimeMillis() - mCreateTime) + " mSec ago";
        }
    }

    // javadoc from interface
@@ -596,6 +605,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
            return stopUsingNetworkFeature(u, true);
        } else {
            // none found!
            if (DBG) Log.d(TAG, "ignoring stopUsingNetworkFeature - not a live request");
            return 1;
        }
    }
@@ -640,6 +650,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
                    if (x.mUid == u.mUid && x.mPid == u.mPid &&
                            x.mNetworkType == u.mNetworkType &&
                            TextUtils.equals(x.mFeature, u.mFeature)) {
                        if (DBG) Log.d(TAG, "ignoring stopUsingNetworkFeature as dup is found");
                        return 1;
                    }
                }
@@ -1198,6 +1209,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
        }
        pw.println();
        for (NetworkStateTracker nst : mNetTrackers) {
            if (nst != null) {
                if (nst.getNetworkInfo().isConnected()) {
                    pw.println("Active network: " + nst.getNetworkInfo().
                            getTypeName());
@@ -1208,6 +1220,23 @@ public class ConnectivityService extends IConnectivityManager.Stub {
            }
        }

        pw.println("Network Requester Pids:");
        for (int net : mPriorityList) {
            String pidString = net + ": ";
            for (Object pid : mNetRequestersPids[net]) {
                pidString = pidString + pid.toString() + ", ";
            }
            pw.println(pidString);
        }
        pw.println();

        pw.println("FeatureUsers:");
        for (Object requester : mFeatureUsers) {
            pw.println(requester.toString());
        }
        pw.println();
    }

    // must be stateless - things change under us.
    private class MyHandler extends Handler {
        @Override