Commit 203afa5b authored by johnme@chromium.org's avatar johnme@chromium.org

GCMDriver.java shouldn't pass on special MultiplexingGcmListener keys

MultiplexingGcmListener includes special keys in the intent Bundle like:
- com.google.ipc.invalidation.gcmmplex.listener.WAKELOCK_NAME
- com.google.ipc.invalidation.gcmmplex.MESSAGE

GCMDriver should ignore these, rather than passing them on to C++.

BUG=350384
R=fgorski@chromium.org

Review URL: https://codereview.chromium.org/326113002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276652 0039d316-1c4b-4281-b951-d872f2087c98
parent 28647c83
...@@ -91,14 +91,16 @@ public final class GCMDriver { ...@@ -91,14 +91,16 @@ public final class GCMDriver {
@Override public void run() { @Override public void run() {
final String BUNDLE_SENDER_ID = "from"; final String BUNDLE_SENDER_ID = "from";
final String BUNDLE_COLLAPSE_KEY = "collapse_key"; final String BUNDLE_COLLAPSE_KEY = "collapse_key";
final String BUNDLE_GCMMPLEX = "com.google.ipc.invalidation.gcmmplex.";
String senderId = extras.getString(BUNDLE_SENDER_ID); String senderId = extras.getString(BUNDLE_SENDER_ID);
String collapseKey = extras.getString(BUNDLE_COLLAPSE_KEY); String collapseKey = extras.getString(BUNDLE_COLLAPSE_KEY);
List<String> dataKeysAndValues = new ArrayList<String>(); List<String> dataKeysAndValues = new ArrayList<String>();
for (String key : extras.keySet()) { for (String key : extras.keySet()) {
// TODO(johnme): Check there aren't other default keys that we need to exclude. // TODO(johnme): Check there aren't other keys that we need to exclude.
if (key == BUNDLE_SENDER_ID || key == BUNDLE_COLLAPSE_KEY) if (key == BUNDLE_SENDER_ID || key == BUNDLE_COLLAPSE_KEY ||
key.startsWith(BUNDLE_GCMMPLEX))
continue; continue;
dataKeysAndValues.add(key); dataKeysAndValues.add(key);
dataKeysAndValues.add(extras.getString(key)); dataKeysAndValues.add(extras.getString(key));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment