<commit_before>package de.jonasrottmann.realmbrowser;

import android.app.Activity;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v4.app.NotificationCompat;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import io.realm.RealmObject;

public final class RealmBrowser {

    public static final int NOTIFICATION_ID = 1000;

    private static final RealmBrowser sInstance = new RealmBrowser();
    private final List<Class<? extends RealmObject>> mRealmModelList;



    private RealmBrowser() {
        mRealmModelList = new ArrayList<>();
    }



    public static RealmBrowser getInstance() {
        return sInstance;
    }



    public static void startRealmFilesActivity(@NonNull Activity activity) {
        RealmFilesActivity.start(activity);
    }



    public static void startRealmModelsActivity(@NonNull Activity activity, @NonNull String realmFileName) {
        RealmModelsActivity.start(activity, realmFileName);
    }



    public static void showRealmFilesNotification(@NonNull Activity activity) {
        showRealmNotification(activity, RealmFilesActivity.class);
    }



    private static void showRealmNotification(@NonNull Activity activity, @NonNull Class activityClass) {
        NotificationCompat.Builder builder = new NotificationCompat.Builder(activity)
                .setSmallIcon(R.drawable.ic_rb)
                .setContentTitle(activity.getString(R.string.rb_title))
                .setContentText(activity.getString(R.string.rb_click_to_launch))
                .setAutoCancel(false);
        Intent notifyIntent = new Intent(activity, activityClass);
        notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        PendingIntent notifyPendingIntent =
                PendingIntent.getActivity(activity, 0, notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT);
        builder.setContentIntent(notifyPendingIntent);
        NotificationManager mNotificationManager =
                (NotificationManager) activity.getSystemService(Context.NOTIFICATION_SERVICE);
        mNotificationManager.notify(NOTIFICATION_ID, builder.build());
    }



    public List<Class<? extends RealmObject>> getRealmModelList() {
        return mRealmModelList;
    }



    @SafeVarargs
    public final void addRealmModel(Class<? extends RealmObject>... arr) {
        mRealmModelList.addAll(Arrays.asList(arr));
    }
}<commit_msg>changed parameter of RealmBrowser start methods from Activity to Context<commit_after>package de.jonasrottmann.realmbrowser;

import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v4.app.NotificationCompat;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import io.realm.RealmObject;

public final class RealmBrowser {

    public static final int NOTIFICATION_ID = 1000;

    private static final RealmBrowser sInstance = new RealmBrowser();
    private final List<Class<? extends RealmObject>> mRealmModelList;



    private RealmBrowser() {
        mRealmModelList = new ArrayList<>();
    }



    public static RealmBrowser getInstance() {
        return sInstance;
    }



    public static void startRealmFilesActivity(@NonNull Context context) {
        RealmFilesActivity.start(context);
    }



    public static void startRealmModelsActivity(@NonNull Context context, @NonNull String realmFileName) {
        RealmModelsActivity.start(context, realmFileName);
    }



    public static void showRealmFilesNotification(@NonNull Context context) {
        showRealmNotification(context, RealmFilesActivity.class);
    }



    private static void showRealmNotification(@NonNull Context context, @NonNull Class activityClass) {
        NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
                .setSmallIcon(R.drawable.ic_rb)
                .setContentTitle(context.getString(R.string.rb_title))
                .setContentText(context.getString(R.string.rb_click_to_launch))
                .setAutoCancel(false);
        Intent notifyIntent = new Intent(context, activityClass);
        notifyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        PendingIntent notifyPendingIntent =
                PendingIntent.getActivity(context, 0, notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT);
        builder.setContentIntent(notifyPendingIntent);
        NotificationManager mNotificationManager =
                (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
        mNotificationManager.notify(NOTIFICATION_ID, builder.build());
    }



    public List<Class<? extends RealmObject>> getRealmModelList() {
        return mRealmModelList;
    }



    @SafeVarargs
    public final void addRealmModel(Class<? extends RealmObject>... arr) {
        mRealmModelList.addAll(Arrays.asList(arr));
    }
}
{'fraction_non_alphanumeric': 0.0801175318315377, 'fraction_numerical': 0.0023506366307541626, 'mean_word_length': 3.727777777777778, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3958928', 'n_tokens_mistral': 1376, 'n_tokens_neox': 1316, 'n_words': 279}