am e525eef4: merge from open-source master
Merge commit 'e525eef4b8e284ac8eb023bd0df4eeed37916d4b' * commit 'e525eef4b8e284ac8eb023bd0df4eeed37916d4b': Update comment in mediaplayer.h. Update documentation for getVideoWidth and getVideoHeight. Make Uri.parseUserPart, parseHost, and parsePort symmetric Javadoc used startApplication() which doesnt exists, changed to createApplication()
This commit is contained in:
committed by
Android Git Automerger
commit
e910ef2258
@@ -1028,7 +1028,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
||||
}
|
||||
|
||||
private String parseHost() {
|
||||
String authority = getAuthority();
|
||||
String authority = getEncodedAuthority();
|
||||
if (authority == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -1037,9 +1037,11 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
||||
int userInfoSeparator = authority.indexOf('@');
|
||||
int portSeparator = authority.indexOf(':', userInfoSeparator);
|
||||
|
||||
return portSeparator == NOT_FOUND
|
||||
String encodedHost = portSeparator == NOT_FOUND
|
||||
? authority.substring(userInfoSeparator + 1)
|
||||
: authority.substring(userInfoSeparator + 1, portSeparator);
|
||||
|
||||
return decode(encodedHost);
|
||||
}
|
||||
|
||||
private volatile int port = NOT_CALCULATED;
|
||||
@@ -1051,7 +1053,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
||||
}
|
||||
|
||||
private int parsePort() {
|
||||
String authority = getAuthority();
|
||||
String authority = getEncodedAuthority();
|
||||
if (authority == null) {
|
||||
return -1;
|
||||
}
|
||||
@@ -1065,7 +1067,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> {
|
||||
return -1;
|
||||
}
|
||||
|
||||
String portString = authority.substring(portSeparator + 1);
|
||||
String portString = decode(authority.substring(portSeparator + 1));
|
||||
try {
|
||||
return Integer.parseInt(portString);
|
||||
} catch (NumberFormatException e) {
|
||||
|
||||
@@ -75,7 +75,7 @@ enum media_error_type {
|
||||
// 'notify' is invoked with the following:
|
||||
// 'msg' is set to MEDIA_INFO.
|
||||
// 'ext1' should be a value from the enum media_info_type.
|
||||
// 'ext2' contains an implementation dependant error code to provide
|
||||
// 'ext2' contains an implementation dependant info code to provide
|
||||
// more details. Should default to 0 when not used.
|
||||
//
|
||||
// The codes are distributed as follow:
|
||||
|
||||
@@ -870,8 +870,10 @@ public class MediaPlayer
|
||||
* Returns the width of the video.
|
||||
*
|
||||
* @return the width of the video, or 0 if there is no video,
|
||||
* no display surface was set, or prepare()/prepareAsync()
|
||||
* have not completed yet
|
||||
* no display surface was set, or the width has not been determined
|
||||
* yet. The OnVideoSizeChangedListener can be registered via
|
||||
* {@link #setOnVideoSizeChangedListener(OnVideoSizeChangedListener)}
|
||||
* to provide a notification when the width is available.
|
||||
*/
|
||||
public native int getVideoWidth();
|
||||
|
||||
@@ -879,8 +881,10 @@ public class MediaPlayer
|
||||
* Returns the height of the video.
|
||||
*
|
||||
* @return the height of the video, or 0 if there is no video,
|
||||
* no display surface was set, or prepare()/prepareAsync()
|
||||
* have not completed yet
|
||||
* no display surface was set, or the height has not been determined
|
||||
* yet. The OnVideoSizeChangedListener can be registered via
|
||||
* {@link #setOnVideoSizeChangedListener(OnVideoSizeChangedListener)}
|
||||
* to provide a notification when the height is available.
|
||||
*/
|
||||
public native int getVideoHeight();
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ import android.content.Context;
|
||||
* Context.
|
||||
* You can create and inject alternative types of Contexts by calling
|
||||
* {@link AndroidTestCase#setContext(Context) setContext()}. You must do this <i>before</i> calling
|
||||
* startApplication(). The test framework provides a
|
||||
* {@link #createApplication()}. The test framework provides a
|
||||
* number of alternatives for Context, including {@link android.test.mock.MockContext MockContext},
|
||||
* {@link android.test.RenamingDelegatingContext RenamingDelegatingContext}, and
|
||||
* {@link android.content.ContextWrapper ContextWrapper}.
|
||||
|
||||
@@ -171,6 +171,11 @@ public class UriTest extends TestCase {
|
||||
assertEquals("bob lee", uri.getUserInfo());
|
||||
assertEquals("bob%20lee", uri.getEncodedUserInfo());
|
||||
|
||||
uri = Uri.parse("http://bob%40lee%3ajr@local%68ost:4%32");
|
||||
assertEquals("bob@lee:jr", uri.getUserInfo());
|
||||
assertEquals("localhost", uri.getHost());
|
||||
assertEquals(42, uri.getPort());
|
||||
|
||||
uri = Uri.parse("http://localhost");
|
||||
assertEquals("localhost", uri.getHost());
|
||||
assertEquals(-1, uri.getPort());
|
||||
|
||||
Reference in New Issue
Block a user