1 /*
2 * Copyright (C) 2024 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #include "src/trace_redaction/filtering.h"
18
19 namespace perfetto::trace_redaction {
20
21 PidFilter::~PidFilter() = default;
22
Includes(const Context & context,uint64_t ts,int32_t pid) const23 bool ConnectedToPackage::Includes(const Context& context,
24 uint64_t ts,
25 int32_t pid) const {
26 PERFETTO_DCHECK(context.timeline);
27 PERFETTO_DCHECK(context.package_uid.has_value());
28 return context.timeline->PidConnectsToUid(ts, pid, *context.package_uid);
29 }
30
Includes(const Context &,uint64_t,int32_t) const31 bool AllowAll::Includes(const Context&, uint64_t, int32_t) const {
32 return true;
33 }
34
Includes(const Context &,protozero::Field) const35 bool AllowAll::Includes(const Context&, protozero::Field) const {
36 return true;
37 }
38
39 } // namespace perfetto::trace_redaction
40