Search in sources :

Example 1 with InstantAppStartActivityFlagsProvider

use of com.android.tools.idea.run.activity.InstantAppStartActivityFlagsProvider 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)

Aggregations

DefaultStartActivityFlagsProvider (com.android.tools.idea.run.activity.DefaultStartActivityFlagsProvider)1 InstantAppStartActivityFlagsProvider (com.android.tools.idea.run.activity.InstantAppStartActivityFlagsProvider)1 StartActivityFlagsProvider (com.android.tools.idea.run.activity.StartActivityFlagsProvider)1 Nullable (org.jetbrains.annotations.Nullable)1