Search in sources :

Example 1 with DefaultStartActivityFlagsProvider

use of com.android.tools.idea.run.activity.DefaultStartActivityFlagsProvider in project intellij by bazelbuild.

the class BlazeAndroidBinaryNormalBuildRunContext method getApplicationLaunchTask.

@Override
public LaunchTask getApplicationLaunchTask(LaunchOptions launchOptions, @Nullable Integer userId, AndroidDebugger androidDebugger, AndroidDebuggerState androidDebuggerState, ProcessHandlerLaunchStatus processHandlerLaunchStatus) throws ExecutionException {
    final StartActivityFlagsProvider startActivityFlagsProvider = new DefaultStartActivityFlagsProvider(androidDebugger, androidDebuggerState, project, launchOptions.isDebug(), UserIdHelper.getFlagsFromUserId(userId));
    BlazeAndroidDeployInfo deployInfo;
    try {
        deployInfo = buildStep.getDeployInfo();
    } catch (ApkProvisionException e) {
        throw new ExecutionException(e);
    }
    return BlazeAndroidBinaryApplicationLaunchTaskProvider.getApplicationLaunchTask(project, applicationIdProvider, deployInfo.getMergedManifestFile(), configState, startActivityFlagsProvider, processHandlerLaunchStatus);
}
Also used : DefaultStartActivityFlagsProvider(com.android.tools.idea.run.activity.DefaultStartActivityFlagsProvider) ApkProvisionException(com.android.tools.idea.run.ApkProvisionException) BlazeAndroidDeployInfo(com.google.idea.blaze.android.run.deployinfo.BlazeAndroidDeployInfo) StartActivityFlagsProvider(com.android.tools.idea.run.activity.StartActivityFlagsProvider) DefaultStartActivityFlagsProvider(com.android.tools.idea.run.activity.DefaultStartActivityFlagsProvider) ExecutionException(com.intellij.execution.ExecutionException)

Example 2 with DefaultStartActivityFlagsProvider

use of com.android.tools.idea.run.activity.DefaultStartActivityFlagsProvider in project android by JetBrains.

the class AndroidRunConfiguration method getApplicationLaunchTask.

@Nullable
@Override
protected LaunchTask getApplicationLaunchTask(@NotNull ApplicationIdProvider applicationIdProvider, @NotNull AndroidFacet facet, boolean waitForDebugger, @NotNull LaunchStatus launchStatus) {
    LaunchOptionState state = getLaunchOptionState(MODE);
    assert state != null;
    String extraFlags = ACTIVITY_EXTRA_FLAGS;
    StartActivityFlagsProvider startActivityFlagsProvider;
    if (facet.getProjectType() == PROJECT_TYPE_INSTANTAPP) {
        startActivityFlagsProvider = new InstantAppStartActivityFlagsProvider();
    } else {
        startActivityFlagsProvider = new DefaultStartActivityFlagsProvider(getAndroidDebuggerContext().getAndroidDebugger(), getAndroidDebuggerContext().getAndroidDebuggerState(), getProfilerState(), getProject(), waitForDebugger, extraFlags);
    }
    try {
        return state.getLaunchTask(applicationIdProvider.getPackageName(), facet, startActivityFlagsProvider, getProfilerState());
    } catch (ApkProvisionException e) {
        Logger.getInstance(AndroidRunConfiguration.class).error(e);
        launchStatus.terminateLaunch("Unable to identify application id");
        return null;
    }
}
Also used : DefaultStartActivityFlagsProvider(com.android.tools.idea.run.activity.DefaultStartActivityFlagsProvider) InstantAppStartActivityFlagsProvider(com.android.tools.idea.run.activity.InstantAppStartActivityFlagsProvider) StartActivityFlagsProvider(com.android.tools.idea.run.activity.StartActivityFlagsProvider) DefaultStartActivityFlagsProvider(com.android.tools.idea.run.activity.DefaultStartActivityFlagsProvider) InstantAppStartActivityFlagsProvider(com.android.tools.idea.run.activity.InstantAppStartActivityFlagsProvider) Nullable(org.jetbrains.annotations.Nullable)

Example 3 with DefaultStartActivityFlagsProvider

use of com.android.tools.idea.run.activity.DefaultStartActivityFlagsProvider in project intellij by bazelbuild.

the class BlazeAndroidBinaryMobileInstallRunContext method getApplicationLaunchTask.

@Override
public LaunchTask getApplicationLaunchTask(LaunchOptions launchOptions, @Nullable Integer userId, AndroidDebugger androidDebugger, AndroidDebuggerState androidDebuggerState, ProcessHandlerLaunchStatus processHandlerLaunchStatus) throws ExecutionException {
    final StartActivityFlagsProvider startActivityFlagsProvider = new DefaultStartActivityFlagsProvider(androidDebugger, androidDebuggerState, project, launchOptions.isDebug(), UserIdHelper.getFlagsFromUserId(userId));
    BlazeAndroidDeployInfo deployInfo;
    try {
        deployInfo = buildStep.getDeployInfo();
    } catch (ApkProvisionException e) {
        throw new ExecutionException(e);
    }
    return BlazeAndroidBinaryApplicationLaunchTaskProvider.getApplicationLaunchTask(project, applicationIdProvider, deployInfo.getMergedManifestFile(), configState, startActivityFlagsProvider, processHandlerLaunchStatus);
}
Also used : DefaultStartActivityFlagsProvider(com.android.tools.idea.run.activity.DefaultStartActivityFlagsProvider) ApkProvisionException(com.android.tools.idea.run.ApkProvisionException) BlazeAndroidDeployInfo(com.google.idea.blaze.android.run.deployinfo.BlazeAndroidDeployInfo) StartActivityFlagsProvider(com.android.tools.idea.run.activity.StartActivityFlagsProvider) DefaultStartActivityFlagsProvider(com.android.tools.idea.run.activity.DefaultStartActivityFlagsProvider) ExecutionException(com.intellij.execution.ExecutionException)

Aggregations

DefaultStartActivityFlagsProvider (com.android.tools.idea.run.activity.DefaultStartActivityFlagsProvider)3 StartActivityFlagsProvider (com.android.tools.idea.run.activity.StartActivityFlagsProvider)3 ApkProvisionException (com.android.tools.idea.run.ApkProvisionException)2 BlazeAndroidDeployInfo (com.google.idea.blaze.android.run.deployinfo.BlazeAndroidDeployInfo)2 ExecutionException (com.intellij.execution.ExecutionException)2 InstantAppStartActivityFlagsProvider (com.android.tools.idea.run.activity.InstantAppStartActivityFlagsProvider)1 Nullable (org.jetbrains.annotations.Nullable)1