Change PluginManager.isPhoneGapPlugin() to be much shorter like on the BlackBerry

This commit is contained in:
Dave Johnson 2010-10-12 23:18:11 +01:00
parent 032db387f8
commit 522a7225db

View File

@ -140,15 +140,7 @@ public final class PluginManager {
@SuppressWarnings("unchecked")
private boolean isPhoneGapPlugin(Class c) {
if (c != null) {
if (c.getSuperclass().getName().equals("com.phonegap.api.Plugin")) {
return true;
}
Class[] interfaces = c.getInterfaces();
for (int j=0; j<interfaces.length; j++) {
if (interfaces[j].getName().equals("com.phonegap.api.IPlugin")) {
return true;
}
}
return com.phonegap.api.Plugin.class.isAssignableFrom(c);
}
return false;
}