import-log: properly distinguish return states

This commit is contained in:
Vincent Breitmoser
2014-06-12 01:52:41 +02:00
parent 47368f1d24
commit dea98a4a7e
5 changed files with 25 additions and 26 deletions

View File

@@ -44,8 +44,8 @@ public class OperationResultParcel implements Parcelable {
return mResult;
}
public boolean isSuccessful() {
return (mResult & 1) == 1;
public boolean success() {
return (mResult & 1) == 0;
}
public OperationLog getLog() {

View File

@@ -25,13 +25,13 @@ public abstract class OperationResults {
== (RESULT_OK_NEWKEYS | RESULT_OK_UPDATED);
}
public boolean isOkNew() {
return (mResult & RESULT_OK_NEWKEYS) > 0;
return (mResult & RESULT_OK_NEWKEYS) == RESULT_OK_NEWKEYS;
}
public boolean isOkUpdated() {
return (mResult & RESULT_OK_UPDATED) > 0;
return (mResult & RESULT_OK_UPDATED) == RESULT_OK_UPDATED;
}
public boolean isFailNothing() {
return (mResult & RESULT_FAIL_NOTHING) > 0;
return (mResult & RESULT_FAIL_NOTHING) == RESULT_FAIL_NOTHING;
}
public ImportResult(Parcel source) {