New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 801164 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

[Android Notifications] Create a class for Notification Id

Project Member Reported by na...@chromium.org, Jan 11 2018

Issue description

Instead of passing around a string with a shared agreed-upon format to and fro from C++ and Java code, let's create a class for NotificationId and define functions like getOrigin() and getDeveloperTag() on them.
 

Comment 1 by awdf@chromium.org, Jan 11 2018

Components: UI>Notifications
Status: Available (was: Untriaged)
I think this is a great idea! :)

Comment 2 by awdf@chromium.org, Jan 11 2018

Labels: OS-Android
Unfortunately it looks like it won't be possible to reuse the same generation + parsing functions for java and c++.

As discussed with Peter:

- Putting the id generation + parsing in a java class and sharing this class between c++ and java won't work because we need to generate the notification id from origin,tag etc on all platforms, not just Android.

- Putting the generation + parsing in c++ won't work either because if the user taps the settings cog of one of our notifications we don't want to load the whole native library just to figure out the origin.

However, we can at least extract out the parsing to a separate Java class that is clearly referenced to/from the C++ NotificationIdGenerator.

I know Peter likes static methods but I would make a little class for it like this:

  /** Class comment explaining how this relates to the
   *  notification_id_generator.cc */
  class NotificationId {

      /* @param platformTag Must be in the expected format: [...] */
      NotificationId(String platformTag) {
          // verification of platformTag here
          mPlatformTag = platformTag;
      }
      String origin() {
          // code to get origin out of mPlatformTag here
      }
  }
Project Member

Comment 3 by sheriffbot@chromium.org, Jan 14

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment