diff options
author | 2024-11-14 14:42:49 -0800 | |
---|---|---|
committer | 2024-11-14 22:46:31 +0000 | |
commit | 708ebfbcfabb8f28cb88c5b39b099424e894530e (patch) | |
tree | 8cde48e9e669cd418f20110dc3899fc1f4011046 /services/surfaceflinger/SurfaceFlinger.cpp | |
parent | 7a3c56f80f101c0c4500f574fc44feb4fbb23de9 (diff) |
SF: add a backdoor to introduce a janky frame to HWC
Bug: 346503493
Test: adb shell service call SurfaceFlinger 1046 i32 3Test: adb root && adb shell service call SurfaceFlinger 1046 i32 3
Flag: EXEMPT bugfix
Change-Id: Ic4a837ef06aca40a24db9c1121e19e3e1a1e0d80
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 9854174bbd..f9e5db0079 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -6263,7 +6263,7 @@ status_t SurfaceFlinger::CheckTransactCodeCredentials(uint32_t code) { } // Numbers from 1000 to 1045 are currently used for backdoors. The code // in onTransact verifies that the user is root, and has access to use SF. - if (code >= 1000 && code <= 1045) { + if (code >= 1000 && code <= 1046) { ALOGV("Accessing SurfaceFlinger through backdoor code: %u", code); return OK; } @@ -6796,6 +6796,15 @@ status_t SurfaceFlinger::onTransact(uint32_t code, const Parcel& data, Parcel* r } return err; } + // Introduce jank to HWC + case 1046: { + int32_t jankDelayMs = 0; + if (data.readInt32(&jankDelayMs) != NO_ERROR) { + return BAD_VALUE; + } + mScheduler->setDebugPresentDelay(TimePoint::fromNs(ms2ns(jankDelayMs))); + return NO_ERROR; + } } } return err; |