diff options
| -rw-r--r-- | core/java/com/android/internal/protolog/common/ProtoLog.java | 40 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/SystemUIApplication.java | 3 |
2 files changed, 31 insertions, 12 deletions
diff --git a/core/java/com/android/internal/protolog/common/ProtoLog.java b/core/java/com/android/internal/protolog/common/ProtoLog.java index ab58d351d3b9..01cc1ed37ad4 100644 --- a/core/java/com/android/internal/protolog/common/ProtoLog.java +++ b/core/java/com/android/internal/protolog/common/ProtoLog.java @@ -35,6 +35,10 @@ package com.android.internal.protolog.common; * during build. */ public class ProtoLog { + + // Needs to be set directly otherwise the protologtool tries to transform the method call + public static boolean REQUIRE_PROTOLOGTOOL = true; + /** * DEBUG level log. * @@ -44,8 +48,10 @@ public class ProtoLog { */ public static void d(IProtoLogGroup group, String messageString, Object... args) { // Stub, replaced by the ProtoLogTool. - throw new UnsupportedOperationException( - "ProtoLog calls MUST be processed with ProtoLogTool"); + if (REQUIRE_PROTOLOGTOOL) { + throw new UnsupportedOperationException( + "ProtoLog calls MUST be processed with ProtoLogTool"); + } } /** @@ -57,8 +63,10 @@ public class ProtoLog { */ public static void v(IProtoLogGroup group, String messageString, Object... args) { // Stub, replaced by the ProtoLogTool. - throw new UnsupportedOperationException( - "ProtoLog calls MUST be processed with ProtoLogTool"); + if (REQUIRE_PROTOLOGTOOL) { + throw new UnsupportedOperationException( + "ProtoLog calls MUST be processed with ProtoLogTool"); + } } /** @@ -70,8 +78,10 @@ public class ProtoLog { */ public static void i(IProtoLogGroup group, String messageString, Object... args) { // Stub, replaced by the ProtoLogTool. - throw new UnsupportedOperationException( - "ProtoLog calls MUST be processed with ProtoLogTool"); + if (REQUIRE_PROTOLOGTOOL) { + throw new UnsupportedOperationException( + "ProtoLog calls MUST be processed with ProtoLogTool"); + } } /** @@ -83,8 +93,10 @@ public class ProtoLog { */ public static void w(IProtoLogGroup group, String messageString, Object... args) { // Stub, replaced by the ProtoLogTool. - throw new UnsupportedOperationException( - "ProtoLog calls MUST be processed with ProtoLogTool"); + if (REQUIRE_PROTOLOGTOOL) { + throw new UnsupportedOperationException( + "ProtoLog calls MUST be processed with ProtoLogTool"); + } } /** @@ -96,8 +108,10 @@ public class ProtoLog { */ public static void e(IProtoLogGroup group, String messageString, Object... args) { // Stub, replaced by the ProtoLogTool. - throw new UnsupportedOperationException( - "ProtoLog calls MUST be processed with ProtoLogTool"); + if (REQUIRE_PROTOLOGTOOL) { + throw new UnsupportedOperationException( + "ProtoLog calls MUST be processed with ProtoLogTool"); + } } /** @@ -109,7 +123,9 @@ public class ProtoLog { */ public static void wtf(IProtoLogGroup group, String messageString, Object... args) { // Stub, replaced by the ProtoLogTool. - throw new UnsupportedOperationException( - "ProtoLog calls MUST be processed with ProtoLogTool"); + if (REQUIRE_PROTOLOGTOOL) { + throw new UnsupportedOperationException( + "ProtoLog calls MUST be processed with ProtoLogTool"); + } } } diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java index e709830342b5..bf42a60ac033 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java @@ -34,6 +34,7 @@ import android.provider.Settings; import android.util.Log; import android.util.TimingsTraceLog; +import com.android.internal.protolog.common.ProtoLog; import com.android.systemui.dagger.ContextComponentHelper; import com.android.systemui.dagger.GlobalRootComponent; import com.android.systemui.dagger.SysUIComponent; @@ -69,6 +70,8 @@ public class SystemUIApplication extends Application implements public SystemUIApplication() { super(); Log.v(TAG, "SystemUIApplication constructed."); + // SysUI may be building without protolog preprocessing in some cases + ProtoLog.REQUIRE_PROTOLOGTOOL = false; } @Override |