summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chris Tate <ctate@android.com> 2016-03-31 22:22:30 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-03-31 22:22:32 +0000
commit1486557d10f9969ef31b65e4312bd00b1a6f02ae (patch)
treebda018bc0da7fdd964aedeb1adc091e3ff717271
parent2159f7017dddaa376dd30786c7e6dcc0ecdf4cfb (diff)
parent250985f556a0cb60ced826b8c9a34a11e29db008 (diff)
Merge "Handle interaction of Bundle.hasFileDescriptors() with removal" into nyc-dev
-rw-r--r--core/java/android/os/Bundle.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/os/Bundle.java b/core/java/android/os/Bundle.java
index 05dd48b12e55..11280749f05b 100644
--- a/core/java/android/os/Bundle.java
+++ b/core/java/android/os/Bundle.java
@@ -208,6 +208,18 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
}
/**
+ * Removes any entry with the given key from the mapping of this Bundle.
+ *
+ * @param key a String key
+ */
+ public void remove(String key) {
+ super.remove(key);
+ if ((mFlags & FLAG_HAS_FDS) != 0) {
+ mFlags &= ~FLAG_HAS_FDS_KNOWN;
+ }
+ }
+
+ /**
* Inserts all mappings from the given Bundle into this Bundle.
*
* @param bundle a Bundle
@@ -288,6 +300,8 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
if (fdFound) {
mFlags |= FLAG_HAS_FDS;
+ } else {
+ mFlags &= ~FLAG_HAS_FDS;
}
mFlags |= FLAG_HAS_FDS_KNOWN;
}
@@ -315,6 +329,8 @@ public final class Bundle extends BaseBundle implements Cloneable, Parcelable {
mMap.removeAt(i);
}
}
+ mFlags |= FLAG_HAS_FDS_KNOWN;
+ mFlags &= ~FLAG_HAS_FDS;
}
/**