Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple reminder notifications are confusing #946

Closed
barbeau opened this issue Dec 13, 2018 · 1 comment
Closed

Multiple reminder notifications are confusing #946

barbeau opened this issue Dec 13, 2018 · 1 comment
Milestone

Comments

@barbeau
Copy link
Member

barbeau commented Dec 13, 2018

Summary:

This issue is based on user feedback on the implementation in #937.

In #937, we modified TripService to always run in the foreground. The primary reason for this is that on Android 8.0 Oreo and higher you can no longer run a service in the background after receiving a BOOT_COMPLETED Intent (i.e., on device reboot) - if you do, you'll get an IllegalStateException. A secondary reason for running the service in the foreground is that anecdotally this results in better reliability of services executing immediately - although in our testing for TripService it seemed to execute immediately even when running in the background.

However, to run a service in the foreground you have to provide a notification to a user. And, if we always run TripService in the foreground, this results in duplicate notifications shown to the user when they get a reminder, like this:

image

I've gotten feedback that this is confusing, and I'd like to try and improve the user experience surrounding this.

One possible implementation is that we run the TripService in the foreground for all Intents EXCEPT for our TripService.ACTION_NOTIFY intent. This would remove the need for the 2nd icon when the user is actually looking at the notifications (for the other executions of TripService for scheduling and polling the server the notification would still appear, but would disappear so quickly most users would never notice it). This would fix the UX issue with reminder notifications and hopefully still keep reliability high by running the service in the foreground for the task of scheduling alarms and polling the server.

Steps to reproduce:

Set a reminder on current master branch

Expected behavior:

Give me one notification for my reminder

Observed behavior:

Two notifications are shown, one generic notification being related to running the service in the foreground

Device and Android version:

Samsung Galaxy S8+ with Android 8.0

@barbeau barbeau added this to the v2.3.x milestone Dec 13, 2018
@barbeau
Copy link
Member Author

barbeau commented Dec 13, 2018

Actually, looking at TripService.notifyTrip() closer, we currently aren't requesting that the service run in the foreground right now when showing the user the notification:

    public static void notifyTrip(Context context, Uri alertUri, String notifyTitle, String notifyText) {
        final Intent intent = new Intent(context, TripService.class);
        intent.setAction(ACTION_NOTIFY);
        intent.setData(alertUri);
        intent.putExtra(NOTIFY_TEXT, notifyText);
        intent.putExtra(NOTIFY_TITLE, notifyTitle);
        context.startService(intent);
    }

If we were requesting it start in the foreground it would be:

        ...
        context.startForegroundService(intent);

barbeau added a commit that referenced this issue Dec 13, 2018
* Allows various application components to explicitly specify whether or not the TripService should run in the foreground
* Never run in the foreground for ACTION_NOTIFY to avoid the "sticky" notification that shows while the service is running
* Always run in the foreground on device reboot
* Run in foreground for most other situations, even as a result of UI interactions.  We could potentially scale this back if it's not found to be necessary.
* Remove deprecated onStart() method, which dates back to Android 2.0 (TBT)
* Some code cleanup
* Update What's New text to remove reference to "sticky" notifications
barbeau added a commit that referenced this issue Dec 13, 2018
* Allows various application components to explicitly specify whether or not the TripService should run in the foreground
* Never run in the foreground for ACTION_NOTIFY to avoid the "sticky" notification that shows while the service is running
* Always run in the foreground on device reboot
* Run in foreground for most other situations, even as a result of UI interactions.  We could potentially scale this back if it's not found to be necessary.
* Remove deprecated onStart() method, which dates back to Android 2.0 (TBT)
* Some code cleanup
* Update What's New text to remove reference to "sticky" notifications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant