<commit_before>package com.developerphil.adbidea.adb.command;

import com.android.ddmlib.IDevice;
import com.android.ddmlib.MultiLineReceiver;
import com.android.tools.idea.run.activity.ActivityLocator;
import com.android.tools.idea.run.activity.DefaultActivityLocator;
import com.developerphil.adbidea.adb.ShellCommandsFactory;
import com.developerphil.adbidea.debugger.Debugger;
import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.ThrowableComputable;
import org.jetbrains.android.facet.AndroidFacet;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

import static com.developerphil.adbidea.ui.NotificationHelper.error;
import static com.developerphil.adbidea.ui.NotificationHelper.info;

public class StartDefaultActivityCommand implements Command {

    private final boolean withDebugger;

    public StartDefaultActivityCommand(boolean withDebugger) {
        this.withDebugger = withDebugger;
    }

    @Override
    public boolean run(Project project, IDevice device, AndroidFacet facet, String packageName) {
        try {
            String activityName = getDefaultActivityName(facet, device);
            StartActivityReceiver receiver = new StartActivityReceiver();
            String shellCommand = ShellCommandsFactory.startActivity(packageName, activityName, withDebugger);

            device.executeShellCommand(shellCommand, receiver, 15L, TimeUnit.SECONDS);

            if (withDebugger) {
                new Debugger(project, device, packageName).attach();
            }

            if (receiver.isSuccess()) {
                info(String.format("<b>%s</b> started on %s", packageName, device.getName()));
                return true;
            } else {
                error(String.format("<b>%s</b> could not bet started on %s. \n\n<b>ADB Output:</b> \n%s", packageName, device.getName(), receiver.getMessage()));
            }
        } catch (Exception e) {
            error("Start fail... " + e.getMessage());
        }<commit_msg>fix typo in "be"<commit_after>package com.developerphil.adbidea.adb.command;

import com.android.ddmlib.IDevice;
import com.android.ddmlib.MultiLineReceiver;
import com.android.tools.idea.run.activity.ActivityLocator;
import com.android.tools.idea.run.activity.DefaultActivityLocator;
import com.developerphil.adbidea.adb.ShellCommandsFactory;
import com.developerphil.adbidea.debugger.Debugger;
import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.ThrowableComputable;
import org.jetbrains.android.facet.AndroidFacet;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

import static com.developerphil.adbidea.ui.NotificationHelper.error;
import static com.developerphil.adbidea.ui.NotificationHelper.info;

public class StartDefaultActivityCommand implements Command {

    private final boolean withDebugger;

    public StartDefaultActivityCommand(boolean withDebugger) {
        this.withDebugger = withDebugger;
    }

    @Override
    public boolean run(Project project, IDevice device, AndroidFacet facet, String packageName) {
        try {
            String activityName = getDefaultActivityName(facet, device);
            StartActivityReceiver receiver = new StartActivityReceiver();
            String shellCommand = ShellCommandsFactory.startActivity(packageName, activityName, withDebugger);

            device.executeShellCommand(shellCommand, receiver, 15L, TimeUnit.SECONDS);

            if (withDebugger) {
                new Debugger(project, device, packageName).attach();
            }

            if (receiver.isSuccess()) {
                info(String.format("<b>%s</b> started on %s", packageName, device.getName()));
                return true;
            } else {
                error(String.format("<b>%s</b> could not be started on %s. \n\n<b>ADB Output:</b> \n%s", packageName, device.getName(), receiver.getMessage()));
            }
        } catch (Exception e) {
            error("Start fail... " + e.getMessage());
        }
{'fraction_non_alphanumeric': 0.10511756569847856, 'fraction_numerical': 0.0009220839096357768, 'mean_word_length': 3.548218029350105, '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': '1377547', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1205, 'n_words': 237}