Skip to content
Snippets Groups Projects
Commit 9dcd4d16 authored by maxwen's avatar maxwen
Browse files

fix build errors

parent 7185075c
No related branches found
No related tags found
No related merge requests found
......@@ -9,9 +9,6 @@ LOCAL_SRC_FILES := \
src/VirtualDisplay.cpp \
src/main.cpp
#LOCAL_SRC_FILES += \
# aidl/org/chemlab/IVNCService.aidl
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/src \
external/tigervnc/common \
......@@ -25,16 +22,16 @@ LOCAL_SHARED_LIBRARIES := \
libssl \
libui \
libutils \
libz
libz \
liblog
LOCAL_STATIC_LIBRARIES += \
libtigervnc
LOCAL_CFLAGS := -DVNCFLINGER_VERSION="0.1"
LOCAL_CFLAGS += -Ofast -Werror -std=c++11 -fexceptions
LOCAL_CFLAGS += -Ofast -Werror -fexceptions -Wno-implicit-fallthrough
LOCAL_CFLAGS += -DLOG_NDEBUG=0
#LOCAL_CXX := /usr/bin/include-what-you-use
LOCAL_INIT_RC := etc/vncflinger.rc
......
package org.chemlab;
interface IVNCService {
boolean start();
boolean stop();
boolean setPort(int port);
boolean setV4Address(String addr);
boolean setV6Address(String addr);
boolean setPassword(String password);
boolean clearPassword();
}
service vncflinger /system/bin/vncflinger
service vncflinger /system/bin/vncflinger SecurityTypes=None
class late_start
disabled
user system
......
type vncflinger_exec, exec_type, file_type;
type vncflinger, domain;
typeattribute vncflinger coredomain;
init_daemon_domain(vncflinger)
binder_use(vncflinger)
......
......@@ -38,8 +38,6 @@ AndroidDesktop::~AndroidDesktop() {
}
void AndroidDesktop::start(rfb::VNCServer* vs) {
mMainDpy = SurfaceComposerClient::getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain);
mServer = vs;
mPixels = new AndroidPixelBuffer();
......@@ -157,7 +155,13 @@ void AndroidDesktop::pointerEvent(const rfb::Point& pos, int buttonMask) {
// refresh the display dimensions
status_t AndroidDesktop::updateDisplayInfo() {
status_t err = SurfaceComposerClient::getDisplayInfo(mMainDpy, &mDisplayInfo);
const auto displayToken = SurfaceComposerClient::getInternalDisplayToken();
if (displayToken == nullptr) {
ALOGE("Failed to get display token\n");
return -1;
}
status_t err = SurfaceComposerClient::getDisplayInfo(displayToken, &mDisplayInfo);
if (err != NO_ERROR) {
ALOGE("Failed to get display characteristics\n");
return err;
......
......@@ -78,7 +78,6 @@ class AndroidDesktop : public rfb::SDesktop,
sp<VirtualDisplay> mVirtualDisplay;
// Primary display
sp<IBinder> mMainDpy;
DisplayInfo mDisplayInfo;
// Virtual input device
......
......@@ -52,12 +52,17 @@ VirtualDisplay::VirtualDisplay(DisplayInfo* info, uint32_t width, uint32_t heigh
mDpy = SurfaceComposerClient::createDisplay(String8("VNC-VirtualDisplay"), false /*secure*/);
SurfaceComposerClient::openGlobalTransaction();
SurfaceComposerClient::setDisplaySurface(mDpy, mProducer);
const auto displayToken = SurfaceComposerClient::getInternalDisplayToken();
if (displayToken == nullptr) {
ALOGE("Failed to get display token\n");
return;
}
SurfaceComposerClient::setDisplayProjection(mDpy, 0, mSourceRect, displayRect);
SurfaceComposerClient::setDisplayLayerStack(mDpy, 0); // default stack
SurfaceComposerClient::closeGlobalTransaction();
SurfaceComposerClient::Transaction t;
t.setDisplaySurface(displayToken, mProducer);
t.setDisplayProjection(displayToken, 0, mSourceRect, displayRect);
t.setDisplayLayerStack(displayToken, 0); // default stack
t.apply();
ALOGV("Virtual display (%ux%u [viewport=%ux%u] created", width, height, displayRect.getWidth(),
displayRect.getHeight());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment