Observations made :
As per the below functions in BundleInfoManager.java, the app is updated only if the version is same. So might have to change the logic here.
public boolean isUpdateable(Bundle bundle) {
if (Arrays.asList(bundleContext.getBundles()).stream()
.anyMatch(installedBundle -> installedBundle.getSymbolicName().equals(bundle.getSymbolicName()))) {
Bundle installedBundle = Arrays.asList(bundleContext.getBundles()).stream()
.filter(b -> b.getSymbolicName().equals(bundle.getSymbolicName())).findFirst().get();
return repositoryManagedBundles.stream()
.filter(repoBundle -> repoBundle.getSymbolicName().equals(bundle.getSymbolicName()))
.anyMatch(repoBundle ->
{
return repoBundle.getVersion().compareTo(installedBundle.getVersion()) == 1;
}
);
} else
{
return false;
}
}
public Bundle getLatestBundle(Bundle bundle) {
if (isUpdateable(bundle)) {
List<Bundle> updateableVersions = repositoryManagedBundles.stream()
.filter(b -> b.getSymbolicName().equals(bundle.getSymbolicName()))
.collect(Collectors.toList());
Collections.sort(updateableVersions, (Bundle o1, Bundle o2) ->
{
return o1.getVersion().compareTo(o2.getVersion());
}
);
if (!updateableVersions.isEmpty())
{
return updateableVersions.get(updateableVersions.size() - 1);
}
}
return bundle;
}
[~aloraine]
Observations made :
As per the below functions in BundleInfoManager.java, the app is updated only if the version is same. So might have to change the logic here.
public boolean isUpdateable(Bundle bundle) {
{ return repoBundle.getVersion().compareTo(installedBundle.getVersion()) == 1; }if (Arrays.asList(bundleContext.getBundles()).stream()
.anyMatch(installedBundle -> installedBundle.getSymbolicName().equals(bundle.getSymbolicName()))) {
Bundle installedBundle = Arrays.asList(bundleContext.getBundles()).stream()
.filter(b -> b.getSymbolicName().equals(bundle.getSymbolicName())).findFirst().get();
return repositoryManagedBundles.stream()
.filter(repoBundle -> repoBundle.getSymbolicName().equals(bundle.getSymbolicName()))
.anyMatch(repoBundle ->
);
{ return false; }} else
}
public Bundle getLatestBundle(Bundle bundle) {
{ return o1.getVersion().compareTo(o2.getVersion()); }if (isUpdateable(bundle)) {
List<Bundle> updateableVersions = repositoryManagedBundles.stream()
.filter(b -> b.getSymbolicName().equals(bundle.getSymbolicName()))
.collect(Collectors.toList());
Collections.sort(updateableVersions, (Bundle o1, Bundle o2) ->
);
{ return updateableVersions.get(updateableVersions.size() - 1); }if (!updateableVersions.isEmpty())
}
return bundle;
}
[~aloraine]