frameworks/base
Revision | 1b9f4b344512e0ce3d03f96c0f4b850c826a75b3 (tree) |
---|---|
Time | 2018-04-10 16:12:44 |
Author | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
Merge tag 'android-8.1.0_r22' into oreo-x86
Android 8.1.0 release 22
@@ -71,7 +71,7 @@ public final class PeriodicAdvertisingReport implements Parcelable { | ||
71 | 71 | @Override |
72 | 72 | public void writeToParcel(Parcel dest, int flags) { |
73 | 73 | dest.writeInt(syncHandle); |
74 | - dest.writeLong(txPower); | |
74 | + dest.writeInt(txPower); | |
75 | 75 | dest.writeInt(rssi); |
76 | 76 | dest.writeInt(dataStatus); |
77 | 77 | if (data != null) { |
@@ -409,6 +409,7 @@ public final class OutputConfiguration implements Parcelable { | ||
409 | 409 | this.mConfiguredSize = other.mConfiguredSize; |
410 | 410 | this.mConfiguredGenerationId = other.mConfiguredGenerationId; |
411 | 411 | this.mIsDeferredConfig = other.mIsDeferredConfig; |
412 | + this.mIsShared = other.mIsShared; | |
412 | 413 | } |
413 | 414 | |
414 | 415 | /** |
@@ -421,6 +422,7 @@ public final class OutputConfiguration implements Parcelable { | ||
421 | 422 | int width = source.readInt(); |
422 | 423 | int height = source.readInt(); |
423 | 424 | boolean isDeferred = source.readInt() == 1; |
425 | + boolean isShared = source.readInt() == 1; | |
424 | 426 | ArrayList<Surface> surfaces = new ArrayList<Surface>(); |
425 | 427 | source.readTypedList(surfaces, Surface.CREATOR); |
426 | 428 |
@@ -431,6 +433,7 @@ public final class OutputConfiguration implements Parcelable { | ||
431 | 433 | mSurfaces = surfaces; |
432 | 434 | mConfiguredSize = new Size(width, height); |
433 | 435 | mIsDeferredConfig = isDeferred; |
436 | + mIsShared = isShared; | |
434 | 437 | mSurfaces = surfaces; |
435 | 438 | if (mSurfaces.size() > 0) { |
436 | 439 | mSurfaceType = SURFACE_TYPE_UNKNOWN; |
@@ -720,6 +720,10 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { | ||
720 | 720 | LOOP: while (end < length) { |
721 | 721 | switch (uriString.charAt(end)) { |
722 | 722 | case '/': // Start of path |
723 | + case '\\':// Start of path | |
724 | + // Per http://url.spec.whatwg.org/#host-state, the \ character | |
725 | + // is treated as if it were a / character when encountered in a | |
726 | + // host | |
723 | 727 | case '?': // Start of query |
724 | 728 | case '#': // Start of fragment |
725 | 729 | break LOOP; |
@@ -758,6 +762,10 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { | ||
758 | 762 | case '#': // Start of fragment |
759 | 763 | return ""; // Empty path. |
760 | 764 | case '/': // Start of path! |
765 | + case '\\':// Start of path! | |
766 | + // Per http://url.spec.whatwg.org/#host-state, the \ character | |
767 | + // is treated as if it were a / character when encountered in a | |
768 | + // host | |
761 | 769 | break LOOP; |
762 | 770 | } |
763 | 771 | pathStart++; |
@@ -98,6 +98,8 @@ public final class VerifyCredentialResponse implements Parcelable { | ||
98 | 98 | if (mPayload != null) { |
99 | 99 | dest.writeInt(mPayload.length); |
100 | 100 | dest.writeByteArray(mPayload); |
101 | + } else { | |
102 | + dest.writeInt(0); | |
101 | 103 | } |
102 | 104 | } |
103 | 105 | } |
@@ -192,6 +192,12 @@ public class UriTest extends TestCase { | ||
192 | 192 | assertEquals("a:a@example.com:a@example2.com", uri.getAuthority()); |
193 | 193 | assertEquals("example2.com", uri.getHost()); |
194 | 194 | assertEquals(-1, uri.getPort()); |
195 | + assertEquals("/path", uri.getPath()); | |
196 | + | |
197 | + uri = Uri.parse("http://a.foo.com\\.example.com/path"); | |
198 | + assertEquals("a.foo.com", uri.getHost()); | |
199 | + assertEquals(-1, uri.getPort()); | |
200 | + assertEquals("\\.example.com/path", uri.getPath()); | |
195 | 201 | } |
196 | 202 | |
197 | 203 | @SmallTest |
@@ -813,7 +813,13 @@ const char* ResStringPool::string8At(size_t idx, size_t* outLen) const | ||
813 | 813 | *outLen = encLen; |
814 | 814 | |
815 | 815 | if ((uint32_t)(str+encLen-strings) < mStringPoolSize) { |
816 | - return (const char*)str; | |
816 | + // Reject malformed (non null-terminated) strings | |
817 | + if (str[encLen] != 0x00) { | |
818 | + ALOGW("Bad string block: string #%d is not null-terminated", | |
819 | + (int)idx); | |
820 | + return NULL; | |
821 | + } | |
822 | + return (const char*)str; | |
817 | 823 | } else { |
818 | 824 | ALOGW("Bad string block: string #%d extends to %d, past end at %d\n", |
819 | 825 | (int)idx, (int)(str+encLen-strings), (int)mStringPoolSize); |
@@ -847,8 +847,8 @@ public class RttManager { | ||
847 | 847 | } |
848 | 848 | dest.writeByte(result.LCR.id); |
849 | 849 | if (result.LCR.id != (byte) 0xFF) { |
850 | - dest.writeInt((byte) result.LCR.data.length); | |
851 | - dest.writeByte(result.LCR.id); | |
850 | + dest.writeByte((byte) result.LCR.data.length); | |
851 | + dest.writeByteArray(result.LCR.data); | |
852 | 852 | } |
853 | 853 | dest.writeByte(result.secure ? (byte) 1 : 0); |
854 | 854 | } |