1 /*
2  * Copyright 2022 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 #pragma once
18 
19 #include <memory>
20 #include <vector>
21 
22 #include "le_audio_types.h"
23 
24 namespace bluetooth::le_audio {
25 
26 class ContentControlIdKeeper {
27  public:
28   ContentControlIdKeeper();
29   ~ContentControlIdKeeper() = default;
GetInstance(void)30   static ContentControlIdKeeper* GetInstance(void) {
31     static ContentControlIdKeeper* instance = new ContentControlIdKeeper();
32     return instance;
33   }
34   void Start(void);
35   void Stop(void);
36   void SetCcid(types::LeAudioContextType context_type, int ccid);
37   void SetCcid(const types::AudioContexts& contexts, int ccid);
38   int GetCcid(types::LeAudioContextType context_type) const;
39   std::vector<uint8_t> GetAllCcids(const types::AudioContexts& contexts) const;
40 
41  private:
42   struct impl;
43   std::unique_ptr<impl> pimpl_;
44 };
45 }  // namespace bluetooth::le_audio
46