Loading libs/gui/ISurfaceComposer.cpp +36 −0 Original line number Diff line number Diff line Loading @@ -833,6 +833,33 @@ public: } return reply.readInt32(); } virtual status_t getAllowedDisplayConfigs(const sp<IBinder>& displayToken, std::vector<int32_t>* outAllowedConfigs) { if (!outAllowedConfigs) return BAD_VALUE; Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { ALOGE("getAllowedDisplayConfigs failed to writeInterfaceToken: %d", result); return result; } result = data.writeStrongBinder(displayToken); if (result != NO_ERROR) { ALOGE("getAllowedDisplayConfigs failed to writeStrongBinder: %d", result); return result; } result = remote()->transact(BnSurfaceComposer::GET_ALLOWED_DISPLAY_CONFIGS, data, &reply); if (result != NO_ERROR) { ALOGE("getAllowedDisplayConfigs failed to transact: %d", result); return result; } result = reply.readInt32Vector(outAllowedConfigs); if (result != NO_ERROR) { ALOGE("getAllowedDisplayConfigs failed to readInt32Vector: %d", result); return result; } return reply.readInt32(); } }; // Out-of-line virtual method definition to trigger vtable emission in this Loading Loading @@ -1354,6 +1381,15 @@ status_t BnSurfaceComposer::onTransact( reply->writeInt32(result); return result; } case GET_ALLOWED_DISPLAY_CONFIGS: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken = data.readStrongBinder(); std::vector<int32_t> allowedConfigs; status_t result = getAllowedDisplayConfigs(displayToken, &allowedConfigs); reply->writeInt32Vector(allowedConfigs); reply->writeInt32(result); return result; } default: { return BBinder::onTransact(code, data, reply, flags); } Loading libs/gui/SurfaceComposerClient.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -1388,6 +1388,12 @@ status_t SurfaceComposerClient::setAllowedDisplayConfigs( allowedConfigs); } status_t SurfaceComposerClient::getAllowedDisplayConfigs(const sp<IBinder>& displayToken, std::vector<int32_t>* outAllowedConfigs) { return ComposerService::getComposerService()->getAllowedDisplayConfigs(displayToken, outAllowedConfigs); } status_t SurfaceComposerClient::getDisplayColorModes(const sp<IBinder>& display, Vector<ColorMode>* outColorModes) { return ComposerService::getComposerService()->getDisplayColorModes(display, outColorModes); Loading libs/gui/include/gui/ISurfaceComposer.h +9 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,14 @@ public: */ virtual status_t setAllowedDisplayConfigs(const sp<IBinder>& displayToken, const std::vector<int32_t>& allowedConfigs) = 0; /* * Returns the allowed display configurations currently set. * The allowedConfigs in a vector of indexes corresponding to the configurations * returned from getDisplayConfigs(). */ virtual status_t getAllowedDisplayConfigs(const sp<IBinder>& displayToken, std::vector<int32_t>* outAllowedConfigs) = 0; }; // ---------------------------------------------------------------------------- Loading Loading @@ -416,6 +424,7 @@ public: ADD_REGION_SAMPLING_LISTENER, REMOVE_REGION_SAMPLING_LISTENER, SET_ALLOWED_DISPLAY_CONFIGS, GET_ALLOWED_DISPLAY_CONFIGS, // Always append new enum to the end. }; Loading libs/gui/include/gui/SurfaceComposerClient.h +6 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,12 @@ public: static status_t setAllowedDisplayConfigs(const sp<IBinder>& displayToken, const std::vector<int32_t>& allowedConfigs); // Returns the allowed display configurations currently set. // The allowedConfigs in a vector of indexes corresponding to the configurations // returned from getDisplayConfigs(). static status_t getAllowedDisplayConfigs(const sp<IBinder>& displayToken, std::vector<int32_t>* outAllowedConfigs); // Gets the list of supported color modes for the given display static status_t getDisplayColorModes(const sp<IBinder>& display, Vector<ui::ColorMode>* outColorModes); Loading libs/gui/tests/Surface_test.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -683,6 +683,10 @@ public: const std::vector<int32_t>& /*allowedConfigs*/) override { return NO_ERROR; } status_t getAllowedDisplayConfigs(const sp<IBinder>& /*displayToken*/, std::vector<int32_t>* /*outAllowedConfigs*/) override { return NO_ERROR; } protected: IBinder* onAsBinder() override { return nullptr; } Loading Loading
libs/gui/ISurfaceComposer.cpp +36 −0 Original line number Diff line number Diff line Loading @@ -833,6 +833,33 @@ public: } return reply.readInt32(); } virtual status_t getAllowedDisplayConfigs(const sp<IBinder>& displayToken, std::vector<int32_t>* outAllowedConfigs) { if (!outAllowedConfigs) return BAD_VALUE; Parcel data, reply; status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (result != NO_ERROR) { ALOGE("getAllowedDisplayConfigs failed to writeInterfaceToken: %d", result); return result; } result = data.writeStrongBinder(displayToken); if (result != NO_ERROR) { ALOGE("getAllowedDisplayConfigs failed to writeStrongBinder: %d", result); return result; } result = remote()->transact(BnSurfaceComposer::GET_ALLOWED_DISPLAY_CONFIGS, data, &reply); if (result != NO_ERROR) { ALOGE("getAllowedDisplayConfigs failed to transact: %d", result); return result; } result = reply.readInt32Vector(outAllowedConfigs); if (result != NO_ERROR) { ALOGE("getAllowedDisplayConfigs failed to readInt32Vector: %d", result); return result; } return reply.readInt32(); } }; // Out-of-line virtual method definition to trigger vtable emission in this Loading Loading @@ -1354,6 +1381,15 @@ status_t BnSurfaceComposer::onTransact( reply->writeInt32(result); return result; } case GET_ALLOWED_DISPLAY_CONFIGS: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken = data.readStrongBinder(); std::vector<int32_t> allowedConfigs; status_t result = getAllowedDisplayConfigs(displayToken, &allowedConfigs); reply->writeInt32Vector(allowedConfigs); reply->writeInt32(result); return result; } default: { return BBinder::onTransact(code, data, reply, flags); } Loading
libs/gui/SurfaceComposerClient.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -1388,6 +1388,12 @@ status_t SurfaceComposerClient::setAllowedDisplayConfigs( allowedConfigs); } status_t SurfaceComposerClient::getAllowedDisplayConfigs(const sp<IBinder>& displayToken, std::vector<int32_t>* outAllowedConfigs) { return ComposerService::getComposerService()->getAllowedDisplayConfigs(displayToken, outAllowedConfigs); } status_t SurfaceComposerClient::getDisplayColorModes(const sp<IBinder>& display, Vector<ColorMode>* outColorModes) { return ComposerService::getComposerService()->getDisplayColorModes(display, outColorModes); Loading
libs/gui/include/gui/ISurfaceComposer.h +9 −0 Original line number Diff line number Diff line Loading @@ -368,6 +368,14 @@ public: */ virtual status_t setAllowedDisplayConfigs(const sp<IBinder>& displayToken, const std::vector<int32_t>& allowedConfigs) = 0; /* * Returns the allowed display configurations currently set. * The allowedConfigs in a vector of indexes corresponding to the configurations * returned from getDisplayConfigs(). */ virtual status_t getAllowedDisplayConfigs(const sp<IBinder>& displayToken, std::vector<int32_t>* outAllowedConfigs) = 0; }; // ---------------------------------------------------------------------------- Loading Loading @@ -416,6 +424,7 @@ public: ADD_REGION_SAMPLING_LISTENER, REMOVE_REGION_SAMPLING_LISTENER, SET_ALLOWED_DISPLAY_CONFIGS, GET_ALLOWED_DISPLAY_CONFIGS, // Always append new enum to the end. }; Loading
libs/gui/include/gui/SurfaceComposerClient.h +6 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,12 @@ public: static status_t setAllowedDisplayConfigs(const sp<IBinder>& displayToken, const std::vector<int32_t>& allowedConfigs); // Returns the allowed display configurations currently set. // The allowedConfigs in a vector of indexes corresponding to the configurations // returned from getDisplayConfigs(). static status_t getAllowedDisplayConfigs(const sp<IBinder>& displayToken, std::vector<int32_t>* outAllowedConfigs); // Gets the list of supported color modes for the given display static status_t getDisplayColorModes(const sp<IBinder>& display, Vector<ui::ColorMode>* outColorModes); Loading
libs/gui/tests/Surface_test.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -683,6 +683,10 @@ public: const std::vector<int32_t>& /*allowedConfigs*/) override { return NO_ERROR; } status_t getAllowedDisplayConfigs(const sp<IBinder>& /*displayToken*/, std::vector<int32_t>* /*outAllowedConfigs*/) override { return NO_ERROR; } protected: IBinder* onAsBinder() override { return nullptr; } Loading