Remove ALOGD_IF_SLOW
ALOGD_IF_SLOW isn't intuitively implemented as it cannot handle
temporaries used as its parameters. Since there are so few users of
it already and since it's just sugar on top of 2 otherwise trivial
lines, we opt to remove it entirely.
Bug: 62820330
Test: Build
Change-Id: I196443b3717497f6cab31bfaee94a229e4838556
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index 97aa562..5df6a28 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -24,6 +24,7 @@
#include "android/graphics/Region.h"
#include "core_jni_helpers.h"
+#include <android-base/chrono_utils.h>
#include <JNIHelp.h>
#include <ScopedUtfChars.h>
#include <android_runtime/android_view_Surface.h>
@@ -561,8 +562,9 @@
sp<IBinder> token(ibinderForJavaObject(env, tokenObj));
if (token == NULL) return;
- ALOGD_IF_SLOW(100, "Excessive delay in setPowerMode()");
+ android::base::Timer t;
SurfaceComposerClient::setDisplayPowerMode(token, mode);
+ if (t.duration() > 100ms) ALOGD("Excessive delay in setPowerMode()");
}
static jboolean nativeClearContentFrameStats(JNIEnv* env, jclass clazz, jlong nativeObject) {