diff options
-rw-r--r-- | core/java/android/text/method/Touch.java | 43 | ||||
-rw-r--r-- | core/java/android/view/View.java | 12 | ||||
-rw-r--r-- | docs/html/guide/topics/usb/adk.jd | 9 | ||||
-rw-r--r-- | docs/html/sdk/sdk_toc.cs | 3 | ||||
-rw-r--r-- | docs/html/sdk/tools-notes.jd | 47 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 9 | ||||
-rw-r--r-- | services/java/com/android/server/ConnectivityService.java | 3 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java | 4 |
8 files changed, 85 insertions, 45 deletions
diff --git a/core/java/android/text/method/Touch.java b/core/java/android/text/method/Touch.java index 3f9b94563a0b..106a80190b36 100644 --- a/core/java/android/text/method/Touch.java +++ b/core/java/android/text/method/Touch.java @@ -35,44 +35,39 @@ public class Touch { * Y position. */ public static void scrollTo(TextView widget, Layout layout, int x, int y) { - int padding = widget.getTotalPaddingTop() + - widget.getTotalPaddingBottom(); - int top = layout.getLineForVertical(y); - int bottom = layout.getLineForVertical(y + widget.getHeight() - - padding); + final int verticalPadding = widget.getTotalPaddingTop() + widget.getTotalPaddingBottom(); + final int top = layout.getLineForVertical(y); + final int bottom = layout.getLineForVertical(y + widget.getHeight() - verticalPadding); int left = Integer.MAX_VALUE; int right = 0; - Alignment a = null; - boolean ltr = true; + Alignment a = layout.getParagraphAlignment(top); + boolean ltr = layout.getParagraphDirection(top) > 0; for (int i = top; i <= bottom; i++) { left = (int) Math.min(left, layout.getLineLeft(i)); right = (int) Math.max(right, layout.getLineRight(i)); - - if (a == null) { - a = layout.getParagraphAlignment(i); - ltr = layout.getParagraphDirection(i) > 0; - } } - padding = widget.getTotalPaddingLeft() + widget.getTotalPaddingRight(); - int width = widget.getWidth(); - int diff = 0; + final int hoizontalPadding = widget.getTotalPaddingLeft() + widget.getTotalPaddingRight(); + final int availableWidth = widget.getWidth() - hoizontalPadding; + final int actualWidth = right - left; - // align_opposite does NOT mean align_right, we need the paragraph - // direction to resolve it to left or right - if (right - left < width - padding) { + if (actualWidth < availableWidth) { if (a == Alignment.ALIGN_CENTER) { - diff = (width - padding - (right - left)) / 2; - } else if (ltr == (a == Alignment.ALIGN_OPPOSITE)) { - diff = width - padding - (right - left); + x = left - ((availableWidth - actualWidth) / 2); + } else if ((ltr && (a == Alignment.ALIGN_OPPOSITE)) || (a == Alignment.ALIGN_RIGHT)) { + // align_opposite does NOT mean align_right, we need the paragraph + // direction to resolve it to left or right + x = left - (availableWidth - actualWidth); + } else { + x = left; } + } else { + x = Math.min(x, right - availableWidth); + x = Math.max(x, left); } - x = Math.min(x, right - (width - padding) - diff); - x = Math.max(x, left - diff); - widget.scrollTo(x, y); } diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index ca06b9cf118a..f993160f1829 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -12969,15 +12969,13 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * Request that the visibility of the status bar be changed. * @param visibility Bitwise-or of flags {@link #SYSTEM_UI_FLAG_LOW_PROFILE} or * {@link #SYSTEM_UI_FLAG_HIDE_NAVIGATION}. - * - * This value will be re-applied immediately, even if the flags have not changed, so a view may - * easily reassert a particular SystemUiVisibility condition even if the system UI itself has - * since countermanded the original request. */ public void setSystemUiVisibility(int visibility) { - mSystemUiVisibility = visibility; - if (mParent != null && mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) { - mParent.recomputeViewAttributes(this); + if (visibility != mSystemUiVisibility) { + mSystemUiVisibility = visibility; + if (mParent != null && mAttachInfo != null && !mAttachInfo.mRecomputeGlobalAttributes) { + mParent.recomputeViewAttributes(this); + } } } diff --git a/docs/html/guide/topics/usb/adk.jd b/docs/html/guide/topics/usb/adk.jd index 463ec9c2015a..120576bf5bc0 100644 --- a/docs/html/guide/topics/usb/adk.jd +++ b/docs/html/guide/topics/usb/adk.jd @@ -77,6 +77,10 @@ page.title=Android Open Accessory Development Kit DIY Drones</a></li> <li><a href= + "http://mbed.org/order/"> + mbed</a></li> + + <li><a href= "http://www.microchip.com/android"> Microchip</a></li> @@ -130,6 +134,11 @@ page.title=Android Open Accessory Development Kit Drones</a> provides an Arduino-compatible board geared towards RC (radio controlled) and UAV (unmanned aerial vehicle) enthusiasts.</li> + <li><a href="http://mbed.org/order/">mbed</a> provides a microcontroller and a library + to develop accessories that support the Android accessory protocol. For more information, see + <a href="http://mbed.org/cookbook/mbed-with-Android-ADK">mbed with the Android ADK</a>. + </li> + <li><a href="http://www.microchip.com/android">Microchip</a> provides a PIC based USB microcontroller board.</li> diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs index 92b912d3fdc7..8a57312a4690 100644 --- a/docs/html/sdk/sdk_toc.cs +++ b/docs/html/sdk/sdk_toc.cs @@ -142,7 +142,8 @@ class="new">new!</span></li> </li> </ul> <ul> - <li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r12</a></li> + <li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r13</a> <span +class="new">new!</span></li> <li><a href="<?cs var:toroot ?>sdk/win-usb.html">Google USB Driver, r4</a></li> <li><a href="<?cs var:toroot ?>sdk/compatibility-library.html">Compatibility Package, r3</a></li> diff --git a/docs/html/sdk/tools-notes.jd b/docs/html/sdk/tools-notes.jd index 8c4d0378e79c..2179cec6036d 100644 --- a/docs/html/sdk/tools-notes.jd +++ b/docs/html/sdk/tools-notes.jd @@ -4,7 +4,7 @@ page.title=SDK Tools <p>SDK Tools is a downloadable component for the Android SDK. It includes the complete set of development and debugging tools for the Android SDK. </p> -<p>If you are new to the Android SDK, the <a +<p>If you are new to the Android SDK, the <a href="{@docRoot}sdk/index.html">SDK starter package</a> installs the latest revision of the SDK Tools in the <code><sdk>/tools</code> directory.</p> @@ -66,6 +66,35 @@ padding: .25em 1em; <div class="toggleable opened"> <a href="#" onclick="return toggleDiv(this)"> <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" /> +SDK Tools, Revision 13</a> <em>(September 2011)</em> + <div class="toggleme"> + <dl> +<dt>Dependencies:</dt> +<dd> +<p>If you are developing in Eclipse with ADT, note that the SDK Tools r13 is designed for use with +ADT 12.0.0 and later. If you haven't already, we highly recommend updating your <a +href="{@docRoot}sdk/eclipse-adt.html">ADT Plugin</a> to 12.0.0.</p> + +<p>If you are developing outside Eclipse, you must have <a href="http://ant.apache.org/">Apache +Ant</a> 1.8 or later.</p> + +<dt>General notes:</dt> +<dd> + <ul> + <li>Fix compilation issue in Ant (<code>dex</code> step) when paths have spaces.</li> + <li>Fix issue in emulator installation when paths have spaces.</li> + <li>Fix issue when AVD paths have spaces.</li> + <li>Fix rendering issue when using emulator scaling (<a href="http://code.google.com/p/android/issues/detail?id=18299">see more</a>).</li> + </ul> +</dd> +</dl> +</div> +</div> + + +<div class="toggleable closed"> + <a href="#" onclick="return toggleDiv(this)"> + <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" /> SDK Tools, Revision 12</a> <em>(July 2011)</em> <div class="toggleme"> <dl> @@ -396,7 +425,7 @@ install SDK Tools r4 in your SDK. </p></dd> <dt>General notes:</dt> <dd> <ul> -<li>Launcher script now forces GDK_NATIVE_WINDOW=true (linux only), to fix a +<li>Launcher script now forces GDK_NATIVE_WINDOW=true (linux only), to fix a compatibility issue between GTK and SWT.</li> </ul> </dd> @@ -405,7 +434,7 @@ compatibility issue between GTK and SWT.</li> <dd> <ul> <li>AVD Launch dialog now shows scale value.</li> -<li>Fixes potential NPE in SDK Manager on AVD launch, for older AVD with no +<li>Fixes potential NPE in SDK Manager on AVD launch, for older AVD with no skin name specified.</li> <li>Fixes XML validation issue in on older Java versions.</li> <li>No longer forces the use of Java 1.5 on Mac OS X.</li> @@ -470,7 +499,7 @@ display the trace.</li> <dd> <ul> <li>Provides a new UI that lets you set options for controlling -the emulator skin, screen size/density, and scale factor used when launching +the emulator skin, screen size/density, and scale factor used when launching an AVD.</li> <li>Provides improved AVD creation UI, which lets you customize the hardware properties of your AVDs.</li> @@ -481,11 +510,11 @@ between SDK add-ons and platforms.</li> <dt>Layoutopt, a new tool for optimizing layouts:</dt> -<dd><p>The SDK Tools r3 package includes <code>layoutopt</code>, a new command-line -tool that helps you optimize your layout hierarchies. When run against your -layout files, the tool analyzes their hierarchies and notifies you of -inefficiencies and other potential issues. The tool also provides simple -solutions for the issues it finds. For usage, see <a +<dd><p>The SDK Tools r3 package includes <code>layoutopt</code>, a new command-line +tool that helps you optimize your layout hierarchies. When run against your +layout files, the tool analyzes their hierarchies and notifies you of +inefficiencies and other potential issues. The tool also provides simple +solutions for the issues it finds. For usage, see <a href="/guide/developing/tools/layoutopt.html">layoutopt</a>.</p> </dd> </dl> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 8fc844882334..da6bcd21a329 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -2031,8 +2031,13 @@ public class PhoneStatusBar extends StatusBar { // The user is not allowed to get stuck without navigation UI. Upon the slightest user // interaction we bring the navigation back. public void userActivity() { - if (mNavigationBarView != null) { - mNavigationBarView.setHidden(false); + if (0 != (mSystemUiVisibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION)) { + try { + mBarService.setSystemUiVisibility( + mSystemUiVisibility & ~View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); + } catch (RemoteException ex) { + // weep softly + } } } diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 2b1638b83b02..86ac296c2c95 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -2618,7 +2618,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { } } if (VDBG) log("changing default proxy to " + proxy); - if ((proxy == null && mGlobalProxy == null) || proxy.equals(mGlobalProxy)) return; + + // global trumps default, if set, ignore this. if (mGlobalProxy != null) return; sendProxyBroadcast(proxy); } diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java index ebf5e65a3d9d..c62ccc68ce26 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java @@ -1768,8 +1768,10 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { ApnSetting apn = apnContext.getApnSetting(); if (apn.proxy != null && apn.proxy.length() != 0) { try { + String port = apn.port; + if (TextUtils.isEmpty(port)) port = "8080"; ProxyProperties proxy = new ProxyProperties(apn.proxy, - Integer.parseInt(apn.port), null); + Integer.parseInt(port), null); dcac.setLinkPropertiesHttpProxySync(proxy); } catch (NumberFormatException e) { loge("onDataSetupComplete: NumberFormatException making ProxyProperties (" + |