Merge branch 'stable-v0.100' into 'stable-v0.100'

two bug fixes for 0.100.1

two bug fixes for 0.100.1

See merge request !334
This commit is contained in:
Hans-Christoph Steiner 2016-06-14 12:23:57 +00:00
commit f2696f3ec2
2 changed files with 6 additions and 3 deletions

View File

@ -272,8 +272,10 @@ public class App extends ValueObject implements Comparable<App> {
final CharSequence appDescription = appInfo.loadDescription(pm); final CharSequence appDescription = appInfo.loadDescription(pm);
if (TextUtils.isEmpty(appDescription)) { if (TextUtils.isEmpty(appDescription)) {
this.summary = "(installed by " + installerPackageLabel + ")"; this.summary = "(installed by " + installerPackageLabel + ")";
} else { } else if (appDescription.length() > 40) {
this.summary = (String) appDescription.subSequence(0, 40); this.summary = (String) appDescription.subSequence(0, 40);
} else {
this.summary = (String) appDescription;
} }
this.packageName = appInfo.packageName; this.packageName = appInfo.packageName;
this.added = new Date(packageInfo.firstInstallTime); this.added = new Date(packageInfo.firstInstallTime);

View File

@ -363,9 +363,10 @@ public class InstallManagerService extends Service {
*/ */
private static Apk removeFromActive(String urlString) { private static Apk removeFromActive(String urlString) {
Apk apk = ACTIVE_APKS.remove(urlString); Apk apk = ACTIVE_APKS.remove(urlString);
if (apk != null) { if (apk == null) {
ACTIVE_APPS.remove(apk.packageName); return new Apk();
} }
ACTIVE_APPS.remove(apk.packageName);
return apk; return apk;
} }