Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce5d1c94 authored by Pablo Gamito's avatar Pablo Gamito
Browse files

Ensure we always have a logger

Test: n/a
Flag: EXEMPT refactor
Change-Id: I20b8b262c47dfababd37c33b7b4212f4623a6156
parent f38dbe48
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -205,10 +205,11 @@ public class PerfettoProtoLogImpl extends IProtoLogClient.Stub implements IProto

    @Override
    public void toggleLogcat(boolean enabled, String[] groups) {
        final ILogger logger = (message) -> Log.d(LOG_TAG, message);
        if (enabled) {
            startLoggingToLogcat(groups, null);
            startLoggingToLogcat(groups, logger);
        } else {
            stopLoggingToLogcat(groups, null);
            stopLoggingToLogcat(groups, logger);
        }
    }

@@ -218,7 +219,7 @@ public class PerfettoProtoLogImpl extends IProtoLogClient.Stub implements IProto
     * @param logger A logger to write status updates to
     * @return status code
     */
    public int startLoggingToLogcat(String[] groups, ILogger logger) {
    public int startLoggingToLogcat(String[] groups, @NonNull ILogger logger) {
        if (mViewerConfigReader != null) {
            mViewerConfigReader.loadViewerConfig(groups, logger);
        }
@@ -231,7 +232,7 @@ public class PerfettoProtoLogImpl extends IProtoLogClient.Stub implements IProto
     * @param logger A logger to write status updates to
     * @return status code
     */
    public int stopLoggingToLogcat(String[] groups, ILogger logger) {
    public int stopLoggingToLogcat(String[] groups, @NonNull ILogger logger) {
        if (mViewerConfigReader != null) {
            mViewerConfigReader.unloadViewerConfig(groups, logger);
        }