Loading libs/gui/SurfaceComposerClient.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -2768,6 +2768,20 @@ status_t SurfaceComposerClient::setOverrideFrameRate(uid_t uid, float frameRate) return statusTFromBinderStatus(status); } status_t SurfaceComposerClient::updateSmallAreaDetection(std::vector<int32_t>& uids, std::vector<float>& thresholds) { binder::Status status = ComposerServiceAIDL::getComposerService()->updateSmallAreaDetection(uids, thresholds); return statusTFromBinderStatus(status); } status_t SurfaceComposerClient::setSmallAreaDetectionThreshold(uid_t uid, float threshold) { binder::Status status = ComposerServiceAIDL::getComposerService()->setSmallAreaDetectionThreshold(uid, threshold); return statusTFromBinderStatus(status); } void SurfaceComposerClient::setAutoLowLatencyMode(const sp<IBinder>& display, bool on) { ComposerServiceAIDL::getComposerService()->setAutoLowLatencyMode(display, on); } Loading libs/gui/aidl/android/gui/ISurfaceComposer.aidl +9 −0 Original line number Diff line number Diff line Loading @@ -479,6 +479,15 @@ interface ISurfaceComposer { */ void setOverrideFrameRate(int uid, float frameRate); oneway void updateSmallAreaDetection(in int[] uids, in float[] thresholds); /** * Set the small area detection threshold for a specified uid by SmallAreaDetectionController. * Passing the threshold and uid to SurfaceFlinger to update the uid-threshold mapping * in the scheduler. */ oneway void setSmallAreaDetectionThreshold(int uid, float threshold); /** * Enables or disables the frame rate overlay in the top left corner. * Requires root or android.permission.HARDWARE_TEST Loading libs/gui/fuzzer/libgui_fuzzer_utils.h +3 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,9 @@ public: MOCK_METHOD(binder::Status, setDebugFlash, (int), (override)); MOCK_METHOD(binder::Status, scheduleComposite, (), (override)); MOCK_METHOD(binder::Status, scheduleCommit, (), (override)); MOCK_METHOD(binder::Status, updateSmallAreaDetection, (const std::vector<int32_t>&, const std::vector<float>&), (override)); MOCK_METHOD(binder::Status, setSmallAreaDetectionThreshold, (int32_t, float), (override)); MOCK_METHOD(binder::Status, getGpuContextPriority, (int32_t*), (override)); MOCK_METHOD(binder::Status, getMaxAcquiredBufferCount, (int32_t*), (override)); MOCK_METHOD(binder::Status, addWindowInfosListener, Loading libs/gui/include/gui/SurfaceComposerClient.h +10 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,16 @@ public: // by GameManager. static status_t setOverrideFrameRate(uid_t uid, float frameRate); // Update the small area detection whole uid-threshold mappings by same size uid and threshold // vector. // Ref:setSmallAreaDetectionThreshold. static status_t updateSmallAreaDetection(std::vector<int32_t>& uids, std::vector<float>& thresholds); // Sets the small area detection threshold to particular apps (uid). Passing value 0 means // to disable small area detection to the app. static status_t setSmallAreaDetectionThreshold(uid_t uid, float threshold); // Switches on/off Auto Low Latency Mode on the connected display. This should only be // called if the connected display supports Auto Low Latency Mode as reported by // #getAutoLowLatencyModeSupport Loading libs/gui/tests/Surface_test.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -999,6 +999,15 @@ public: binder::Status scheduleCommit() override { return binder::Status::ok(); } binder::Status updateSmallAreaDetection(const std::vector<int32_t>& /*uids*/, const std::vector<float>& /*thresholds*/) { return binder::Status::ok(); } binder::Status setSmallAreaDetectionThreshold(int32_t /*uid*/, float /*threshold*/) { return binder::Status::ok(); } binder::Status getGpuContextPriority(int32_t* /*outPriority*/) override { return binder::Status::ok(); } Loading Loading
libs/gui/SurfaceComposerClient.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -2768,6 +2768,20 @@ status_t SurfaceComposerClient::setOverrideFrameRate(uid_t uid, float frameRate) return statusTFromBinderStatus(status); } status_t SurfaceComposerClient::updateSmallAreaDetection(std::vector<int32_t>& uids, std::vector<float>& thresholds) { binder::Status status = ComposerServiceAIDL::getComposerService()->updateSmallAreaDetection(uids, thresholds); return statusTFromBinderStatus(status); } status_t SurfaceComposerClient::setSmallAreaDetectionThreshold(uid_t uid, float threshold) { binder::Status status = ComposerServiceAIDL::getComposerService()->setSmallAreaDetectionThreshold(uid, threshold); return statusTFromBinderStatus(status); } void SurfaceComposerClient::setAutoLowLatencyMode(const sp<IBinder>& display, bool on) { ComposerServiceAIDL::getComposerService()->setAutoLowLatencyMode(display, on); } Loading
libs/gui/aidl/android/gui/ISurfaceComposer.aidl +9 −0 Original line number Diff line number Diff line Loading @@ -479,6 +479,15 @@ interface ISurfaceComposer { */ void setOverrideFrameRate(int uid, float frameRate); oneway void updateSmallAreaDetection(in int[] uids, in float[] thresholds); /** * Set the small area detection threshold for a specified uid by SmallAreaDetectionController. * Passing the threshold and uid to SurfaceFlinger to update the uid-threshold mapping * in the scheduler. */ oneway void setSmallAreaDetectionThreshold(int uid, float threshold); /** * Enables or disables the frame rate overlay in the top left corner. * Requires root or android.permission.HARDWARE_TEST Loading
libs/gui/fuzzer/libgui_fuzzer_utils.h +3 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,9 @@ public: MOCK_METHOD(binder::Status, setDebugFlash, (int), (override)); MOCK_METHOD(binder::Status, scheduleComposite, (), (override)); MOCK_METHOD(binder::Status, scheduleCommit, (), (override)); MOCK_METHOD(binder::Status, updateSmallAreaDetection, (const std::vector<int32_t>&, const std::vector<float>&), (override)); MOCK_METHOD(binder::Status, setSmallAreaDetectionThreshold, (int32_t, float), (override)); MOCK_METHOD(binder::Status, getGpuContextPriority, (int32_t*), (override)); MOCK_METHOD(binder::Status, getMaxAcquiredBufferCount, (int32_t*), (override)); MOCK_METHOD(binder::Status, addWindowInfosListener, Loading
libs/gui/include/gui/SurfaceComposerClient.h +10 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,16 @@ public: // by GameManager. static status_t setOverrideFrameRate(uid_t uid, float frameRate); // Update the small area detection whole uid-threshold mappings by same size uid and threshold // vector. // Ref:setSmallAreaDetectionThreshold. static status_t updateSmallAreaDetection(std::vector<int32_t>& uids, std::vector<float>& thresholds); // Sets the small area detection threshold to particular apps (uid). Passing value 0 means // to disable small area detection to the app. static status_t setSmallAreaDetectionThreshold(uid_t uid, float threshold); // Switches on/off Auto Low Latency Mode on the connected display. This should only be // called if the connected display supports Auto Low Latency Mode as reported by // #getAutoLowLatencyModeSupport Loading
libs/gui/tests/Surface_test.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -999,6 +999,15 @@ public: binder::Status scheduleCommit() override { return binder::Status::ok(); } binder::Status updateSmallAreaDetection(const std::vector<int32_t>& /*uids*/, const std::vector<float>& /*thresholds*/) { return binder::Status::ok(); } binder::Status setSmallAreaDetectionThreshold(int32_t /*uid*/, float /*threshold*/) { return binder::Status::ok(); } binder::Status getGpuContextPriority(int32_t* /*outPriority*/) override { return binder::Status::ok(); } Loading