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

Commit edee2a8a authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6098112 from 234fca17 to rvc-release

Change-Id: I0e09a858ca43dbe92fad639c86cd175c1cc108c8
parents 36c04dd9 234fca17
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.view;

/** @hide */
@Backing(type="int")
enum LayerMetadataKey {
    METADATA_OWNER_UID = 1,
    METADATA_WINDOW_TYPE = 2,
    METADATA_TASK_ID = 3,
    METADATA_MOUSE_CURSOR = 4,
}
+5 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ cc_library_shared {
    defaults: ["libgui_bufferqueue-defaults"],

    srcs: [
        ":framework_native_aidl",
        ":libgui_bufferqueue_sources",

        "BitTube.cpp",
@@ -106,6 +107,10 @@ cc_library_shared {
        "libdvr_headers",
        "libpdx_headers",
    ],

    aidl: {
        export_aidl_headers: true,
    }
}

// Used by media codec services exclusively as a static lib for
+151 −0
Original line number Diff line number Diff line
@@ -525,6 +525,88 @@ public:
        return static_cast<status_t>(reply.readInt32());
    }

    virtual status_t getAutoLowLatencyModeSupport(const sp<IBinder>& display,
                                                  bool* outSupport) const {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        status_t result = data.writeStrongBinder(display);
        if (result != NO_ERROR) {
            ALOGE("getAutoLowLatencyModeSupport failed to writeStrongBinder: %d", result);
            return result;
        }
        result = remote()->transact(BnSurfaceComposer::GET_AUTO_LOW_LATENCY_MODE_SUPPORT, data,
                                    &reply);
        if (result != NO_ERROR) {
            ALOGE("getAutoLowLatencyModeSupport failed to transact: %d", result);
            return result;
        }
        return reply.readBool(outSupport);
    }

    virtual void setAutoLowLatencyMode(const sp<IBinder>& display, bool on) {
        Parcel data, reply;
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (result != NO_ERROR) {
            ALOGE("setAutoLowLatencyMode failed to writeInterfaceToken: %d", result);
            return;
        }

        result = data.writeStrongBinder(display);
        if (result != NO_ERROR) {
            ALOGE("setAutoLowLatencyMode failed to writeStrongBinder: %d", result);
            return;
        }
        result = data.writeBool(on);
        if (result != NO_ERROR) {
            ALOGE("setAutoLowLatencyMode failed to writeBool: %d", result);
            return;
        }
        result = remote()->transact(BnSurfaceComposer::SET_AUTO_LOW_LATENCY_MODE, data, &reply);
        if (result != NO_ERROR) {
            ALOGE("setAutoLowLatencyMode failed to transact: %d", result);
            return;
        }
    }

    virtual status_t getGameContentTypeSupport(const sp<IBinder>& display, bool* outSupport) const {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        status_t result = data.writeStrongBinder(display);
        if (result != NO_ERROR) {
            ALOGE("getGameContentTypeSupport failed to writeStrongBinder: %d", result);
            return result;
        }
        result = remote()->transact(BnSurfaceComposer::GET_GAME_CONTENT_TYPE_SUPPORT, data, &reply);
        if (result != NO_ERROR) {
            ALOGE("getGameContentTypeSupport failed to transact: %d", result);
            return result;
        }
        return reply.readBool(outSupport);
    }

    virtual void setGameContentType(const sp<IBinder>& display, bool on) {
        Parcel data, reply;
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (result != NO_ERROR) {
            ALOGE("setGameContentType failed to writeInterfaceToken: %d", result);
            return;
        }
        result = data.writeStrongBinder(display);
        if (result != NO_ERROR) {
            ALOGE("setGameContentType failed to writeStrongBinder: %d", result);
            return;
        }
        result = data.writeBool(on);
        if (result != NO_ERROR) {
            ALOGE("setGameContentType failed to writeBool: %d", result);
            return;
        }
        result = remote()->transact(BnSurfaceComposer::SET_GAME_CONTENT_TYPE, data, &reply);
        if (result != NO_ERROR) {
            ALOGE("setGameContentType failed to transact: %d", result);
        }
    }

    virtual status_t clearAnimationFrameStats() {
        Parcel data, reply;
        status_t result = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
@@ -1354,6 +1436,75 @@ status_t BnSurfaceComposer::onTransact(
            result = reply->writeInt32(result);
            return result;
        }

        case GET_AUTO_LOW_LATENCY_MODE_SUPPORT: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
            status_t result = data.readStrongBinder(&display);
            if (result != NO_ERROR) {
                ALOGE("getAutoLowLatencyModeSupport failed to readStrongBinder: %d", result);
                return result;
            }
            bool supported = false;
            result = getAutoLowLatencyModeSupport(display, &supported);
            if (result == NO_ERROR) {
                result = reply->writeBool(supported);
            }
            return result;
        }

        case SET_AUTO_LOW_LATENCY_MODE: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
            status_t result = data.readStrongBinder(&display);
            if (result != NO_ERROR) {
                ALOGE("setAutoLowLatencyMode failed to readStrongBinder: %d", result);
                return result;
            }
            bool setAllm = false;
            result = data.readBool(&setAllm);
            if (result != NO_ERROR) {
                ALOGE("setAutoLowLatencyMode failed to readBool: %d", result);
                return result;
            }
            setAutoLowLatencyMode(display, setAllm);
            return result;
        }

        case GET_GAME_CONTENT_TYPE_SUPPORT: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
            status_t result = data.readStrongBinder(&display);
            if (result != NO_ERROR) {
                ALOGE("getGameContentTypeSupport failed to readStrongBinder: %d", result);
                return result;
            }
            bool supported = false;
            result = getGameContentTypeSupport(display, &supported);
            if (result == NO_ERROR) {
                result = reply->writeBool(supported);
            }
            return result;
        }

        case SET_GAME_CONTENT_TYPE: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> display = nullptr;
            status_t result = data.readStrongBinder(&display);
            if (result != NO_ERROR) {
                ALOGE("setGameContentType failed to readStrongBinder: %d", result);
                return result;
            }
            bool setGameContentTypeOn = false;
            result = data.readBool(&setGameContentTypeOn);
            if (result != NO_ERROR) {
                ALOGE("setGameContentType failed to readBool: %d", result);
                return result;
            }
            setGameContentType(display, setGameContentTypeOn);
            return result;
        }

        case CLEAR_ANIMATION_FRAME_STATS: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            status_t result = clearAnimationFrameStats();
