Skip to content

Commit

Permalink
No update available toast
Browse files Browse the repository at this point in the history
  • Loading branch information
Navid200 committed Sep 21, 2023
1 parent f9346ab commit 654f1f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public class UpdateActivity extends BaseAppCompatActivity {
private static String CHECKSUM = "";

public static void checkForAnUpdate(final Context context) {
StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace();
StackTraceElement stack = stacktrace[3];
String callingMethodName = stack.getMethodName(); // Name of the method that has called this one
if (prefs == null) prefs = PreferenceManager.getDefaultSharedPreferences(context);
if ((last_check_time != -1) && (!prefs.getBoolean(AUTO_UPDATE_PREFS_NAME, true))) return;
if (last_check_time == 0)
Expand Down Expand Up @@ -169,6 +172,9 @@ public static void checkForAnUpdate(final Context context) {
}
} else {
Log.i(TAG, "Our current version is the most recent: " + versionnumber + " vs " + newversion);
if ((callingMethodName).equals("checkForUpdate")) {
JoH.static_toast_long(xdrip.gs(R.string.current_version_is_up_to_date)); // Only for manual update check
}
}
} catch (Exception e) {
Log.e(TAG, "Got exception parsing update version: " + e.toString());
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
<string name="libre_last_x_minutes_graph">Libre last %d minutes graph</string>
<string name="share_config_via_qr_code">Share config via QR code</string>
<string name="check_for_updated_version">Check for updated version</string>
<string name="current_version_is_up_to_date">No update in the selected channel</string>
<string name="send_feedback_to_developer">Send Feedback to developers</string>
<string name="home_screen">Home Screen</string>
<string name="event_logs">Event Logs</string>
Expand Down

0 comments on commit 654f1f3

Please sign in to comment.