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

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

Snap for 7256110 from a2928e7e to sc-release

Change-Id: Ie9bd41e8bf8d2fe32130db12073a5423cd604f19
parents 9d0e172c a2928e7e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ clang_format = true
# Only turn on clang-format check for the following subfolders.
clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp
               cmds/idlcli/
               cmds/servicemanager/
               include/input/
               include/powermanager/
               libs/binder/fuzzer/
+29 −0
Original line number Diff line number Diff line
@@ -497,6 +497,35 @@ void ASurfaceTransaction_setFrameRateWithChangeStrategy(ASurfaceTransaction* tra
                                      int8_t compatibility, int8_t changeFrameRateStrategy)
                                      __INTRODUCED_IN(31);

/**
 * Indicate whether to enable backpressure for buffer submission to a given SurfaceControl.
 *
 * By default backpressure is disabled, which means submitting a buffer prior to receiving
 * a callback for the previous buffer could lead to that buffer being "dropped". In cases
 * where you are selecting for latency, this may be a desirable behavior! We had a new buffer
 * ready, why shouldn't we show it?
 *
 * When back pressure is enabled, each buffer will be required to be presented
 * before it is released and the callback delivered
 * (absent the whole SurfaceControl being removed).
 *
 * Most apps are likely to have some sort of backpressure internally, e.g. you are
 * waiting on the callback from frame N-2 before starting frame N. In high refresh
 * rate scenarios there may not be much time between SurfaceFlinger completing frame
 * N-1 (and therefore releasing buffer N-2) and beginning frame N. This means
 * your app may not have enough time to respond in the callback. Using this flag
 * and pushing buffers earlier for server side queuing will be advantageous
 * in such cases.
 *
 * \param transaction The transaction in which to make the change.
 * \param surface_control The ASurfaceControl on which to control buffer backpressure behavior.
 * \param enableBackPressure Whether to enable back pressure.
 */
void ASurfaceTransaction_setEnableBackPressure(ASurfaceTransaction* transaction,
                                               ASurfaceControl* surface_control,
                                               bool enableBackPressure)
                                               __INTRODUCED_IN(31);

__END_DECLS

#endif // ANDROID_SURFACE_CONTROL_H
+0 −1
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ libbinder_device_interface_sources = [
    "IActivityManager.cpp",
    "IAppOpsCallback.cpp",
    "IAppOpsService.cpp",
    "IMediaResourceMonitor.cpp",
    "IPermissionController.cpp",
    "IProcessInfoService.cpp",
    "IUidObserver.cpp",
+6 −3
Original line number Diff line number Diff line
@@ -194,10 +194,13 @@ bool BpBinder::isDescriptorCached() const {
const String16& BpBinder::getInterfaceDescriptor() const
{
    if (isDescriptorCached() == false) {
        Parcel send, reply;
        sp<BpBinder> thiz = const_cast<BpBinder*>(this);

        Parcel data;
        data.markForBinder(thiz);
        Parcel reply;
        // do the IPC without a lock held.
        status_t err = const_cast<BpBinder*>(this)->transact(
                INTERFACE_TRANSACTION, send, &reply);
        status_t err = thiz->transact(INTERFACE_TRANSACTION, data, &reply);
        if (err == NO_ERROR) {
            String16 res(reply.readString16());
            Mutex::Autolock _l(mLock);
+0 −63
Original line number Diff line number Diff line
/*
 * Copyright 2016 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.
 */

#include <binder/IMediaResourceMonitor.h>
#include <binder/Parcel.h>
#include <utils/Errors.h>
#include <sys/types.h>

namespace android {

// ----------------------------------------------------------------------

class BpMediaResourceMonitor : public BpInterface<IMediaResourceMonitor> {
public:
    explicit BpMediaResourceMonitor(const sp<IBinder>& impl)
        : BpInterface<IMediaResourceMonitor>(impl) {}

    virtual void notifyResourceGranted(/*in*/ int32_t pid, /*in*/ const int32_t type)
    {
        Parcel data, reply;
        data.writeInterfaceToken(IMediaResourceMonitor::getInterfaceDescriptor());
        data.writeInt32(pid);
        data.writeInt32(type);
        remote()->transact(NOTIFY_RESOURCE_GRANTED, data, &reply, IBinder::FLAG_ONEWAY);
    }
};

IMPLEMENT_META_INTERFACE(MediaResourceMonitor, "android.media.IMediaResourceMonitor")

// ----------------------------------------------------------------------

// NOLINTNEXTLINE(google-default-arguments)
status_t BnMediaResourceMonitor::onTransact( uint32_t code, const Parcel& data, Parcel* reply,
        uint32_t flags) {
    switch(code) {
        case NOTIFY_RESOURCE_GRANTED: {
            CHECK_INTERFACE(IMediaResourceMonitor, data, reply);
            int32_t pid = data.readInt32();
            const int32_t type = data.readInt32();
            notifyResourceGranted(/*in*/ pid, /*in*/ type);
            return NO_ERROR;
        } break;
        default:
            return BBinder::onTransact(code, data, reply, flags);
    }
}

// ----------------------------------------------------------------------

} // namespace android
Loading