Don't assume all apps have a preferred signer, as media apps don't

Fixes #1156.
Šī revīzija ir iekļauta:
Peter Serwylo 2017-09-05 12:56:05 +10:00 revīziju iesūtīja Hans-Christoph Steiner
vecāks 620affa239
revīzija ac1dce24d2

Parādīt failu

@ -1141,13 +1141,14 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
* the user to try and install versions with that signature (because thats all the OS will let * the user to try and install versions with that signature (because thats all the OS will let
* them do). * them do).
*/ */
@NonNull @Nullable
public String getMostAppropriateSignature() { public String getMostAppropriateSignature() {
if (!TextUtils.isEmpty(installedSig)) { if (!TextUtils.isEmpty(installedSig)) {
return installedSig; return installedSig;
} else if (!TextUtils.isEmpty(preferredSigner)) { } else if (!TextUtils.isEmpty(preferredSigner)) {
return preferredSigner; return preferredSigner;
} }
throw new IllegalStateException("Most Appropriate Signature not found!");
return null;
} }
} }