diff options
3 files changed, 39 insertions, 47 deletions
diff --git a/core/jni/android/graphics/Typeface.cpp b/core/jni/android/graphics/Typeface.cpp index 238ece1..7c7bfeb 100644 --- a/core/jni/android/graphics/Typeface.cpp +++ b/core/jni/android/graphics/Typeface.cpp @@ -46,7 +46,7 @@ static SkTypeface* Typeface_createFromTypeface(JNIEnv* env, jobject, SkTypeface* } static void Typeface_unref(JNIEnv* env, jobject obj, SkTypeface* face) { - face->unref(); + SkSafeUnref(face); } static int Typeface_getStyle(JNIEnv* env, jobject obj, SkTypeface* face) { diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 5c0f352..08eceac 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -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; } } @@ -661,8 +672,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { tracker = mNetTrackers[usedNetworkType]; if(usedNetworkType != networkType) { Integer currentPid = new Integer(pid); - reassessPidDns(pid, true); mNetRequestersPids[usedNetworkType].remove(currentPid); + reassessPidDns(pid, true); if (mNetRequestersPids[usedNetworkType].size() != 0) { if (DBG) Log.d(TAG, "not tearing down special network - " + "others still using it"); @@ -1198,14 +1209,32 @@ public class ConnectivityService extends IConnectivityManager.Stub { } pw.println(); for (NetworkStateTracker nst : mNetTrackers) { - if (nst.getNetworkInfo().isConnected()) { - pw.println("Active network: " + nst.getNetworkInfo(). - getTypeName()); + if (nst != null) { + if (nst.getNetworkInfo().isConnected()) { + pw.println("Active network: " + nst.getNetworkInfo(). + getTypeName()); + } + pw.println(nst.getNetworkInfo()); + pw.println(nst); + pw.println(); + } + } + + pw.println("Network Requester Pids:"); + for (int net : mPriorityList) { + String pidString = net + ": "; + for (Object pid : mNetRequestersPids[net]) { + pidString = pidString + pid.toString() + ", "; } - pw.println(nst.getNetworkInfo()); - pw.println(nst); - pw.println(); + 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. diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java index d014a7e..7b60474 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java @@ -748,7 +748,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { } private void notifyDefaultData(String reason) { - setupDnsProperties(); setState(State.CONNECTED); phone.notifyDataConnection(reason); startNetStatPoll(); @@ -757,42 +756,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { mReregisterOnReconnectFailure = false; } - private void setupDnsProperties() { - int mypid = android.os.Process.myPid(); - String[] servers = getDnsServers(null); - String propName; - String propVal; - int count; - - count = 0; - for (int i = 0; i < servers.length; i++) { - String serverAddr = servers[i]; - if (!TextUtils.equals(serverAddr, "0.0.0.0")) { - SystemProperties.set("net.dns" + (i+1) + "." + mypid, serverAddr); - count++; - } - } - for (int i = count+1; i <= 4; i++) { - propName = "net.dns" + i + "." + mypid; - propVal = SystemProperties.get(propName); - if (propVal.length() != 0) { - SystemProperties.set(propName, ""); - } - } - /* - * Bump the property that tells the name resolver library - * to reread the DNS server list from the properties. - */ - propVal = SystemProperties.get("net.dnschange"); - if (propVal.length() != 0) { - try { - int n = Integer.parseInt(propVal); - SystemProperties.set("net.dnschange", "" + (n+1)); - } catch (NumberFormatException e) { - } - } - } - /** * This is a kludge to deal with the fact that * the PDP state change notification doesn't always work |
