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

Fixes #1156.
This commit is contained in:
Peter Serwylo 2017-09-05 12:56:05 +10:00 committed by Hans-Christoph Steiner
parent 620affa239
commit ac1dce24d2

View File

@ -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;
} }
} }