diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 15b3785f8..36454bcf1 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="61" + android:versionName="2.21.61" android:installLocation="auto"> diff --git a/assets/about_page.html b/assets/about_page.html index 261f49a5e..8407f391c 100644 --- a/assets/about_page.html +++ b/assets/about_page.html @@ -18,7 +18,9 @@

Engine Driver Throttle for Android

Latest changes for this version include:

  • remove turnout hardware list, WiThrottle Server changing to handle numeric-only
  • +
  • changes to EngineDriver icon
  • German translations by Al Babinsky and Daniel Sieber
  • +
  • prevent crashes reported to Play Store

rt_state_names; //if not set, routes are not allowed - HashMap roster_entries; //roster sent by WiThrottle + LinkedHashMap roster_entries; //roster sent by WiThrottle LinkedHashMap consist_entries; private static DownloadRosterTask dlRosterTask = null; private static DownloadMetaTask dlMetadataTask = null; @@ -1019,7 +1019,7 @@ private void process_roster_function_string(String response_str, int whichThrott // RL2]\[NS2591}|{2591}|{L]\[NS4805}|{4805}|{L private void process_roster_list(String response_str) { //clear the global variable - roster_entries = new HashMap<>(); + roster_entries = new LinkedHashMap<>(); String[] ta = splitByString(response_str, "]\\["); //initial separation //initialize app arrays (skipping first) @@ -2066,7 +2066,7 @@ private void initShared() { consist_entries = new LinkedHashMap<>(); roster = null; - roster_entries = null; + roster_entries = new LinkedHashMap<>(); metadata = null; doFinish = false; turnouts_list_position = 0; diff --git a/src/jmri/enginedriver/throttle.java b/src/jmri/enginedriver/throttle.java index 13b729bd9..bcc3c8ac1 100644 --- a/src/jmri/enginedriver/throttle.java +++ b/src/jmri/enginedriver/throttle.java @@ -1703,8 +1703,8 @@ void applySpeedRelatedOptions(int whichThrottle) { void enable_disable_buttons(int whichThrottle, boolean forceDisable) { boolean newEnabledState = false; - if (!forceDisable) { - newEnabledState = mainapp.consists[whichThrottle].isActive(); // set false if lead loco is not assigned + if (!forceDisable && (whichThrottle < mainapp.consists.length)) { // avoid index crash, but may simply push to next line + newEnabledState = mainapp.consists[whichThrottle].isActive(); // set false if lead loco is not assigned } bFwds[whichThrottle].setEnabled(newEnabledState); bRevs[whichThrottle].setEnabled(newEnabledState); @@ -3805,13 +3805,12 @@ public void onPageFinished(WebView view, String url) { for (int throttleIndex = 0; throttleIndex < mainapp.maxThrottles; throttleIndex++) { changeTimers[throttleIndex] = new ChangeDelay(throttleIndex); } - // tone generator for feedback sounds try { tg = new ToneGenerator(AudioManager.STREAM_NOTIFICATION, preferences.getIntPrefValue(prefs,"prefGamePadFeedbackVolume", getApplicationContext().getResources().getString(R.string.prefGamePadFeedbackVolumeDefaultValue))); } catch (RuntimeException e) { - Log.d("Engine_Driver", "new ToneGenerateor failed. Runtime Exception, OS " + android.os.Build.VERSION.SDK_INT + " Message: " + e); + Log.e("Engine_Driver", "new ToneGenerator failed. Runtime Exception, OS " + android.os.Build.VERSION.SDK_INT + " Message: " + e); } // set GamePad Support setGamepadKeys(); @@ -4120,7 +4119,9 @@ void set_function_labels_and_listeners_for_view(int whichThrottle) { // while we are using it (causing issues during button update below) function_labels_temp = mainapp.function_labels_default; if (!prefAlwaysUseDefaultFunctionLabels) { - if (mainapp.function_labels[whichThrottle] != null && mainapp.function_labels[whichThrottle].size() > 0) { + if (mainapp.function_labels != null + && mainapp.function_labels[whichThrottle] != null + && mainapp.function_labels[whichThrottle].size() > 0) { function_labels_temp = new LinkedHashMap<>(mainapp.function_labels[whichThrottle]); } else { if (!mainapp.consists[whichThrottle].isLeadFromRoster()) { @@ -4528,7 +4529,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { tg = new ToneGenerator(AudioManager.STREAM_NOTIFICATION, preferences.getIntPrefValue(prefs, "prefGamePadFeedbackVolume", getApplicationContext().getResources().getString(R.string.prefGamePadFeedbackVolumeDefaultValue))); } catch (RuntimeException e) { - Log.d("Engine_Driver", "new ToneGenerateor failed. Runtime Exception, OS " + android.os.Build.VERSION.SDK_INT + " Message: " + e); + Log.e("Engine_Driver", "new ToneGenerator failed. Runtime Exception, OS " + android.os.Build.VERSION.SDK_INT + " Message: " + e); } } // update GamePad Support