diff --git a/app/build.gradle b/app/build.gradle index 4e067b5..77261f8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,8 +27,8 @@ android { applicationId "com.cpjd.roblu" minSdkVersion 19 targetSdkVersion 27 - versionCode 61 - versionName "4.4.6" + versionCode 62 + versionName "4.4.7" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" javaCompileOptions { diff --git a/app/src/main/java/com/cpjd/roblu/sync/SyncHelper.java b/app/src/main/java/com/cpjd/roblu/sync/SyncHelper.java index 64e4e9b..837636b 100644 --- a/app/src/main/java/com/cpjd/roblu/sync/SyncHelper.java +++ b/app/src/main/java/com/cpjd/roblu/sync/SyncHelper.java @@ -241,6 +241,8 @@ public void mergeCheckout(RCheckout checkout) { } // The team was not found locally, create a new one else { + Log.d("RBS", "Team was not found, creating a new one."); + team = new RTeam(checkout.getTeam().getName(), checkout.getTeam().getNumber(), checkout.getTeam().getID()); team.setLastEdit(checkout.getTeam().getLastEdit()); team.verify(form); diff --git a/app/src/main/java/com/cpjd/roblu/sync/qr/QrReader.java b/app/src/main/java/com/cpjd/roblu/sync/qr/QrReader.java index 3a87342..f94917c 100644 --- a/app/src/main/java/com/cpjd/roblu/sync/qr/QrReader.java +++ b/app/src/main/java/com/cpjd/roblu/sync/qr/QrReader.java @@ -83,6 +83,7 @@ public void run() { new SyncHelper(getApplicationContext(), event, SyncHelper.MODES.QR).mergeCheckout(checkout); // Flag for upload + checkout.setTeam(new IO(getApplicationContext()).loadTeam(event.getID(), checkout.getTeam().getID())); // reload the team after merge new IO(getApplicationContext()).savePendingCheckout(checkout); Notify.notifyMerged(getApplicationContext(), event.getID(), checkout); diff --git a/app/src/main/java/com/cpjd/roblu/utils/Utils.java b/app/src/main/java/com/cpjd/roblu/utils/Utils.java index 12930e6..d39a701 100644 --- a/app/src/main/java/com/cpjd/roblu/utils/Utils.java +++ b/app/src/main/java/com/cpjd/roblu/utils/Utils.java @@ -98,7 +98,7 @@ public static boolean hasInternetConnection(Context context) { if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return activeNetwork != null && activeNetwork.isConnectedOrConnecting() || (cm.getNetworkInfo(ConnectivityManager.TYPE_VPN).isConnectedOrConnecting()); - } else return activeNetwork != null && activeNetwork.isConnectedOrConnecting(); + } else return activeNetwork != null && activeNetwork.isConnected(); } catch(Exception e) { return false; }