@@ -1840,6 +1840,24 @@ void SurfaceFlinger::setGameContentType(const sp<IBinder>& displayToken, bool on
18401840 }));
18411841}
18421842
1843+ status_t SurfaceFlinger::getMaxLayerPictureProfiles (const sp<IBinder>& displayToken,
1844+ int32_t * outMaxProfiles) {
1845+ const char * const whence = __func__;
1846+ auto future = mScheduler ->schedule ([=, this ]() FTL_FAKE_GUARD (mStateLock ) {
1847+ const ssize_t index = mCurrentState .displays .indexOfKey (displayToken);
1848+ if (index < 0 ) {
1849+ ALOGE (" %s: Invalid display token %p" , whence, displayToken.get ());
1850+ return 0 ;
1851+ }
1852+ const DisplayDeviceState& state = mCurrentState .displays .valueAt (index);
1853+ return state.maxLayerPictureProfiles > 0 ? state.maxLayerPictureProfiles
1854+ : state.hasPictureProcessing ? 1
1855+ : 0 ;
1856+ });
1857+ *outMaxProfiles = future.get ();
1858+ return NO_ERROR;
1859+ }
1860+
18431861status_t SurfaceFlinger::overrideHdrTypes (const sp<IBinder>& displayToken,
18441862 const std::vector<ui::Hdr>& hdrTypes) {
18451863 Mutex::Autolock lock (mStateLock );
@@ -8759,6 +8777,16 @@ binder::Status SurfaceComposerAIDL::setGameContentType(const sp<IBinder>& displa
87598777 return binder::Status::ok ();
87608778}
87618779
8780+ binder::Status SurfaceComposerAIDL::getMaxLayerPictureProfiles (const sp<IBinder>& display,
8781+ int32_t * outMaxProfiles) {
8782+ status_t status = checkAccessPermission ();
8783+ if (status != OK) {
8784+ return binderStatusFromStatusT (status);
8785+ }
8786+ mFlinger ->getMaxLayerPictureProfiles (display, outMaxProfiles);
8787+ return binder::Status::ok ();
8788+ }
8789+
87628790binder::Status SurfaceComposerAIDL::captureDisplay (
87638791 const DisplayCaptureArgs& args, const sp<IScreenCaptureListener>& captureListener) {
87648792 mFlinger ->captureDisplay (args, captureListener);
0 commit comments