Loading core/java/com/android/internal/protolog/ProtoLogConfigurationServiceImpl.java +22 −20 Original line number Diff line number Diff line Loading @@ -199,9 +199,9 @@ public class ProtoLogConfigurationServiceImpl extends IProtoLogConfigurationServ mConfigFileCounts.put(viewerConfigFile, mConfigFileCounts.getOrDefault(viewerConfigFile, 0) + 1); } } registerGroups(client, args.groups, args.groupsDefaultLogcatStatus); registerGroupsLocked(client, args.groups, args.groupsDefaultLogcatStatus); } clientBinder.linkToDeath(this, /* flags= */ 0); } Loading @@ -209,7 +209,9 @@ public class ProtoLogConfigurationServiceImpl extends IProtoLogConfigurationServ @Override public void registerGroups(@NonNull IProtoLogClient client, @NonNull RegisterGroupsArgs args) throws RemoteException { registerGroups(client, args.groups, args.groupsDefaultLogcatStatus); synchronized (mConfigLock) { registerGroupsLocked(client, args.groups, args.groupsDefaultLogcatStatus); } } /** Loading Loading @@ -327,7 +329,8 @@ public class ProtoLogConfigurationServiceImpl extends IProtoLogConfigurationServ unregisterClient(IProtoLogClient.Stub.asInterface(clientBinder)); } private void registerGroups(@NonNull IProtoLogClient client, @NonNull String[] groups, @GuardedBy("mConfigLock") private void registerGroupsLocked(@NonNull IProtoLogClient client, @NonNull String[] groups, @NonNull boolean[] logcatStatuses) throws RemoteException { if (groups.length != logcatStatuses.length) { throw new RuntimeException( Loading @@ -336,10 +339,10 @@ public class ProtoLogConfigurationServiceImpl extends IProtoLogConfigurationServ + " and logcatStatuses has length " + logcatStatuses.length); } synchronized (mConfigLock) { final var clientRecord = mClientRecords.get(client.asBinder()); if (clientRecord == null) { throw new RuntimeException("Client " + client + " is not registered"); Log.wtf(LOG_TAG, "Trying to add groups to unregistered client: " + client); return; } for (int i = 0; i < groups.length; i++) { Loading @@ -358,7 +361,6 @@ public class ProtoLogConfigurationServiceImpl extends IProtoLogConfigurationServ } } } } private void toggleProtoLogToLogcat( @NonNull PrintWriter pw, boolean enabled, @NonNull String[] groups Loading Loading
core/java/com/android/internal/protolog/ProtoLogConfigurationServiceImpl.java +22 −20 Original line number Diff line number Diff line Loading @@ -199,9 +199,9 @@ public class ProtoLogConfigurationServiceImpl extends IProtoLogConfigurationServ mConfigFileCounts.put(viewerConfigFile, mConfigFileCounts.getOrDefault(viewerConfigFile, 0) + 1); } } registerGroups(client, args.groups, args.groupsDefaultLogcatStatus); registerGroupsLocked(client, args.groups, args.groupsDefaultLogcatStatus); } clientBinder.linkToDeath(this, /* flags= */ 0); } Loading @@ -209,7 +209,9 @@ public class ProtoLogConfigurationServiceImpl extends IProtoLogConfigurationServ @Override public void registerGroups(@NonNull IProtoLogClient client, @NonNull RegisterGroupsArgs args) throws RemoteException { registerGroups(client, args.groups, args.groupsDefaultLogcatStatus); synchronized (mConfigLock) { registerGroupsLocked(client, args.groups, args.groupsDefaultLogcatStatus); } } /** Loading Loading @@ -327,7 +329,8 @@ public class ProtoLogConfigurationServiceImpl extends IProtoLogConfigurationServ unregisterClient(IProtoLogClient.Stub.asInterface(clientBinder)); } private void registerGroups(@NonNull IProtoLogClient client, @NonNull String[] groups, @GuardedBy("mConfigLock") private void registerGroupsLocked(@NonNull IProtoLogClient client, @NonNull String[] groups, @NonNull boolean[] logcatStatuses) throws RemoteException { if (groups.length != logcatStatuses.length) { throw new RuntimeException( Loading @@ -336,10 +339,10 @@ public class ProtoLogConfigurationServiceImpl extends IProtoLogConfigurationServ + " and logcatStatuses has length " + logcatStatuses.length); } synchronized (mConfigLock) { final var clientRecord = mClientRecords.get(client.asBinder()); if (clientRecord == null) { throw new RuntimeException("Client " + client + " is not registered"); Log.wtf(LOG_TAG, "Trying to add groups to unregistered client: " + client); return; } for (int i = 0; i < groups.length; i++) { Loading @@ -358,7 +361,6 @@ public class ProtoLogConfigurationServiceImpl extends IProtoLogConfigurationServ } } } } private void toggleProtoLogToLogcat( @NonNull PrintWriter pw, boolean enabled, @NonNull String[] groups Loading