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

Commit 93b3d4f2 authored by Zach Johnson's avatar Zach Johnson Committed by Gerrit Code Review
Browse files

Merge "Add init flags to dumpsys"

parents 1527afff f8a9845a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -453,11 +453,13 @@ genrule {
    ],
    cmd: "$(location flatc) -I packages/modules/Bluetooth/system/gd -b --schema -o $(genDir) $(in) ",
    srcs: [
        "common/init_flags.fbs",
        "dumpsys_data.fbs",
        "l2cap/classic/l2cap_classic_module.fbs",
        "shim/dumpsys.fbs",
    ],
    out: [
        "init_flags.bfbs",
        "dumpsys.bfbs",
        "dumpsys_data.bfbs",
        "l2cap_classic_module.bfbs",
@@ -471,6 +473,7 @@ genrule {
    ],
    cmd: "$(location flatc) -I packages/modules/Bluetooth/system/gd -o $(genDir) --cpp $(in) ",
    srcs: [
        "common/init_flags.fbs",
        "dumpsys_data.fbs",
        "l2cap/classic/l2cap_classic_module.fbs",
        "shim/dumpsys.fbs",
@@ -478,6 +481,7 @@ genrule {
    out: [
        "dumpsys_data_generated.h",
        "dumpsys_generated.h",
        "init_flags_generated.h",
        "l2cap_classic_module_generated.h",
    ],
}
+12 −0
Original line number Diff line number Diff line
namespace bluetooth.common;

attribute "privacy";

table InitFlagsData {
    title:string;
    gd_hci_enabled:bool;
    gd_controller_enabled:bool;
    gd_core_enabled:bool;
}

root_type InitFlagsData;
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ filegroup {
    name: "BluetoothDumpsysSources",
    srcs: [
        "filter.cc",
        "init_flags.cc",
        "internal/filter_internal.cc",
        "reflection_schema.cc",
    ],
+3 −0
Original line number Diff line number Diff line
@@ -110,6 +110,9 @@ bool UserPrivacyFilter::FilterField(const reflection::Field* field, flatbuffers:
    case flatbuffers::BASE_TYPE_STRUCT:
      return internal::FilterTypeStruct(*field, table, privacy_level);
      break;
    case flatbuffers::BASE_TYPE_BOOL:
      return internal::FilterTypeBool(*field, table, privacy_level);
      break;
    default:
      LOG_WARN("%s WARN Unsupported base type\n", __func__);
      break;
+30 −0
Original line number Diff line number Diff line
/*
 * Copyright 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "common/init_flags.h"
#include "dumpsys/init_flags.h"
#include "init_flags_generated.h"

flatbuffers::Offset<bluetooth::common::InitFlagsData> bluetooth::dumpsys::InitFlags::Dump(
    flatbuffers::FlatBufferBuilder* fb_builder) {
  auto title = fb_builder->CreateString("----- Init Flags -----");
  common::InitFlagsDataBuilder builder(*fb_builder);
  builder.add_title(title);
  builder.add_gd_hci_enabled(bluetooth::common::InitFlags::GdHciEnabled());
  builder.add_gd_controller_enabled(bluetooth::common::InitFlags::GdControllerEnabled());
  builder.add_gd_core_enabled(bluetooth::common::InitFlags::GdCoreEnabled());
  return builder.Finish();
}
Loading