Skip to content

Commit

Permalink
Export API for bundle versionCode and versionName
Browse files Browse the repository at this point in the history
  • Loading branch information
galenlin committed Jul 15, 2016
1 parent 2c95fb2 commit a1dc49e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ private static final class Manifest {
private String query;
private HashMap<String, String> rules;
private int versionCode;
private String versionName;

private BundleLauncher mApplicableLauncher = null;

Expand Down Expand Up @@ -590,6 +591,18 @@ protected void setVersionCode(int versionCode) {
Small.setBundleVersionCode(this.mPackageName, versionCode);
}

public int getVersionCode() {
return versionCode;
}

protected void setVersionName(String versionName) {
this.versionName = versionName;
}

public String getVersionName() {
return versionName;
}

protected boolean isLaunchable() {
return launchable && enabled;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public boolean preloadBundle(Bundle bundle) {
// Record version code for upgrade
PackageInfo pluginInfo = parser.getPackageInfo();
bundle.setVersionCode(pluginInfo.versionCode);
bundle.setVersionName(pluginInfo.versionName);

return true;
}
Expand Down

0 comments on commit a1dc49e

Please sign in to comment.