Skip to content

Commit

Permalink
Fix first run database initialization running everytime
Browse files Browse the repository at this point in the history
  • Loading branch information
pluscubed committed Apr 16, 2016
1 parent e5a9694 commit 2f93f23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/com/pluscubed/velociraptor/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public Single<?> call(List<AppInfoEntity> mapInfos) {
}).subscribe();

PrefUtils.setVersionCode(this, BuildConfig.VERSION_CODE);
PrefUtils.setFirstRun(this, false);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.support.annotation.NonNull;

import io.requery.Entity;
import io.requery.Generated;
import io.requery.Key;
import io.requery.Transient;

Expand All @@ -24,8 +23,6 @@ public AppInfo[] newArray(int size) {
}
};
@Key
@Generated
public int id;
public String packageName;
@Transient
public boolean enabled;
Expand All @@ -37,9 +34,8 @@ public AppInfo() {
}

protected AppInfo(Parcel in) {
this.id = in.readInt();
this.enabled = in.readByte() != 0;
this.packageName = in.readString();
this.enabled = in.readByte() != 0;
this.name = in.readString();
}

Expand Down Expand Up @@ -70,9 +66,8 @@ public int describeContents() {

@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(this.id);
dest.writeByte(enabled ? (byte) 1 : (byte) 0);
dest.writeString(this.packageName);
dest.writeByte(enabled ? (byte) 1 : (byte) 0);
dest.writeString(this.name);
}
}

0 comments on commit 2f93f23

Please sign in to comment.