improved Apk.toString() for easier debugging

Dieser Commit ist enthalten in:
Hans-Christoph Steiner 2016-10-06 19:45:16 +02:00
Ursprung 470145e611
Commit 65c4087b05
2 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -270,7 +270,7 @@ public class Apk extends ValueObject implements Comparable<Apk>, Parcelable {
@Override
public String toString() {
return packageName + " (version " + versionCode + ")";
return toContentValues().toString();
}
public ContentValues toContentValues() {

Datei anzeigen

@ -41,12 +41,12 @@ public class InstallerFactory {
*/
public static Installer create(Context context, Apk apk) {
if (apk == null || TextUtils.isEmpty(apk.packageName)) {
throw new IllegalArgumentException("packageName must not be empty!");
throw new IllegalArgumentException("Apk.packageName must not be empty: " + apk);
}
Installer installer;
if (apk.packageName.equals(PrivilegedInstaller.PRIVILEGED_EXTENSION_PACKAGE_NAME)) {
// special case for "F-Droid Privileged Extension"
// special case for installing "Privileged Extension" with root
installer = new ExtensionInstaller(context, apk);
} else if (PrivilegedInstaller.isDefault(context)) {
Utils.debugLog(TAG, "privileged extension correctly installed -> PrivilegedInstaller");