purge appInfo property variable from App class

Expose less stuff as properties, this didn't need to be exposed, it was
only an implementation shortcut.
This commit is contained in:
Hans-Christoph Steiner 2014-05-06 19:35:49 -04:00
parent 3352d83102
commit d8d8a45d88
2 changed files with 11 additions and 5 deletions

View File

@ -95,7 +95,6 @@ public class App extends ValueObject implements Comparable<App> {
public int installedVersionCode;
public ApplicationInfo appInfo;
public Apk installedApk; // might be null if not installed
@Override
@ -215,7 +214,6 @@ public class App extends ValueObject implements Comparable<App> {
+ ", last updated on " + this.lastUpdated + ")</p>";
this.name = (String) appInfo.loadLabel(pm);
this.appInfo = appInfo;
File apkFile = new File(appInfo.publicSourceDir);
Apk apk = new Apk();

View File

@ -210,9 +210,17 @@ public class LocalRepoManager {
}
public void copyIconsToRepo() {
for (App app : apps.values())
if (app.installedApk != null)
copyIconToRepo(app.appInfo.loadIcon(pm), app.id, app.installedApk.vercode);
ApplicationInfo appInfo;
for (App app : apps.values()) {
if (app.installedApk != null) {
try {
appInfo = pm.getApplicationInfo(app.id, PackageManager.GET_META_DATA);
copyIconToRepo(appInfo.loadIcon(pm), app.id, app.installedApk.vercode);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
}
}
}
/**