diff options
| -rw-r--r-- | core/java/android/view/ScaleGestureDetector.java | 37 | ||||
| -rw-r--r-- | docs/html/guide/developing/debug-tasks.jd | 26 | ||||
| -rw-r--r-- | services/java/com/android/server/ConnectivityService.java | 45 | ||||
| -rw-r--r-- | services/java/com/android/server/WifiService.java | 11 |
4 files changed, 93 insertions, 26 deletions
diff --git a/core/java/android/view/ScaleGestureDetector.java b/core/java/android/view/ScaleGestureDetector.java index 50bfefcebb88..2f1c2b2dacf1 100644 --- a/core/java/android/view/ScaleGestureDetector.java +++ b/core/java/android/view/ScaleGestureDetector.java @@ -185,12 +185,16 @@ public class ScaleGestureDetector { final float x1 = getRawX(event, 1); final float y1 = getRawY(event, 1); - boolean p0sloppy = x0 < edgeSlop || y0 < edgeSlop || - x1 < edgeSlop || y1 < edgeSlop; - boolean p1sloppy = x0 > rightSlop || y0 > bottomSlop || - x1 > rightSlop || y1 > bottomSlop; - - if (p0sloppy) { + boolean p0sloppy = x0 < edgeSlop || y0 < edgeSlop + || x0 > rightSlop || y0 > bottomSlop; + boolean p1sloppy = x1 < edgeSlop || y1 < edgeSlop + || x1 > rightSlop || y1 > bottomSlop; + + if(p0sloppy && p1sloppy) { + mFocusX = -1; + mFocusY = -1; + mSloppyGesture = true; + } else if (p0sloppy) { mFocusX = event.getX(1); mFocusY = event.getY(1); mSloppyGesture = true; @@ -211,12 +215,15 @@ public class ScaleGestureDetector { final float x1 = getRawX(event, 1); final float y1 = getRawY(event, 1); - boolean p0sloppy = x0 < edgeSlop || y0 < edgeSlop || - x1 < edgeSlop || y1 < edgeSlop; - boolean p1sloppy = x0 > rightSlop || y0 > bottomSlop || - x1 > rightSlop || y1 > bottomSlop; + boolean p0sloppy = x0 < edgeSlop || y0 < edgeSlop + || x0 > rightSlop || y0 > bottomSlop; + boolean p1sloppy = x1 < edgeSlop || y1 < edgeSlop + || x1 > rightSlop || y1 > bottomSlop; - if (p0sloppy) { + if(p0sloppy && p1sloppy) { + mFocusX = -1; + mFocusY = -1; + } else if (p0sloppy) { mFocusX = event.getX(1); mFocusY = event.getY(1); } else if (p1sloppy) { @@ -226,6 +233,14 @@ public class ScaleGestureDetector { mSloppyGesture = false; mGestureInProgress = mListener.onScaleBegin(this); } + } else if ((action == MotionEvent.ACTION_POINTER_1_UP + || action == MotionEvent.ACTION_POINTER_2_UP) + && mSloppyGesture) { + // Set focus point to the remaining finger + int id = (((action & MotionEvent.ACTION_POINTER_ID_MASK) + >> MotionEvent.ACTION_POINTER_ID_SHIFT) == 0) ? 1 : 0; + mFocusX = event.getX(id); + mFocusY = event.getY(id); } } else { // Transform gesture in progress - attempt to handle it diff --git a/docs/html/guide/developing/debug-tasks.jd b/docs/html/guide/developing/debug-tasks.jd index 975f6998a75f..a980efc2fe0b 100644 --- a/docs/html/guide/developing/debug-tasks.jd +++ b/docs/html/guide/developing/debug-tasks.jd @@ -80,13 +80,25 @@ href="#additionaldebugging">Debugging and Testing with Dev Tools</a> below.</dd> <h2 id="additionaldebugging">Debugging and Testing with Dev Tools</h2> -<p>With the Dev Tools application, you can turn on a number of settings that will -make it easier to test and debug your applications. The Dev Tools application is automatically -installed on all system images included with the SDK. The source code for the Dev Tools application -is also provided in the SDK samples so that you may build it and then install the application on any -development device.</p> +<p>With the Dev Tools application, you can enable a number of settings on your device that will +make it easier to test and debug your applications.</p> + +<p>The Dev Tools application is installed by default +on all system images included with the SDK, so you can use it with the Android Emulator. If you'd +like to install the Dev Tools application on a real development device, you can copy the +application from your emulator and then install it on your device using ADB. To copy the +application from a running emulator, execute: +</p> +<pre> +adb -e pull /system/app/Development.apk ./Development.apk +</pre> +<p>This copies the .apk file into the current directory. Then install it on your connected device +with:</p> +<pre> +adb -d install Development.apk +</pre> -<p>To get to the development settings page on the emulator, launch the Dev Tools application and +<p>To get started, launch the Dev Tools application and select Development Settings. This will open the Development Settings page with the following options (among others):</p> @@ -132,7 +144,7 @@ following options (among others):</p> can happen during debugging.</dd> </dl> -<p>These settings will be remembered across emulator restarts. </p> +<p>These settings will be remembered across emulator restarts.</p> <h2 id="DebuggingWebPages">Debugging Web Pages</h2> diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 14c70bc05f3b..08eceac4b37c 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; } } @@ -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/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java index b29e7693ffae..3a08e4d2cbfb 100644 --- a/services/java/com/android/server/WifiService.java +++ b/services/java/com/android/server/WifiService.java @@ -329,6 +329,17 @@ public class WifiService extends IWifiManager.Stub { return false; } + /** + * Multiple calls to unregisterReceiver() cause exception and a system crash. + * This can happen if a supplicant is lost (or firmware crash occurs) and user indicates + * disable wifi at the same time. + * Avoid doing a disable when the current Wifi state is UNKNOWN + * TODO: Handle driver load fail and supplicant lost as seperate states + */ + if (mWifiState == WIFI_STATE_UNKNOWN && !enable) { + return false; + } + setWifiEnabledState(enable ? WIFI_STATE_ENABLING : WIFI_STATE_DISABLING, uid); if (enable) { |