MCPcopy Create free account
hub / github.com/NativeScript/android / runPlugin

Method runPlugin

test-app/app/src/main/java/com/tns/Util.java:43–68  ·  view source on GitHub ↗
(Logger logger, Context context)

Source from the content-addressed store, hash-verified

41 }
42
43 static boolean runPlugin(Logger logger, Context context) {
44 boolean success = false;
45 String pluginClassName = "org.nativescript.livesync.LiveSyncPlugin";
46 try {
47 ApplicationInfo ai = context.getPackageManager().getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA);
48 Bundle metadataBundle = ai.metaData;
49 if (metadataBundle != null) {
50 pluginClassName = metadataBundle.getString("com.tns.internal.Plugin");
51 }
52 } catch (Exception e) {
53 if (Util.isDebuggableApp(context) && logger.isEnabled()) {
54 e.printStackTrace();
55 }
56 }
57
58 try {
59 Class<?> liveSyncPluginClass = Class.forName(pluginClassName);
60 Plugin p = (Plugin) liveSyncPluginClass.newInstance();
61 success = p.execute(context);
62 } catch (Exception e) {
63 if (Util.isDebuggableApp(context) && logger.isEnabled()) {
64 e.printStackTrace();
65 }
66 }
67 return success;
68 }
69
70 public static String readSystemProperty(String name) {
71 InputStreamReader in = null;

Callers 1

initRuntimeMethod · 0.95

Calls 4

isDebuggableAppMethod · 0.95
executeMethod · 0.95
isEnabledMethod · 0.65
getStringMethod · 0.45

Tested by

no test coverage detected