Adding @SuppressWarnings(NoSynchronizedMethodCheck).

In https://chromium-review.googlesource.com/c/chromium/src/+/750645
Chromium started to use an ErrorProne plugin to discourage synchronized
public methods (an encourage the usage of synchronized blocks).

In order to unblock the Chromium Roll we can suppress these warnings
and decide if we want to align with Chromium on this check or ask
them to make it optional.

More details in the bug.

TBR=magjed@webrtc.org

Bug: webrtc:8491
Change-Id: Ie77a324e54aab44a4f59853959549f1d21f884a0
No-Try: True
Reviewed-on: https://webrtc-review.googlesource.com/20060
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20569}
This commit is contained in:
Mirko Bonadei
2017-11-05 19:35:31 -08:00
committed by Commit Bot
parent 08a9c372df
commit 12251b6386
13 changed files with 164 additions and 0 deletions

View File

@ -180,6 +180,8 @@ class CpuMonitor {
scheduleCpuUtilizationTask();
}
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
@SuppressWarnings("NoSynchronizedMethodCheck")
public synchronized void reset() {
if (executor != null) {
Log.d(TAG, "reset");
@ -188,14 +190,20 @@ class CpuMonitor {
}
}
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
@SuppressWarnings("NoSynchronizedMethodCheck")
public synchronized int getCpuUsageCurrent() {
return doubleToPercent(userCpuUsage.getCurrent() + systemCpuUsage.getCurrent());
}
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
@SuppressWarnings("NoSynchronizedMethodCheck")
public synchronized int getCpuUsageAverage() {
return doubleToPercent(userCpuUsage.getAverage() + systemCpuUsage.getAverage());
}
// TODO(bugs.webrtc.org/8491): Remove NoSynchronizedMethodCheck suppression.
@SuppressWarnings("NoSynchronizedMethodCheck")
public synchronized int getFrequencyScaleAverage() {
return doubleToPercent(frequencyScale.getAverage());
}