merge from open-source master

This commit is contained in:
Jean-Baptiste Queru
2009-09-01 11:46:14 -07:00
7 changed files with 32 additions and 40 deletions

View File

@@ -20,7 +20,25 @@ import android.text.TextUtils;
/**
* Bit definitions for an integer defining the basic content type of text
* held in an {@link Editable} object.
* held in an {@link Editable} object. Supported classes may be combined
* with variations and flags to indicate desired behaviors.
*
* <h3>Examples</h3>
*
* <dl>
* <dt>A password field with with the password visible to the user:
* <dd>inputType = TYPE_CLASS_TEXT |
* TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
*
* <dt>A multi-line postal address with automatic capitalization:
* <dd>inputType = TYPE_CLASS_TEXT |
* TYPE_TEXT_VARIATION_POSTAL_ADDRESS |
* TYPE_TEXT_FLAG_MULTI_LINE
*
* <dt>A time field:
* <dd>inputType = TYPE_CLASS_DATETIME |
* TYPE_DATETIME_VARIATION_TIME
* </dl>
*/
public interface InputType {
/**

View File

@@ -72,8 +72,8 @@ resources are required by other applications.</li>
runs in isolation from the code of all other applications.</li>
<li>By default, each application is assigned a unique Linux user ID.
Permissions are set so that the application's files are visible only
that user, only to the application itself &mdash; although there are ways
Permissions are set so that the application's files are visible only to
that user and only to the application itself &mdash; although there are ways
to export them to other applications as well.</li>
</ul>

View File

@@ -93,28 +93,6 @@ protected boolean isRouteDisplayed() {
}
</pre>
<p>You can actually run this now, but all it does is allow you to pan around the map.</p>
<p>Android provides a handy {@link android.widget.ZoomControls} widget for zooming in and out of a View.
MapView can automatically hook one for us by requesting it with the <code>getZoomControls()</code>
method. Let's do this.</p>
<li>Go back to the layout file. We need a new ViewGroup element, in which we'll
place the ZoomControls. Just below the MapView element (but inside the RelativeLayout), add this element:
<pre>
&lt;LinearLayout
android:id="@+id/zoomview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/mapview"
android:layout_centerHorizontal="true"
/></pre>
<p>It doesn't really matter what kind of ViewGroup we use, because we just want a
container that we can position within our root RelativeLayout.</p>
<p>The last two attributes are available only to an element that's a child of a
RelativeLayout. <code>layout_alignBottom</code> aligns the bottom of this element to the bottom of
the element identified with a resource tag (which must be a sibling to this element).
<code>layout_centerHorizontal</code> centers this on the horizontal plane.</p></li>
<li>Now go back to the HelloMapView class. We'll now retrieve the ZoomControls object from
the MapView and add it to our new layout element. First, at the top of the HelloMapView,
@@ -122,24 +100,18 @@ method. Let's do this.</p>
<pre>
LinearLayout linearLayout;
MapView mapView;
ZoomControls mZoom;</pre></li>
</pre>
<li>Then initialize each of these in <code>onCreate()</code>. We'll capture the LinearLayout and
MapView through their layout resources. Then get the ZoomControls from the MapView::
<pre>
linearLayout = (LinearLayout) findViewById(R.id.zoomview);
mapView = (MapView) findViewById(R.id.mapview);
mZoom = (ZoomControls) mapView.getZoomControls();</pre>
mapView.setBuiltInZoomControls(true);
</pre>
<p>By using the ZoomControls object provided by MapView, we don't have to do any of the work
required to actually perform the zoom operations. The ZoomControls widget that MapView
returns for us is already hooked into the MapView and works as soon as we add it to the
layout. The controls will appear whenever the user touches the map, then dissapear after
a few moments of inactivity.</p></li>
<li>Now just plug our ZoomControls into the LinearLayout we added:
<pre>linearLayout.addView(mZoom);</pre></li>
<p>By using the built-in zoom control provided by MapView, we don't have to do any of the work
required to actually perform the zoom operations. The controls will appear whenever the user
touches the map, then disappear after a few moments of inactivity.</p></li>
<li>Run it.</li>
</ol>

View File

@@ -720,7 +720,8 @@ public class MediaPlayer
}
/**
* Sets the data source (FileDescriptor) to use. It is the caller's responsibility
* Sets the data source (FileDescriptor) to use. The FileDescriptor must be
* seekable (N.B. a LocalSocket is not seekable). It is the caller's responsibility
* to close the file descriptor. It is safe to do so as soon as this call returns.
*
* @param fd the FileDescriptor for the file you want to play

View File

@@ -1517,7 +1517,7 @@ class GLLogWrapper extends GLWrapperBase {
arg("count", count);
startLogIndices();
for (int i = 0; i < count; i++) {
doElement(mStringBuilder, i, first + count);
doElement(mStringBuilder, i, first + i);
}
endLogIndices();
end();

View File

@@ -5877,6 +5877,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
}
// If the target requires a specific UID, always fail for others.
if (reqUid >= 0 && uid != reqUid) {
Log.w(TAG, "Permission denied: checkComponentPermission() reqUid=" + reqUid);
return PackageManager.PERMISSION_DENIED;
}
if (permission == null) {

View File

@@ -228,7 +228,7 @@ status_t StringPool::writeStringBlock(const sp<AaptFile>& pool)
}
dat += (preSize+strPos)/sizeof(uint16_t);
if (lenSize > sizeof(uint16_t)) {
*dat = htods(0x8000 | ((strSize>>16)&0x7ffff));
*dat = htods(0x8000 | ((strSize>>16)&0x7fff));
dat++;
}
*dat++ = htods(strSize);