<commit_before>package org.dosomething.android.receivers;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.urbanairship.UAirship;
import com.urbanairship.push.PushManager;

import org.dosomething.android.DSConstants;
import org.dosomething.android.activities.SplashScreenActivity;

import java.util.Arrays;
import java.util.List;
import java.util.Set;

/**
 * Receiver to handle Urban Airship push notification events.
 */
public class UAPushNotificationReceiver extends BroadcastReceiver {
    private static final String TAG = "UA_PUSH_RECEIVER";

    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();

        if (action.equals(PushManager.ACTION_NOTIFICATION_OPENED)) {
            Log.v(TAG, "ACTION_NOTIFICATION_OPENED");

            if (!DSConstants.inProduction) {
                debugPushExtras(intent);
            }

            // Launches the app to the splash screen
            Intent launch = new Intent(Intent.ACTION_MAIN);
            launch.setClass(UAirship.shared().getApplicationContext(), SplashScreenActivity.class);
            launch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<commit_msg>UA push notification's open event tracked in GA and Flurry<commit_after>package org.dosomething.android.receivers;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.urbanairship.UAirship;
import com.urbanairship.push.PushManager;

import org.dosomething.android.DSConstants;
import org.dosomething.android.activities.SplashScreenActivity;
import org.dosomething.android.analytics.Analytics;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Set;

/**
 * Receiver to handle Urban Airship push notification events.
 */
public class UAPushNotificationReceiver extends BroadcastReceiver {
    private static final String TAG = "UA_PUSH_RECEIVER";

    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();

        if (action.equals(PushManager.ACTION_NOTIFICATION_OPENED)) {
            if (!DSConstants.inProduction) {
                debugPushExtras(intent);
            }

            // Launches the app to the splash screen
            Intent launch = new Intent(Intent.ACTION_MAIN);
            launch.setClass(UAirship.shared().getApplicationContext(), SplashScreenActivity.class);
            launch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

            // Log the open event to Analytics
            String eventTag = "UA_PUSH";
            String eventAction = "OPEN";
            String msg = intent.getStringExtra(PushManager.EXTRA_ALERT);

            HashMap<String, String> param = new HashMap<String, String>();
            param.put(eventAction, msg);

            Analytics.logEvent(eventTag, param); // Flurry Analytics wrapper
            Analytics.logEvent(eventTag, eventAction, msg); // Google Analytics wrapper
{'fraction_non_alphanumeric': 0.08844415752098128, 'fraction_numerical': 0.0, 'mean_word_length': 3.4589928057553956, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2280411', 'n_tokens_mistral': 869, 'n_tokens_neox': 825, 'n_words': 192}