<commit_before>
package com.worldspotlightapp.android.ui;

import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.api.GoogleApiClient;
import com.worldspotlightapp.android.R;
import com.worldspotlightapp.android.interfaces.IOnActionBarRequestListener;
import com.worldspotlightapp.android.maincontroller.MainController;
import com.worldspotlightapp.android.maincontroller.modules.activitytrackermodule.IActivityTrackerModule;
import com.worldspotlightapp.android.maincontroller.modules.citymodule.AbstractCityModuleObservable;
import com.worldspotlightapp.android.maincontroller.modules.eventstrackingmodule.IEventsTrackingModule;
import com.worldspotlightapp.android.maincontroller.modules.gpslocalizationmodule.IGpsLocalizationModule;
import com.worldspotlightapp.android.maincontroller.modules.notificationmodule.INotificationModule;
import com.worldspotlightapp.android.maincontroller.modules.usermodule.AbstractUserDataModuleObservable;
import com.worldspotlightapp.android.maincontroller.modules.videosmodule.AbstractVideosModuleObservable;

/**
 * Abstract base class created to be extended by all the activities.
 * It contain the follow features
 * - Connection with MainController and all its modules
 * - Check for Google Play services
 */
public abstract class AbstractBaseActivity extends AppCompatActivity implements
        GoogleApiClient.OnConnectionFailedListener, MainController.IOnMainControllerInstantiatedListener,
        IOnActionBarRequestListener {

    private static final String TAG = "AbstractBaseActivity";

    //    Request code to use when launching the resolution activity
    private static final int REQUEST_RESOLVE_ERROR = 99999;

    // YouTube Package Name
    private static final String YOU_TUBE_PACKAGE_NAME = "com.google.android.youtube";

    protected Context mContext;
    protected Intent mIntent;
    protected ActionBar mActionBar;
    protected MainController mMainController;
    protected INotificationModule mNotificationModule;
    protected AbstractUserDataModuleObservable mUserDataModule;
    protected IGpsLocalizationModule mGpsLocalizationModule;
    protected AbstractVideosModuleObservable mVideosModule;
    protected IEventsTrackingModule mEventTrackingModule;
    protected IActivityTrackerModule mActivityTrackerModule;
    protected AbstractCityModuleObservable mCityModuleObservable;

    // Special variables for GpsLocalizationModule
    private boolean isRegisteredForLocalizationService;
    private boolean mResolvingError;
    //    Unique tag for the error dialog fragment
    private static final String DIALOG_ERROR = "dialog_error";
    private static final String STATE_RESOLVING_ERROR = "resolving_error";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mContext = this;

        mIntent = getIntent();

        mActionBar = getSupportActionBar();

        // Get the data
        mMainController = MainController.getCurrentInstance(mContext);
        mNotificationModule = mMainController.getNotificationModule();
        mUserDataModule = mMainController.getUserDataModule();
        mGpsLocalizationModule = mMainController.getGpsLocalizationModule();
        mVideosModule = mMainController.getVideosModule();
        mEventTrackingModule = mMainController.getEventTrackingModule();
        mActivityTrackerModule = mMainController.getActivityTrackerModule();
<commit_msg>Fixed a but in the Abstract Activity which does not retrieved the city module<commit_after>
package com.worldspotlightapp.android.ui;

import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.api.GoogleApiClient;
import com.worldspotlightapp.android.R;
import com.worldspotlightapp.android.interfaces.IOnActionBarRequestListener;
import com.worldspotlightapp.android.maincontroller.MainController;
import com.worldspotlightapp.android.maincontroller.modules.activitytrackermodule.IActivityTrackerModule;
import com.worldspotlightapp.android.maincontroller.modules.citymodule.AbstractCityModuleObservable;
import com.worldspotlightapp.android.maincontroller.modules.eventstrackingmodule.IEventsTrackingModule;
import com.worldspotlightapp.android.maincontroller.modules.gpslocalizationmodule.IGpsLocalizationModule;
import com.worldspotlightapp.android.maincontroller.modules.notificationmodule.INotificationModule;
import com.worldspotlightapp.android.maincontroller.modules.usermodule.AbstractUserDataModuleObservable;
import com.worldspotlightapp.android.maincontroller.modules.videosmodule.AbstractVideosModuleObservable;

/**
 * Abstract base class created to be extended by all the activities.
 * It contain the follow features
 * - Connection with MainController and all its modules
 * - Check for Google Play services
 */
public abstract class AbstractBaseActivity extends AppCompatActivity implements
        GoogleApiClient.OnConnectionFailedListener, MainController.IOnMainControllerInstantiatedListener,
        IOnActionBarRequestListener {

    private static final String TAG = "AbstractBaseActivity";

    //    Request code to use when launching the resolution activity
    private static final int REQUEST_RESOLVE_ERROR = 99999;

    // YouTube Package Name
    private static final String YOU_TUBE_PACKAGE_NAME = "com.google.android.youtube";

    protected Context mContext;
    protected Intent mIntent;
    protected ActionBar mActionBar;
    protected MainController mMainController;
    protected INotificationModule mNotificationModule;
    protected AbstractUserDataModuleObservable mUserDataModule;
    protected IGpsLocalizationModule mGpsLocalizationModule;
    protected AbstractVideosModuleObservable mVideosModule;
    protected IEventsTrackingModule mEventTrackingModule;
    protected IActivityTrackerModule mActivityTrackerModule;
    protected AbstractCityModuleObservable mCityModuleObservable;

    // Special variables for GpsLocalizationModule
    private boolean isRegisteredForLocalizationService;
    private boolean mResolvingError;
    //    Unique tag for the error dialog fragment
    private static final String DIALOG_ERROR = "dialog_error";
    private static final String STATE_RESOLVING_ERROR = "resolving_error";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mContext = this;

        mIntent = getIntent();

        mActionBar = getSupportActionBar();

        // Get the data
        mMainController = MainController.getCurrentInstance(mContext);
        mNotificationModule = mMainController.getNotificationModule();
        mUserDataModule = mMainController.getUserDataModule();
        mGpsLocalizationModule = mMainController.getGpsLocalizationModule();
        mVideosModule = mMainController.getVideosModule();
        mEventTrackingModule = mMainController.getEventTrackingModule();
        mActivityTrackerModule = mMainController.getActivityTrackerModule();
        mCityModuleObservable = mMainController.getCityModuleObservable();

{'fraction_non_alphanumeric': 0.061065830721003134, 'fraction_numerical': 0.0017554858934169279, 'mean_word_length': 5.516339869281046, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4266730', 'n_tokens_mistral': 2019, 'n_tokens_neox': 1959, 'n_words': 435}