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

Commit a5d82b88 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes Iaa097f78,Id3f6918e,I0ee70c56

* changes:
  gd: Initial entry for main legacy storage shim
  gd: Initial entry for legacy storage shim
  gd: Initial entry for legacy config storage
parents 0428d33d c9abb347
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ cc_library {
        ":BluetoothPacketSources",
        ":BluetoothShimSources",
        ":BluetoothSecuritySources",
        ":BluetoothStorageSources",
    ],
    generated_headers: [
        "BluetoothGeneratedPackets_h",
@@ -251,6 +252,7 @@ cc_test {
        ":BluetoothPacketTestSources",
        ":BluetoothSecurityTestSources",
        ":BluetoothShimTestSources",
        ":BluetoothStorageTestSources",
    ],
    generated_headers: [
        "BluetoothGeneratedPackets_h",
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ filegroup {
            "scanning.cc",
            "security.cc",
            "stack.cc",
            "storage.cc",
    ],
}

+2 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ struct IL2cap;
struct IPage;
struct IScanning;
struct ISecurity;
struct IStorage;

struct IStack {
  virtual void Start() = 0;
@@ -50,6 +51,7 @@ struct IStack {
  virtual IPage* GetPage() = 0;
  virtual IScanning* GetScanning() = 0;
  virtual ISecurity* GetSecurity() = 0;
  virtual IStorage* GetStorage() = 0;

  virtual ~IStack() {}
};
+45 −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.
 */
#pragma once

#include <functional>
#include <memory>
#include <string>

struct config_t;

/**
 * The gd API exported to the legacy api
 */
namespace bluetooth {
namespace shim {

using ConfigReadCallback = std::function<void(std::unique_ptr<config_t>)>;
using ConfigWriteCallback = std::function<void(bool)>;
using ChecksumReadCallback = std::function<void(std::string)>;
using ChecksumWriteCallback = std::function<void(bool)>;

struct IStorage {
  virtual void ConfigRead(const std::string filename, ConfigReadCallback callback) = 0;
  virtual void ConfigWrite(const std::string filename, const config_t* config, ConfigWriteCallback callback) = 0;
  virtual void ChecksumRead(const std::string filename, ChecksumReadCallback callback) = 0;
  virtual void ChecksumWrite(const std::string filename, const std::string& checksum, ChecksumWriteCallback) = 0;

  virtual ~IStorage() {}
};

}  // namespace shim
}  // namespace bluetooth
+1 −0
Original line number Diff line number Diff line
@@ -36,3 +36,4 @@
#include "gd/shim/iscanning.h"
#include "gd/shim/isecurity.h"
#include "gd/shim/istack.h"
#include "gd/shim/istorage.h"
Loading