Lecturer Storage Test
This commit is contained in:
@@ -99,13 +99,11 @@ public class MainActivity extends AppCompatActivity
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
log.d("onCreate start");
|
|
||||||
mAccountManager = new CustomAccountManager(AccountManager.get(this), () -> MainActivity.this);
|
mAccountManager = new CustomAccountManager(AccountManager.get(this), () -> MainActivity.this);
|
||||||
int desiredPage = getDefaultFragmentAfterLogin();
|
int desiredPage = getDefaultFragmentAfterLogin();
|
||||||
String desiredData = "";
|
String desiredData = "";
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
if (intent != null) {
|
if (intent != null) {
|
||||||
log.d("onCreate", intent);
|
|
||||||
if (CustomNotificationManager.NOTIFICATION_TYPE_NAVIGATE.equals(intent.getStringExtra(CustomNotificationManager.NOTIFICATION_INTENT))) {
|
if (CustomNotificationManager.NOTIFICATION_TYPE_NAVIGATE.equals(intent.getStringExtra(CustomNotificationManager.NOTIFICATION_INTENT))) {
|
||||||
int page = intent.getIntExtra(CustomNotificationManager.NOTIFICATION_PAGE, 0);
|
int page = intent.getIntExtra(CustomNotificationManager.NOTIFICATION_PAGE, 0);
|
||||||
if (page == FRAGMENT_STARTUP || page == FRAGMENT_NONE)
|
if (page == FRAGMENT_STARTUP || page == FRAGMENT_NONE)
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ public class ModulesList extends HTTPService {
|
|||||||
mQueue.next();
|
mQueue.next();
|
||||||
}));
|
}));
|
||||||
this.upgradeKVV(successKVV -> {
|
this.upgradeKVV(successKVV -> {
|
||||||
this.upgradeBlackboard(successKVV, success -> {
|
this.upgradeBB(successKVV, success -> {
|
||||||
if (this.mModules == null)
|
if (this.mModules == null)
|
||||||
this.mModules = success;
|
this.mModules = success;
|
||||||
else if (this.mModules.updateList(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!")));
|
}, 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) {
|
if (!mLogin.isInOnlineMode() || mLogin.getLoginTokenBB() == null) {
|
||||||
errorCallback.onError(new NetworkError(101120, 500, "Currently running in offline mode!"));
|
errorCallback.onError(new NetworkError(101120, 500, "Currently running in offline mode!"));
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class LecturerStorage implements Serializable {
|
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 = "LecturerStorageSaving";
|
||||||
private static final String FILE_NAME_TIMESTAMP = "LecturerStorageSavingTimestamp";
|
private static final String FILE_NAME_TIMESTAMP = "LecturerStorageSavingTimestamp";
|
||||||
private transient long mLastTimestamp = 0;
|
private transient long mLastTimestamp = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user