Skip to content

Commit

Permalink
[Mobile] Added FOREGROUND_SERVICE permission, required by newer Andro…
Browse files Browse the repository at this point in the history
…id APIs.

[Mobile] Added Apache HTTP legacy library hack.
[Mobile] Fixed intermittent crash issue due to null Activity.
[Trivial] Bumped version numbers for release v0.126.
  • Loading branch information
thecosmicfrog committed Jan 7, 2019
1 parent 66c1521 commit d2fd932
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 21 deletions.
4 changes: 2 additions & 2 deletions mobile/build.gradle
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "org.thecosmicfrog.luasataglance" applicationId "org.thecosmicfrog.luasataglance"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28
versionCode 121 versionCode 126
versionName "0.121" versionName "0.126"
} }
buildTypes { buildTypes {
release { release {
Expand Down
9 changes: 9 additions & 0 deletions mobile/src/main/AndroidManifest.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package="org.thecosmicfrog.luasataglance"> package="org.thecosmicfrog.luasataglance">


<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
Expand Down Expand Up @@ -33,6 +34,14 @@
android:name="com.google.firebase.messaging.default_notification_color" android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/luas_purple" /> android:resource="@color/luas_purple" />


<!--
Official Google hack required since targeting API level >= 28 (Android 9.0).
https://developers.google.com/maps/documentation/android-sdk/config#specify_requirement_for_apache_http_legacy_library
-->
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />

<activity <activity
android:name=".activity.MainActivity" android:name=".activity.MainActivity"
android:label="@string/app_name"> android:label="@string/app_name">
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ public void onItemSelected(AdapterView<?> parent, View view, int position,
*/ */
if (isVisibleToUser) { if (isVisibleToUser) {
/* /*
* If the Spinner's selected item is "Select a stop...", we don't need to * If the Spinner's selected item is "Select a stop...", we don't need
* do anything. Just clear the stop forecast and get out of here. * to do anything. Just clear the stop forecast and get out of here.
*/ */
if (position == 0) { if (position == 0) {
shouldAutoReload = false; shouldAutoReload = false;
Expand Down Expand Up @@ -775,7 +775,7 @@ public void run() {
if (shouldAutoReload) { if (shouldAutoReload) {
loadStopForecast( loadStopForecast(
Preferences.selectedStopName( Preferences.selectedStopName(
getContext(), getActivity().getApplicationContext(),
line line
), ),
false false
Expand Down Expand Up @@ -869,10 +869,12 @@ public void failure(RetrofitError retrofitError) {
Log.e(LOG_TAG, "Response: " + retrofitError.getResponse().getUrl()); Log.e(LOG_TAG, "Response: " + retrofitError.getResponse().getUrl());
} }


Log.e(LOG_TAG, "Status: " + Integer.toString(retrofitError.getResponse().getStatus())); Log.e(LOG_TAG, "Status: " +
Integer.toString(retrofitError.getResponse().getStatus()));


if (retrofitError.getResponse().getHeaders() != null) { if (retrofitError.getResponse().getHeaders() != null) {
Log.e(LOG_TAG, "Headers: " + retrofitError.getResponse().getHeaders().toString()); Log.e(LOG_TAG, "Headers: " +
retrofitError.getResponse().getHeaders().toString());
} }


if (retrofitError.getResponse().getBody() != null) { if (retrofitError.getResponse().getBody() != null) {
Expand Down
21 changes: 12 additions & 9 deletions mobile/src/main/res/values/strings.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
App App
--> -->
<string name="app_name">Luas at a Glance</string> <string name="app_name">Luas at a Glance</string>
<string name="version_code" translatable="false">121</string> <string name="version_code" translatable="false">126</string>
<string name="version_name" translatable="false">0.121</string> <string name="version_name" translatable="false">0.126</string>


<!-- <!--
Activities Activities
Expand Down Expand Up @@ -166,16 +166,19 @@
<!-- <!--
What's New What's New
--> -->
<string name="whatsnew_title_current" translatable="false">Version 0.116 (19th November 2018) <string name="whatsnew_title_current" translatable="false">Version 0.126 (18th December 2018)
</string> </string>
<string name="whatsnew_content_current" translatable="false">\u2022 Added link to privacy policy <string name="whatsnew_content_current" translatable="false">\u2022 [NEW] Swiping down to
in About dialog. refresh the stop forecast now displays when the times were generated by the Luas RTPI
system.\n\u2022 [FIXED] Fixed bug where <b>Alerts</b> button could turn red for an alert on
the wrong line.\n\u2022 [FIXED] Fixed intermittent crash on some devices. Thanks to everyone
who reported this.\n\u2022 [FIXED] Fixed widget crash affecting some users. Thanks to
everyone who reported this.
</string> </string>
<string name="whatsnew_title_previous" translatable="false">Version 0.112 (10th October 2018) <string name="whatsnew_title_previous" translatable="false">Version 0.116 (19th November 2018)
</string> </string>
<string name="whatsnew_content_previous" translatable="false">\u2022 [FIXED] Fixed 404 error <string name="whatsnew_content_previous" translatable="false">\u2022 Added link to privacy
which occurred when tapping the <b>Alerts</b> button for some users. Many thanks to the user policy in About dialog.
who reported this issue to my email!
</string> </string>


<!-- <!--
Expand Down
6 changes: 3 additions & 3 deletions wear/build.gradle
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.thecosmicfrog.luasataglance" applicationId "org.thecosmicfrog.luasataglance"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28
versionCode 12100 versionCode 12600
versionName "0.121" versionName "0.126"
} }
buildTypes { buildTypes {
release { release {
Expand All @@ -23,7 +23,7 @@ android {
productFlavors { productFlavors {
wear2 { wear2 {
minSdkVersion 25 minSdkVersion 25
versionCode 12101 versionCode 12601
} }
} }
} }
Expand Down
4 changes: 2 additions & 2 deletions wear/src/main/res/values/strings.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
App App
--> -->
<string name="app_name">Luas at a Glance</string> <string name="app_name">Luas at a Glance</string>
<string name="version_code" translatable="false">121</string> <string name="version_code" translatable="false">126</string>
<string name="version_name" translatable="false">0.121</string> <string name="version_name" translatable="false">0.126</string>


<!-- <!--
Activities Activities
Expand Down

0 comments on commit d2fd932

Please sign in to comment.