Loading cmds/dumpstate/dumpstate.cpp +11 −16 Original line number Diff line number Diff line Loading @@ -1186,6 +1186,15 @@ static void RunDumpsysNormal() { } static void DumpHals() { if (!ds.IsZipping()) { RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z", "--debug"}, CommandOptions::WithTimeout(10).AsRootIfAvailable().Build()); return; } DurationReporter duration_reporter("DUMP HALS"); RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z"}, CommandOptions::WithTimeout(2).AsRootIfAvailable().Build()); using android::hidl::manager::V1_0::IServiceManager; using android::hardware::defaultServiceManager; Loading Loading @@ -1262,14 +1271,7 @@ static void dumpstate() { {"ps", "-A", "-T", "-Z", "-O", "pri,nice,rtprio,sched,pcy,time"}); RunCommand("LIBRANK", {"librank"}, CommandOptions::AS_ROOT); if (ds.IsZipping()) { RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z"}, CommandOptions::WithTimeout(2).AsRootIfAvailable().Build()); DumpHals(); } else { RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z", "--debug"}, CommandOptions::WithTimeout(10).AsRootIfAvailable().Build()); } RunCommand("PRINTENV", {"printenv"}); RunCommand("NETSTAT", {"netstat", "-nW"}); Loading Loading @@ -1575,14 +1577,7 @@ static void DumpstateWifiOnly() { RunDumpsys("DUMPSYS", {"wifi"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); if (ds.IsZipping()) { RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z"}, CommandOptions::WithTimeout(2).AsRootIfAvailable().Build()); DumpHals(); } else { RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z", "--debug"}, CommandOptions::WithTimeout(10).AsRootIfAvailable().Build()); } printf("========================================================\n"); printf("== dumpstate: done (id %d)\n", ds.id_); Loading cmds/service/service.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -232,7 +232,6 @@ int main(int argc, char* const argv[]) else if (strcmp(key, "categories") == 0) { char* context2 = nullptr; int categoryCount = 0; categories[categoryCount] = strtok_r(value, ",", &context2); while (categories[categoryCount] != nullptr) Loading libs/gui/ISurfaceComposer.cpp +82 −0 Original line number Diff line number Diff line Loading @@ -860,6 +860,59 @@ public: } return reply.readInt32(); } virtual status_t getDisplayBrightnessSupport(const sp<IBinder>& displayToken, bool* outSupport) const { Parcel data, reply; status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (error != NO_ERROR) { ALOGE("getDisplayBrightnessSupport: failed to write interface token: %d", error); return error; } error = data.writeStrongBinder(displayToken); if (error != NO_ERROR) { ALOGE("getDisplayBrightnessSupport: failed to write display token: %d", error); return error; } error = remote()->transact(BnSurfaceComposer::GET_DISPLAY_BRIGHTNESS_SUPPORT, data, &reply); if (error != NO_ERROR) { ALOGE("getDisplayBrightnessSupport: failed to transact: %d", error); return error; } bool support; error = reply.readBool(&support); if (error != NO_ERROR) { ALOGE("getDisplayBrightnessSupport: failed to read support: %d", error); return error; } *outSupport = support; return NO_ERROR; } virtual status_t setDisplayBrightness(const sp<IBinder>& displayToken, float brightness) const { Parcel data, reply; status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (error != NO_ERROR) { ALOGE("setDisplayBrightness: failed to write interface token: %d", error); return error; } error = data.writeStrongBinder(displayToken); if (error != NO_ERROR) { ALOGE("setDisplayBrightness: failed to write display token: %d", error); return error; } error = data.writeFloat(brightness); if (error != NO_ERROR) { ALOGE("setDisplayBrightness: failed to write brightness: %d", error); return error; } error = remote()->transact(BnSurfaceComposer::SET_DISPLAY_BRIGHTNESS, data, &reply); if (error != NO_ERROR) { ALOGE("setDisplayBrightness: failed to transact: %d", error); return error; } return NO_ERROR; } }; // Out-of-line virtual method definition to trigger vtable emission in this Loading Loading @@ -1390,6 +1443,35 @@ status_t BnSurfaceComposer::onTransact( reply->writeInt32(result); return result; } case GET_DISPLAY_BRIGHTNESS_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken; status_t error = data.readNullableStrongBinder(&displayToken); if (error != NO_ERROR) { ALOGE("getDisplayBrightnessSupport: failed to read display token: %d", error); return error; } bool support = false; error = getDisplayBrightnessSupport(displayToken, &support); reply->writeBool(support); return error; } case SET_DISPLAY_BRIGHTNESS: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken; status_t error = data.readNullableStrongBinder(&displayToken); if (error != NO_ERROR) { ALOGE("setDisplayBrightness: failed to read display token: %d", error); return error; } float brightness = -1.0f; error = data.readFloat(&brightness); if (error != NO_ERROR) { ALOGE("setDisplayBrightness: failed to read brightness: %d", error); return error; } return setDisplayBrightness(displayToken, brightness); } default: { return BBinder::onTransact(code, data, reply, flags); } Loading libs/gui/SurfaceComposerClient.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -1503,6 +1503,17 @@ status_t SurfaceComposerClient::removeRegionSamplingListener( return ComposerService::getComposerService()->removeRegionSamplingListener(listener); } bool SurfaceComposerClient::getDisplayBrightnessSupport(const sp<IBinder>& displayToken) { bool support = false; ComposerService::getComposerService()->getDisplayBrightnessSupport(displayToken, &support); return support; } status_t SurfaceComposerClient::setDisplayBrightness(const sp<IBinder>& displayToken, float brightness) { return ComposerService::getComposerService()->setDisplayBrightness(displayToken, brightness); } // ---------------------------------------------------------------------------- status_t ScreenshotClient::capture(const sp<IBinder>& display, const ui::Dataspace reqDataSpace, Loading libs/gui/include/gui/ISurfaceComposer.h +33 −0 Original line number Diff line number Diff line Loading @@ -376,6 +376,37 @@ public: */ virtual status_t getAllowedDisplayConfigs(const sp<IBinder>& displayToken, std::vector<int32_t>* outAllowedConfigs) = 0; /* * Gets whether brightness operations are supported on a display. * * displayToken * The token of the display. * outSupport * An output parameter for whether brightness operations are supported. * * Returns NO_ERROR upon success. Otherwise, * NAME_NOT_FOUND if the display is invalid, or * BAD_VALUE if the output parameter is invalid. */ virtual status_t getDisplayBrightnessSupport(const sp<IBinder>& displayToken, bool* outSupport) const = 0; /* * Sets the brightness of a display. * * displayToken * The token of the display whose brightness is set. * brightness * A number between 0.0f (minimum brightness) and 1.0 (maximum brightness), or -1.0f to * turn the backlight off. * * Returns NO_ERROR upon success. Otherwise, * NAME_NOT_FOUND if the display is invalid, or * BAD_VALUE if the brightness is invalid, or * INVALID_OPERATION if brightness operations are not supported. */ virtual status_t setDisplayBrightness(const sp<IBinder>& displayToken, float brightness) const = 0; }; // ---------------------------------------------------------------------------- Loading Loading @@ -425,6 +456,8 @@ public: REMOVE_REGION_SAMPLING_LISTENER, SET_ALLOWED_DISPLAY_CONFIGS, GET_ALLOWED_DISPLAY_CONFIGS, GET_DISPLAY_BRIGHTNESS_SUPPORT, SET_DISPLAY_BRIGHTNESS, // Always append new enum to the end. }; Loading Loading
cmds/dumpstate/dumpstate.cpp +11 −16 Original line number Diff line number Diff line Loading @@ -1186,6 +1186,15 @@ static void RunDumpsysNormal() { } static void DumpHals() { if (!ds.IsZipping()) { RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z", "--debug"}, CommandOptions::WithTimeout(10).AsRootIfAvailable().Build()); return; } DurationReporter duration_reporter("DUMP HALS"); RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z"}, CommandOptions::WithTimeout(2).AsRootIfAvailable().Build()); using android::hidl::manager::V1_0::IServiceManager; using android::hardware::defaultServiceManager; Loading Loading @@ -1262,14 +1271,7 @@ static void dumpstate() { {"ps", "-A", "-T", "-Z", "-O", "pri,nice,rtprio,sched,pcy,time"}); RunCommand("LIBRANK", {"librank"}, CommandOptions::AS_ROOT); if (ds.IsZipping()) { RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z"}, CommandOptions::WithTimeout(2).AsRootIfAvailable().Build()); DumpHals(); } else { RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z", "--debug"}, CommandOptions::WithTimeout(10).AsRootIfAvailable().Build()); } RunCommand("PRINTENV", {"printenv"}); RunCommand("NETSTAT", {"netstat", "-nW"}); Loading Loading @@ -1575,14 +1577,7 @@ static void DumpstateWifiOnly() { RunDumpsys("DUMPSYS", {"wifi"}, CommandOptions::WithTimeout(90).Build(), SEC_TO_MSEC(10)); if (ds.IsZipping()) { RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z"}, CommandOptions::WithTimeout(2).AsRootIfAvailable().Build()); DumpHals(); } else { RunCommand("HARDWARE HALS", {"lshal", "-lVSietrpc", "--types=b,c,l,z", "--debug"}, CommandOptions::WithTimeout(10).AsRootIfAvailable().Build()); } printf("========================================================\n"); printf("== dumpstate: done (id %d)\n", ds.id_); Loading
cmds/service/service.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -232,7 +232,6 @@ int main(int argc, char* const argv[]) else if (strcmp(key, "categories") == 0) { char* context2 = nullptr; int categoryCount = 0; categories[categoryCount] = strtok_r(value, ",", &context2); while (categories[categoryCount] != nullptr) Loading
libs/gui/ISurfaceComposer.cpp +82 −0 Original line number Diff line number Diff line Loading @@ -860,6 +860,59 @@ public: } return reply.readInt32(); } virtual status_t getDisplayBrightnessSupport(const sp<IBinder>& displayToken, bool* outSupport) const { Parcel data, reply; status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (error != NO_ERROR) { ALOGE("getDisplayBrightnessSupport: failed to write interface token: %d", error); return error; } error = data.writeStrongBinder(displayToken); if (error != NO_ERROR) { ALOGE("getDisplayBrightnessSupport: failed to write display token: %d", error); return error; } error = remote()->transact(BnSurfaceComposer::GET_DISPLAY_BRIGHTNESS_SUPPORT, data, &reply); if (error != NO_ERROR) { ALOGE("getDisplayBrightnessSupport: failed to transact: %d", error); return error; } bool support; error = reply.readBool(&support); if (error != NO_ERROR) { ALOGE("getDisplayBrightnessSupport: failed to read support: %d", error); return error; } *outSupport = support; return NO_ERROR; } virtual status_t setDisplayBrightness(const sp<IBinder>& displayToken, float brightness) const { Parcel data, reply; status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (error != NO_ERROR) { ALOGE("setDisplayBrightness: failed to write interface token: %d", error); return error; } error = data.writeStrongBinder(displayToken); if (error != NO_ERROR) { ALOGE("setDisplayBrightness: failed to write display token: %d", error); return error; } error = data.writeFloat(brightness); if (error != NO_ERROR) { ALOGE("setDisplayBrightness: failed to write brightness: %d", error); return error; } error = remote()->transact(BnSurfaceComposer::SET_DISPLAY_BRIGHTNESS, data, &reply); if (error != NO_ERROR) { ALOGE("setDisplayBrightness: failed to transact: %d", error); return error; } return NO_ERROR; } }; // Out-of-line virtual method definition to trigger vtable emission in this Loading Loading @@ -1390,6 +1443,35 @@ status_t BnSurfaceComposer::onTransact( reply->writeInt32(result); return result; } case GET_DISPLAY_BRIGHTNESS_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken; status_t error = data.readNullableStrongBinder(&displayToken); if (error != NO_ERROR) { ALOGE("getDisplayBrightnessSupport: failed to read display token: %d", error); return error; } bool support = false; error = getDisplayBrightnessSupport(displayToken, &support); reply->writeBool(support); return error; } case SET_DISPLAY_BRIGHTNESS: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken; status_t error = data.readNullableStrongBinder(&displayToken); if (error != NO_ERROR) { ALOGE("setDisplayBrightness: failed to read display token: %d", error); return error; } float brightness = -1.0f; error = data.readFloat(&brightness); if (error != NO_ERROR) { ALOGE("setDisplayBrightness: failed to read brightness: %d", error); return error; } return setDisplayBrightness(displayToken, brightness); } default: { return BBinder::onTransact(code, data, reply, flags); } Loading
libs/gui/SurfaceComposerClient.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -1503,6 +1503,17 @@ status_t SurfaceComposerClient::removeRegionSamplingListener( return ComposerService::getComposerService()->removeRegionSamplingListener(listener); } bool SurfaceComposerClient::getDisplayBrightnessSupport(const sp<IBinder>& displayToken) { bool support = false; ComposerService::getComposerService()->getDisplayBrightnessSupport(displayToken, &support); return support; } status_t SurfaceComposerClient::setDisplayBrightness(const sp<IBinder>& displayToken, float brightness) { return ComposerService::getComposerService()->setDisplayBrightness(displayToken, brightness); } // ---------------------------------------------------------------------------- status_t ScreenshotClient::capture(const sp<IBinder>& display, const ui::Dataspace reqDataSpace, Loading
libs/gui/include/gui/ISurfaceComposer.h +33 −0 Original line number Diff line number Diff line Loading @@ -376,6 +376,37 @@ public: */ virtual status_t getAllowedDisplayConfigs(const sp<IBinder>& displayToken, std::vector<int32_t>* outAllowedConfigs) = 0; /* * Gets whether brightness operations are supported on a display. * * displayToken * The token of the display. * outSupport * An output parameter for whether brightness operations are supported. * * Returns NO_ERROR upon success. Otherwise, * NAME_NOT_FOUND if the display is invalid, or * BAD_VALUE if the output parameter is invalid. */ virtual status_t getDisplayBrightnessSupport(const sp<IBinder>& displayToken, bool* outSupport) const = 0; /* * Sets the brightness of a display. * * displayToken * The token of the display whose brightness is set. * brightness * A number between 0.0f (minimum brightness) and 1.0 (maximum brightness), or -1.0f to * turn the backlight off. * * Returns NO_ERROR upon success. Otherwise, * NAME_NOT_FOUND if the display is invalid, or * BAD_VALUE if the brightness is invalid, or * INVALID_OPERATION if brightness operations are not supported. */ virtual status_t setDisplayBrightness(const sp<IBinder>& displayToken, float brightness) const = 0; }; // ---------------------------------------------------------------------------- Loading Loading @@ -425,6 +456,8 @@ public: REMOVE_REGION_SAMPLING_LISTENER, SET_ALLOWED_DISPLAY_CONFIGS, GET_ALLOWED_DISPLAY_CONFIGS, GET_DISPLAY_BRIGHTNESS_SUPPORT, SET_DISPLAY_BRIGHTNESS, // Always append new enum to the end. }; Loading