}
static void onMessageReceived(Context context, final String appId, final Bundle extras) {
- final String PUSH_API_DATA_KEY = "data";
- if (!extras.containsKey(PUSH_API_DATA_KEY)) {
+ final String pushApiDataKey = "data";
+ if (!extras.containsKey(pushApiDataKey)) {
// For now on Android only the Push API uses GCMDriver. To avoid double-handling of
// messages already handled in Java by other implementations of MultiplexingGcmListener,
// and unnecessarily waking up the browser processes for all existing GCM messages that
ThreadUtils.assertOnUiThread();
launchNativeThen(context, new Runnable() {
@Override public void run() {
- final String BUNDLE_SENDER_ID = "from";
- final String BUNDLE_COLLAPSE_KEY = "collapse_key";
- final String BUNDLE_GCMMPLEX = "com.google.ipc.invalidation.gcmmplex.";
+ final String bundleSenderId = "from";
+ final String bundleCollapseKey = "collapse_key";
+ final String bundleGcmplex = "com.google.ipc.invalidation.gcmmplex.";
- String senderId = extras.getString(BUNDLE_SENDER_ID);
- String collapseKey = extras.getString(BUNDLE_COLLAPSE_KEY);
+ String senderId = extras.getString(bundleSenderId);
+ String collapseKey = extras.getString(bundleCollapseKey);
List<String> dataKeysAndValues = new ArrayList<String>();
for (String key : extras.keySet()) {
// TODO(johnme): Check there aren't other keys that we need to exclude.
- if (key == BUNDLE_SENDER_ID || key == BUNDLE_COLLAPSE_KEY ||
- key.startsWith(BUNDLE_GCMMPLEX))
+ if (key == bundleSenderId || key == bundleCollapseKey ||
+ key.startsWith(bundleGcmplex))
continue;
dataKeysAndValues.add(key);
dataKeysAndValues.add(extras.getString(key));