Lecturer Storage Test

This commit is contained in:
Caesar2011
2019-02-05 17:57:21 +01:00
parent 631bd0dd51
commit 91eb7acd72
3 changed files with 3 additions and 5 deletions

View File

@@ -99,13 +99,11 @@ public class MainActivity extends AppCompatActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
log.d("onCreate start");
mAccountManager = new CustomAccountManager(AccountManager.get(this), () -> MainActivity.this);
int desiredPage = getDefaultFragmentAfterLogin();
String desiredData = "";
Intent intent = getIntent();
if (intent != null) {
log.d("onCreate", intent);
if (CustomNotificationManager.NOTIFICATION_TYPE_NAVIGATE.equals(intent.getStringExtra(CustomNotificationManager.NOTIFICATION_INTENT))) {
int page = intent.getIntExtra(CustomNotificationManager.NOTIFICATION_PAGE, 0);
if (page == FRAGMENT_STARTUP || page == FRAGMENT_NONE)

View File

@@ -150,7 +150,7 @@ public class ModulesList extends HTTPService {
mQueue.next();
}));
this.upgradeKVV(successKVV -> {
this.upgradeBlackboard(successKVV, success -> {
this.upgradeBB(successKVV, success -> {
if (this.mModules == null)
this.mModules = success;
else if (this.mModules.updateList(success)) {
@@ -234,7 +234,7 @@ public class ModulesList extends HTTPService {
}, error -> errorCallback.onError(new NetworkError(101115, error.networkResponse.statusCode, "Cannot get module list!")));
}
private void upgradeBlackboard(final Modules modulesKVV, final NetworkCallback<Modules> callback, final NetworkErrorCallback errorCallback) {
private void upgradeBB(final Modules modulesKVV, final NetworkCallback<Modules> callback, final NetworkErrorCallback errorCallback) {
if (!mLogin.isInOnlineMode() || mLogin.getLoginTokenBB() == null) {
errorCallback.onError(new NetworkError(101120, 500, "Currently running in offline mode!"));
return;

View File

@@ -12,7 +12,7 @@ import java.util.ArrayList;
import java.util.HashMap;
public class LecturerStorage implements Serializable {
private static final long RESAVE_TIMER = 1000L * 60 * 60 * 24 * 30;
private transient static final long RESAVE_TIMER = 1000L * 60 * 60 * 24 * 30;
private static final String FILE_NAME = "LecturerStorageSaving";
private static final String FILE_NAME_TIMESTAMP = "LecturerStorageSavingTimestamp";
private transient long mLastTimestamp = 0;