Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8957ee4 authored by Alec Mouri's avatar Alec Mouri
Browse files

Change fps listener permission to allow systemui to use it.

Require READ_FRAME_BUFFER permission instead of ACCESS_SURFACE_FLINGER,
so that systemui is allowed to listen to FPS measurements.

Strictly speaking, the fps listener does not require as strict of
permissions as screenshots because there's no on-screen content, but
systemui is already requesting this permission, and we probably don't
want arbitrary apps to backdoor into this api.

Bug: 174956756
Test: end to end integration test to check that systemui does not crash
when registering the listener.

Change-Id: I9149618950988250ae2649ac5242d5165b5037db
parent 8f751f89
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -4945,8 +4945,6 @@ status_t SurfaceFlinger::CheckTransactCodeCredentials(uint32_t code) {
        case GET_DISPLAYED_CONTENT_SAMPLE:
        case GET_DISPLAYED_CONTENT_SAMPLE:
        case NOTIFY_POWER_BOOST:
        case NOTIFY_POWER_BOOST:
        case SET_GLOBAL_SHADOW_SETTINGS:
        case SET_GLOBAL_SHADOW_SETTINGS:
        case ADD_FPS_LISTENER:
        case REMOVE_FPS_LISTENER:
        case ACQUIRE_FRAME_RATE_FLEXIBILITY_TOKEN: {
        case ACQUIRE_FRAME_RATE_FLEXIBILITY_TOKEN: {
            // ACQUIRE_FRAME_RATE_FLEXIBILITY_TOKEN is used by CTS tests, which acquire the
            // ACQUIRE_FRAME_RATE_FLEXIBILITY_TOKEN is used by CTS tests, which acquire the
            // necessary permission dynamically. Don't use the permission cache for this check.
            // necessary permission dynamically. Don't use the permission cache for this check.
@@ -5009,6 +5007,8 @@ status_t SurfaceFlinger::CheckTransactCodeCredentials(uint32_t code) {
            // This is not sensitive information, so should not require permission control.
            // This is not sensitive information, so should not require permission control.
            return OK;
            return OK;
        }
        }
        case ADD_FPS_LISTENER:
        case REMOVE_FPS_LISTENER:
        case ADD_REGION_SAMPLING_LISTENER:
        case ADD_REGION_SAMPLING_LISTENER:
        case REMOVE_REGION_SAMPLING_LISTENER: {
        case REMOVE_REGION_SAMPLING_LISTENER: {
            // codes that require permission check
            // codes that require permission check