зеркало из https://github.com/mozilla/gecko-dev.git
Bug 703069 - Do a better job of guessing plugin package name r=blassey
This commit is contained in:
Родитель
a1ed1a4a6a
Коммит
0c36608f96
|
@ -326,6 +326,23 @@ abstract public class GeckoApp
|
|||
return result;
|
||||
}
|
||||
|
||||
String getPluginPackage(String pluginLib) {
|
||||
|
||||
if (pluginLib == null || pluginLib.length() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
synchronized(mPackageInfoCache) {
|
||||
for (PackageInfo pkgInfo : mPackageInfoCache) {
|
||||
if (pluginLib.contains(pkgInfo.packageName)) {
|
||||
return pkgInfo.packageName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Class<?> getPluginClass(String packageName, String className)
|
||||
throws NameNotFoundException, ClassNotFoundException {
|
||||
Context pluginContext = this.mAppContext.createPackageContext(packageName,
|
||||
|
|
|
@ -1274,8 +1274,7 @@ public class GeckoAppShell
|
|||
Log.i(LOGTAG, "libName: " + libName);
|
||||
|
||||
try {
|
||||
String[] split = libName.split("/");
|
||||
String packageName = split[split.length - 3];
|
||||
String packageName = GeckoApp.mAppContext.getPluginPackage(libName);
|
||||
Log.i(LOGTAG, "load \"" + className + "\" from \"" + packageName +
|
||||
"\" for \"" + libName + "\"");
|
||||
Context pluginContext =
|
||||
|
|
Загрузка…
Ссылка в новой задаче