Loading core/java/com/android/internal/protolog/PerfettoProtoLogImpl.java +11 −7 Original line number Diff line number Diff line Loading @@ -122,18 +122,20 @@ public class PerfettoProtoLogImpl extends IProtoLogClient.Stub implements IProto private final Lock mBackgroundServiceLock = new ReentrantLock(); private ExecutorService mBackgroundLoggingService = Executors.newSingleThreadExecutor(); public PerfettoProtoLogImpl(@NonNull IProtoLogGroup[] groups) { public PerfettoProtoLogImpl(@NonNull IProtoLogGroup[] groups) throws ServiceManager.ServiceNotFoundException { this(null, null, null, () -> {}, groups); } public PerfettoProtoLogImpl(@NonNull Runnable cacheUpdater, @NonNull IProtoLogGroup[] groups) { public PerfettoProtoLogImpl(@NonNull Runnable cacheUpdater, @NonNull IProtoLogGroup[] groups) throws ServiceManager.ServiceNotFoundException { this(null, null, null, cacheUpdater, groups); } public PerfettoProtoLogImpl( @NonNull String viewerConfigFilePath, @NonNull Runnable cacheUpdater, @NonNull IProtoLogGroup[] groups) { @NonNull IProtoLogGroup[] groups) throws ServiceManager.ServiceNotFoundException { this(viewerConfigFilePath, null, new ProtoLogViewerConfigReader(() -> { Loading Loading @@ -177,12 +179,14 @@ public class PerfettoProtoLogImpl extends IProtoLogClient.Stub implements IProto @Nullable ViewerConfigInputStreamProvider viewerConfigInputStreamProvider, @Nullable ProtoLogViewerConfigReader viewerConfigReader, @NonNull Runnable cacheUpdater, @NonNull IProtoLogGroup[] groups) { @NonNull IProtoLogGroup[] groups) throws ServiceManager.ServiceNotFoundException { this(viewerConfigFilePath, viewerConfigInputStreamProvider, viewerConfigReader, cacheUpdater, groups, ProtoLogDataSource::new, IProtoLogConfigurationService.Stub .asInterface(ServiceManager.getService(PROTOLOG_CONFIGURATION_SERVICE)) android.tracing.Flags.clientSideProtoLogging() ? IProtoLogConfigurationService.Stub.asInterface( ServiceManager.getServiceOrThrow(PROTOLOG_CONFIGURATION_SERVICE) ) : null ); } Loading Loading @@ -222,7 +226,7 @@ public class PerfettoProtoLogImpl extends IProtoLogClient.Stub implements IProto if (android.tracing.Flags.clientSideProtoLogging()) { mProtoLogConfigurationService = configurationService; Objects.requireNonNull(mProtoLogConfigurationService, "ServiceManager returned a null ProtoLog Configuration Service"); "A null ProtoLog Configuration Service was provided!"); try { var args = new ProtoLogConfigurationServiceImpl.RegisterClientArgs(); Loading core/java/com/android/internal/protolog/ProtoLog.java +7 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.protolog; import android.os.ServiceManager; import com.android.internal.protolog.common.IProtoLog; import com.android.internal.protolog.common.IProtoLogGroup; import com.android.internal.protolog.common.LogLevel; Loading Loading @@ -76,7 +78,11 @@ public class ProtoLog { groups = allGroups.toArray(new IProtoLogGroup[0]); } try { sProtoLogInstance = new PerfettoProtoLogImpl(groups); } catch (ServiceManager.ServiceNotFoundException e) { throw new RuntimeException(e); } } } else { sProtoLogInstance = new LogcatOnlyProtoLogImpl(); Loading core/java/com/android/internal/protolog/ProtoLogImpl.java +18 −12 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static com.android.internal.protolog.common.ProtoLogToolInjected.Value.LO import static com.android.internal.protolog.common.ProtoLogToolInjected.Value.VIEWER_CONFIG_PATH; import android.annotation.Nullable; import android.os.ServiceManager; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -106,6 +107,7 @@ public class ProtoLogImpl { final var groups = sLogGroups.values().toArray(new IProtoLogGroup[0]); if (android.tracing.Flags.perfettoProtologTracing()) { try { File f = new File(sViewerConfigPath); if (!ProtoLog.REQUIRE_PROTOLOGTOOL && !f.exists()) { // TODO(b/353530422): Remove - temporary fix to unblock b/352290057 Loading @@ -114,11 +116,15 @@ public class ProtoLogImpl { Log.w(LOG_TAG, "Failed to find viewerConfigFile when setting up " + ProtoLogImpl.class.getSimpleName() + ". " + "Setting up without a viewer config instead..."); sServiceInstance = new PerfettoProtoLogImpl(sCacheUpdater, groups); } else { sServiceInstance = new PerfettoProtoLogImpl(sViewerConfigPath, sCacheUpdater, groups); } } catch (ServiceManager.ServiceNotFoundException e) { throw new RuntimeException(e); } } else { var protologImpl = new LegacyProtoLogImpl( sLegacyOutputFilePath, sLegacyViewerConfigPath, sCacheUpdater); Loading Loading
core/java/com/android/internal/protolog/PerfettoProtoLogImpl.java +11 −7 Original line number Diff line number Diff line Loading @@ -122,18 +122,20 @@ public class PerfettoProtoLogImpl extends IProtoLogClient.Stub implements IProto private final Lock mBackgroundServiceLock = new ReentrantLock(); private ExecutorService mBackgroundLoggingService = Executors.newSingleThreadExecutor(); public PerfettoProtoLogImpl(@NonNull IProtoLogGroup[] groups) { public PerfettoProtoLogImpl(@NonNull IProtoLogGroup[] groups) throws ServiceManager.ServiceNotFoundException { this(null, null, null, () -> {}, groups); } public PerfettoProtoLogImpl(@NonNull Runnable cacheUpdater, @NonNull IProtoLogGroup[] groups) { public PerfettoProtoLogImpl(@NonNull Runnable cacheUpdater, @NonNull IProtoLogGroup[] groups) throws ServiceManager.ServiceNotFoundException { this(null, null, null, cacheUpdater, groups); } public PerfettoProtoLogImpl( @NonNull String viewerConfigFilePath, @NonNull Runnable cacheUpdater, @NonNull IProtoLogGroup[] groups) { @NonNull IProtoLogGroup[] groups) throws ServiceManager.ServiceNotFoundException { this(viewerConfigFilePath, null, new ProtoLogViewerConfigReader(() -> { Loading Loading @@ -177,12 +179,14 @@ public class PerfettoProtoLogImpl extends IProtoLogClient.Stub implements IProto @Nullable ViewerConfigInputStreamProvider viewerConfigInputStreamProvider, @Nullable ProtoLogViewerConfigReader viewerConfigReader, @NonNull Runnable cacheUpdater, @NonNull IProtoLogGroup[] groups) { @NonNull IProtoLogGroup[] groups) throws ServiceManager.ServiceNotFoundException { this(viewerConfigFilePath, viewerConfigInputStreamProvider, viewerConfigReader, cacheUpdater, groups, ProtoLogDataSource::new, IProtoLogConfigurationService.Stub .asInterface(ServiceManager.getService(PROTOLOG_CONFIGURATION_SERVICE)) android.tracing.Flags.clientSideProtoLogging() ? IProtoLogConfigurationService.Stub.asInterface( ServiceManager.getServiceOrThrow(PROTOLOG_CONFIGURATION_SERVICE) ) : null ); } Loading Loading @@ -222,7 +226,7 @@ public class PerfettoProtoLogImpl extends IProtoLogClient.Stub implements IProto if (android.tracing.Flags.clientSideProtoLogging()) { mProtoLogConfigurationService = configurationService; Objects.requireNonNull(mProtoLogConfigurationService, "ServiceManager returned a null ProtoLog Configuration Service"); "A null ProtoLog Configuration Service was provided!"); try { var args = new ProtoLogConfigurationServiceImpl.RegisterClientArgs(); Loading
core/java/com/android/internal/protolog/ProtoLog.java +7 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.protolog; import android.os.ServiceManager; import com.android.internal.protolog.common.IProtoLog; import com.android.internal.protolog.common.IProtoLogGroup; import com.android.internal.protolog.common.LogLevel; Loading Loading @@ -76,7 +78,11 @@ public class ProtoLog { groups = allGroups.toArray(new IProtoLogGroup[0]); } try { sProtoLogInstance = new PerfettoProtoLogImpl(groups); } catch (ServiceManager.ServiceNotFoundException e) { throw new RuntimeException(e); } } } else { sProtoLogInstance = new LogcatOnlyProtoLogImpl(); Loading
core/java/com/android/internal/protolog/ProtoLogImpl.java +18 −12 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import static com.android.internal.protolog.common.ProtoLogToolInjected.Value.LO import static com.android.internal.protolog.common.ProtoLogToolInjected.Value.VIEWER_CONFIG_PATH; import android.annotation.Nullable; import android.os.ServiceManager; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -106,6 +107,7 @@ public class ProtoLogImpl { final var groups = sLogGroups.values().toArray(new IProtoLogGroup[0]); if (android.tracing.Flags.perfettoProtologTracing()) { try { File f = new File(sViewerConfigPath); if (!ProtoLog.REQUIRE_PROTOLOGTOOL && !f.exists()) { // TODO(b/353530422): Remove - temporary fix to unblock b/352290057 Loading @@ -114,11 +116,15 @@ public class ProtoLogImpl { Log.w(LOG_TAG, "Failed to find viewerConfigFile when setting up " + ProtoLogImpl.class.getSimpleName() + ". " + "Setting up without a viewer config instead..."); sServiceInstance = new PerfettoProtoLogImpl(sCacheUpdater, groups); } else { sServiceInstance = new PerfettoProtoLogImpl(sViewerConfigPath, sCacheUpdater, groups); } } catch (ServiceManager.ServiceNotFoundException e) { throw new RuntimeException(e); } } else { var protologImpl = new LegacyProtoLogImpl( sLegacyOutputFilePath, sLegacyViewerConfigPath, sCacheUpdater); Loading