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.view; 6 7 import android.support.annotation.NonNull; 8 9 import io.flutter.embedding.engine.FlutterJNI; 10 11 /** 12 * A class representing information for a callback registered using 13 * `PluginUtilities` from `dart:ui`. 14 */ 15 public final class FlutterCallbackInformation { 16 final public String callbackName; 17 final public String callbackClassName; 18 final public String callbackLibraryPath; 19 20 /** 21 * Get callback information for a given handle. 22 * @param handle the handle for the callback, generated by 23 * `PluginUtilities.getCallbackHandle` in `dart:ui`. 24 * @return an instance of FlutterCallbackInformation for the provided handle. 25 */ 26 @NonNull lookupCallbackInformation(long handle)27 public static FlutterCallbackInformation lookupCallbackInformation(long handle) { 28 return FlutterJNI.nativeLookupCallbackInformation(handle); 29 } 30 FlutterCallbackInformation(String callbackName, String callbackClassName, String callbackLibraryPath)31 private FlutterCallbackInformation(String callbackName, 32 String callbackClassName, String callbackLibraryPath) { 33 this.callbackName = callbackName; 34 this.callbackClassName = callbackClassName; 35 this.callbackLibraryPath = callbackLibraryPath; 36 } 37 } 38