1 // Copyright 2013 The Flutter Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package io.flutter.embedding.android; 6 7 import android.app.Activity; 8 import android.arch.lifecycle.Lifecycle; 9 import android.support.annotation.NonNull; 10 import android.support.v4.app.FragmentActivity; 11 12 import io.flutter.embedding.engine.FlutterEngine; 13 14 /** 15 * Configures a {@link FlutterEngine} after it is created, e.g., adds plugins. 16 * <p> 17 * This interface may be applied to a {@link FragmentActivity} that owns a {@code FlutterFragment}. 18 */ 19 public interface FlutterEngineConfigurator { 20 /** 21 * Configures the given {@link FlutterEngine}. 22 * <p> 23 * This method is called after the given {@link FlutterEngine} has been attached to the 24 * owning {@code FragmentActivity}. See 25 * {@link io.flutter.embedding.engine.plugins.activity.ActivityControlSurface#attachToActivity(Activity, Lifecycle)}. 26 * <p> 27 * It is possible that the owning {@code FragmentActivity} opted not to connect itself as 28 * an {@link io.flutter.embedding.engine.plugins.activity.ActivityControlSurface}. In that 29 * case, any configuration, e.g., plugins, must not expect or depend upon an available 30 * {@code Activity} at the time that this method is invoked. 31 */ configureFlutterEngine(@onNull FlutterEngine flutterEngine)32 void configureFlutterEngine(@NonNull FlutterEngine flutterEngine); 33 } 34