summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Samuel Tan <samueltan@google.com> 2015-12-17 09:55:24 -0800
committer android-build-merger <android-build-merger@google.com> 2015-12-17 09:55:24 -0800
commita6d4744e894fe2d580f0a0ec0970f171d29ae40b (patch)
treee60566a4b46af83b3c8c791b89cc7e2dd434c21f
parent76d3072dd691666f451e8101d1053f66bd800e33 (diff)
parent4981ae908349767fee7976cc82c54a7fb00ee4fd (diff)
Merge "Add comments to keep Java and native binder PersistableBundle in sync" am: 6de926a7d6
am: 4981ae9083 * commit '4981ae908349767fee7976cc82c54a7fb00ee4fd': Add comments to keep Java and native binder PersistableBundle in sync
-rw-r--r--core/java/android/os/BaseBundle.java6
-rw-r--r--core/java/android/os/Parcel.java3
2 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/os/BaseBundle.java b/core/java/android/os/BaseBundle.java
index cd483b104489..ee7bd9acec77 100644
--- a/core/java/android/os/BaseBundle.java
+++ b/core/java/android/os/BaseBundle.java
@@ -32,7 +32,9 @@ public class BaseBundle {
private static final String TAG = "Bundle";
static final boolean DEBUG = false;
+ // Keep in sync with frameworks/native/libs/binder/PersistableBundle.cpp.
static final int BUNDLE_MAGIC = 0x4C444E42; // 'B' 'N' 'D' 'L'
+
static final Parcel EMPTY_PARCEL;
static {
@@ -1308,6 +1310,8 @@ public class BaseBundle {
* @param parcel The parcel to copy this bundle to.
*/
void writeToParcelInner(Parcel parcel, int flags) {
+ // Keep implementation in sync with writeToParcel() in
+ // frameworks/native/libs/binder/PersistableBundle.cpp.
if (mParcelledData != null) {
if (mParcelledData == EMPTY_PARCEL) {
parcel.writeInt(0);
@@ -1345,6 +1349,8 @@ public class BaseBundle {
* @param parcel The parcel to overwrite this bundle from.
*/
void readFromParcelInner(Parcel parcel) {
+ // Keep implementation in sync with readFromParcel() in
+ // frameworks/native/libs/binder/PersistableBundle.cpp.
int length = parcel.readInt();
readFromParcelInner(parcel, length);
}
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java
index 290202194732..26312475297c 100644
--- a/core/java/android/os/Parcel.java
+++ b/core/java/android/os/Parcel.java
@@ -204,6 +204,7 @@ public final class Parcel {
private static final Parcel[] sOwnedPool = new Parcel[POOL_SIZE];
private static final Parcel[] sHolderPool = new Parcel[POOL_SIZE];
+ // Keep in sync with frameworks/native/libs/binder/PersistableBundle.cpp.
private static final int VAL_NULL = -1;
private static final int VAL_STRING = 0;
private static final int VAL_INTEGER = 1;
@@ -704,6 +705,8 @@ public final class Parcel {
writeInt(-1);
return;
}
+ // Keep the format of this Parcel in sync with writeToParcelInner() in
+ // frameworks/native/libs/binder/PersistableBundle.cpp.
final int N = val.size();
writeInt(N);
if (DEBUG_ARRAY_MAP) {