+6 −4
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@
#include <binder/Parcel.h>
#include <gui/LayerMetadata.h>

#include "android/view/LayerMetadataKey.h"

using android::base::StringPrintf;

namespace android {
@@ -113,12 +115,12 @@ void LayerMetadata::setInt32(uint32_t key, int32_t value) {

std::string LayerMetadata::itemToString(uint32_t key, const char* separator) const {
    if (!has(key)) return std::string();
    switch (key) {
        case METADATA_OWNER_UID:
    switch (static_cast<view::LayerMetadataKey>(key)) {
        case view::LayerMetadataKey::METADATA_OWNER_UID:
            return StringPrintf("ownerUID%s%d", separator, getInt32(key, 0));
        case METADATA_WINDOW_TYPE:
        case view::LayerMetadataKey::METADATA_WINDOW_TYPE:
            return StringPrintf("windowType%s%d", separator, getInt32(key, 0));
        case METADATA_TASK_ID:
        case view::LayerMetadataKey::METADATA_TASK_ID:
            return StringPrintf("taskId%s%d", separator, getInt32(key, 0));
        default:
            return StringPrintf("%d%s%dbytes", key, separator,
+20 −0
Original line number Diff line number Diff line
@@ -1644,6 +1644,26 @@ status_t SurfaceComposerClient::setActiveColorMode(const sp<IBinder>& display,
    return ComposerService::getComposerService()->setActiveColorMode(display, colorMode);
}

bool SurfaceComposerClient::getAutoLowLatencyModeSupport(const sp<IBinder>& display) {
    bool supported = false;
    ComposerService::getComposerService()->getAutoLowLatencyModeSupport(display, &supported);
    return supported;
}

void SurfaceComposerClient::setAutoLowLatencyMode(const sp<IBinder>& display, bool on) {
    ComposerService::getComposerService()->setAutoLowLatencyMode(display, on);
}

bool SurfaceComposerClient::getGameContentTypeSupport(const sp<IBinder>& display) {
    bool supported = false;
    ComposerService::getComposerService()->getGameContentTypeSupport(display, &supported);
    return supported;
}

void SurfaceComposerClient::setGameContentType(const sp<IBinder>& display, bool on) {
    ComposerService::getComposerService()->setGameContentType(display, on);
}

void SurfaceComposerClient::setDisplayPowerMode(const sp<IBinder>& token,
        int mode) {
    ComposerService::getComposerService()->setPowerMode(token, mode);
Loading