Android N introduced NotificationManager.areNotificationsEnabled(). We should use it in favour of the reflection we currently use. https://developer.android.com/reference/android/app/NotificationManager.html#areNotificationsEnabled() https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4ea58acf00bbf6f33067481d7e3c67bebd2879b0 commit 4ea58acf00bbf6f33067481d7e3c67bebd2879b0 Author: Sharon Yang <yangsharon@google.com> Date: Thu May 10 15:35:09 2018 [Android Notifications] Remove use of reflection for versions N+ NotificationManager.areNotificationsEnabled() was introduced in N, removing the need for reflection. Bug: 800904 Change-Id: I0e7acb495f5882fd84a6446f983c04a73417840c Reviewed-on: https://chromium-review.googlesource.com/1052228 Commit-Queue: Sharon Yang <yangsharon@google.com> Reviewed-by: Anita Woodruff <awdf@chromium.org> Reviewed-by: Peter Beverloo <peter@chromium.org> Cr-Commit-Position: refs/heads/master@{#557525} [modify] https://crrev.com/4ea58acf00bbf6f33067481d7e3c67bebd2879b0/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java [modify] https://crrev.com/4ea58acf00bbf6f33067481d7e3c67bebd2879b0/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java [modify] https://crrev.com/4ea58acf00bbf6f33067481d7e3c67bebd2879b0/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java
Comment 1 by awdf@chromium.org
, May 2 2018Status: Assigned (was: Available)