Skip to content

Commit

Permalink
[Mobile] Fixed bug where WidgetListenerService notification could get…
Browse files Browse the repository at this point in the history
… stuck in a user's notification area. Added ability to skip showing the What's New dialog when running in Firebase Test Lab.
  • Loading branch information
thecosmicfrog committed Jun 2, 2019
1 parent e3cd330 commit d555cb7
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 84 deletions.
4 changes: 2 additions & 2 deletions mobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "org.thecosmicfrog.luasataglance"
minSdkVersion 21
targetSdkVersion 28
versionCode 133
versionName "0.133"
versionCode 135
versionName "0.135"
}
buildTypes {
release {
Expand Down
5 changes: 0 additions & 5 deletions mobile/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@
<action android:name="org.thecosmicfrog.luasataglance.activity.NotifyTimeActivity" />
</intent-filter>
</receiver>
<receiver android:name=".receiver.StartServiceAtBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver android:name=".widget.StopForecastWidget">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.support.design.widget.TabLayout;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewPager;
Expand Down Expand Up @@ -333,6 +334,15 @@ private void setTabIndicatorColor(TabLayout tabLayout) {
* Show What's New dialog to user if they have recently updated the app.
*/
private void showWhatsNewDialog() {
/* Don't show the What's New dialog if we're running in Firebase Test Lab. */
String settingFirebaseTestLab =
Settings.System.getString(getContentResolver(), "firebase.test.lab");
if (settingFirebaseTestLab != null && settingFirebaseTestLab.equals("true")) {
Log.i(LOG_TAG, "Running in Firebase Test Lab.");

return;
}

/*
* Load two values for the current app version. One comes from strings.xml and the other
* comes from shared preferences. The value from strings.xml should be considered the
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public int onStartCommand(Intent intent, int flags, int startId) {
}
} else {
Log.e(LOG_TAG, "No widget IDs received.");
stopService(intent);
}
}

Expand Down
23 changes: 10 additions & 13 deletions mobile/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
App
-->
<string name="app_name">Luas at a Glance</string>
<string name="version_code" translatable="false">133</string>
<string name="version_name" translatable="false">0.133</string>
<string name="version_code" translatable="false">135</string>
<string name="version_name" translatable="false">0.135</string>

<!--
Activities
Expand Down Expand Up @@ -167,23 +167,20 @@
<!--
What's New
-->
<string name="whatsnew_title_current" translatable="false">Version 0.133 (17th May 2019)
<string name="whatsnew_title_current" translatable="false">Version 0.135 (2nd June 2019)
</string>
<string name="whatsnew_content_current" translatable="false">\u2022 [NEW] You can now see your
<string name="whatsnew_content_current" translatable="false">\u2022 [FIXED] Fixed issue where
a widget notification occasionally got stuck for some users. Thanks to everyone who reported
this!
</string>
<string name="whatsnew_title_previous" translatable="false">Version 0.133 (17th May 2019)
</string>
<string name="whatsnew_content_previous" translatable="false">\u2022 [NEW] You can now see your
Luas times without having to open the app! The homescreen widget is now considered stable,
with major crashes and bugs now fixed. To try it out, tap and hold on your device\'s
wallpaper and add the <b>Luas at a Glance</b> widget.\nPlease report any and all issues and
I\'ll be happy to fix them.
</string>
<string name="whatsnew_title_previous" translatable="false">Version 0.126 (18th December 2018)
</string>
<string name="whatsnew_content_previous" translatable="false">\u2022 [NEW] Swiping down to
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>

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

<!--
Activities
Expand Down

0 comments on commit d555cb7

Please sign in to comment.