1 /* 2 * Copyright (C) 2019 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 "AndroidAsyncMessagePipe.h" 20 #include "android/emulation/control/window_agent.h" 21 22 namespace android { 23 class MultiDisplayPipe : public AndroidAsyncMessagePipe { 24 public: 25 class Service : public AndroidAsyncMessagePipe::Service<MultiDisplayPipe> { 26 public: Service(const char * serviceName)27 Service(const char* serviceName) 28 : AndroidAsyncMessagePipe::Service<MultiDisplayPipe>(serviceName) 29 {} 30 }; 31 32 MultiDisplayPipe(AndroidPipe::Service* service, PipeArgs&& pipeArgs); 33 virtual ~MultiDisplayPipe(); 34 35 void onMessage(const std::vector<uint8_t>& data) override; 36 void fillData(std::vector<uint8_t>& data, uint32_t id, uint32_t w, uint32_t h, 37 uint32_t dpi, uint32_t flag, bool add); 38 virtual void onSave(base::Stream* stream) override; 39 virtual void onLoad(base::Stream* stream) override; 40 41 static MultiDisplayPipe* getInstance(); 42 const static uint8_t ADD; 43 const static uint8_t DEL; 44 const static uint8_t QUERY; 45 const static uint8_t BIND; 46 const static uint8_t MAX_DISPLAYS; 47 48 private: 49 Service* const mService; 50 }; 51 } 52 53 void android_init_multi_display_pipe(); 54