Skip to content

Commit

Permalink
tracing: Don't report buffer usage for accessibility (android).
Browse files Browse the repository at this point in the history
Change the message in the recording notification so that it doesn't
show a "0%" buffer usage forever.

Bug: 932769
Change-Id: I193b656ef264147fa62ec8b788dff9720580d756
Reviewed-on: https://chromium-review.googlesource.com/c/1476991
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633227}
  • Loading branch information
betasheet authored and Commit Bot committed Feb 19, 2019
1 parent 83970b5 commit 094af4a
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public class TracingNotificationManager {

// Non-translated strings:
private static final String MSG_ACTIVE_NOTIFICATION_TITLE = "Chrome trace is being recorded";
private static final String MSG_ACTIVE_NOTIFICATION_ACCESSIBILITY_MESSAGE =
"Tracing is active.";
private static final String MSG_ACTIVE_NOTIFICATION_MESSAGE = "Trace buffer usage: %s%%";
private static final String MSG_STOPPING_NOTIFICATION_TITLE = "Chrome trace is stopping";
private static final String MSG_STOPPING_NOTIFICATION_MESSAGE =
Expand Down Expand Up @@ -103,6 +105,13 @@ public static void showTracingActiveNotification() {
String message = String.format(
MSG_ACTIVE_NOTIFICATION_MESSAGE, sTracingActiveNotificationBufferPercentage);

// We can't update the notification if accessibility is enabled as this may interfere with
// selecting the stop button, so choose a different message.
AccessibilityManager am =
(AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
if (am.isEnabled() && am.isTouchExplorationEnabled())
message = MSG_ACTIVE_NOTIFICATION_ACCESSIBILITY_MESSAGE;

sTracingActiveNotificationBuilder =
createNotificationBuilder()
.setContentTitle(title)
Expand Down

0 comments on commit 094af4a

Please sign in to comment.