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

Commit f5fdff8d authored by Brian Lindahl's avatar Brian Lindahl
Browse files

Notify listeners about active picture profiles

Bug: 337330263
Test: atest ActivePictureUpdaterTest
Test: atest SurfaceControlPictureProfileTest
Flag: com.android.graphics.libgui.flags.apply_picture_profiles
Change-Id: If08b79faf3d3c4c07248ecd7385a75cfe5357726
parent c6102c0a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3280,6 +3280,13 @@ status_t SurfaceComposerClient::removeHdrLayerInfoListener(
    return statusTFromBinderStatus(status);
}

status_t SurfaceComposerClient::setActivePictureListener(
        const sp<gui::IActivePictureListener>& listener) {
    binder::Status status =
            ComposerServiceAIDL::getComposerService()->setActivePictureListener(listener);
    return statusTFromBinderStatus(status);
}

status_t SurfaceComposerClient::notifyPowerBoost(int32_t boostId) {
    binder::Status status = ComposerServiceAIDL::getComposerService()->notifyPowerBoost(boostId);
    return statusTFromBinderStatus(status);
+32 −0
Original line number Diff line number Diff line
/*
 * Copyright 2024 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.gui;

/**
 * Visible content that is using picture processing.
 * @hide
 */
parcelable ActivePicture {
    /** The layer ID that is using picture processing. */
    int layerId;

    /** UID that owns layer using picture processing. */
    int ownerUid;

    /** ID of the picture profile that was used to configure the picture processing. */
    long pictureProfileId;
}
+30 −0
Original line number Diff line number Diff line
/*
 * Copyright 2024 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.gui;

import android.gui.ActivePicture;

/**
 * Receive callbacks whenever the visible content using picture profiles changes.
 * @hide
 */
interface IActivePictureListener {
    /**
     * Callback reporting the visible content on the screen using picture profiles.
     */
    oneway void onActivePicturesChanged(in ActivePicture[] activePictures);
}
+7 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.gui.FrameEvent;
import android.gui.FrameStats;
import android.gui.HdrConversionCapability;
import android.gui.HdrConversionStrategy;
import android.gui.IActivePictureListener;
import android.gui.IDisplayEventConnection;
import android.gui.IFpsListener;
import android.gui.IHdrLayerInfoListener;
@@ -599,4 +600,10 @@ interface ISurfaceComposer {
     * past the provided VSync.
     */
    oneway void removeJankListener(int layerId, IJankListener listener, long afterVsync);

    /**
     * Sets the listener used to monitor visible content that is being processed with picture
     * profiles.
     */
    oneway void setActivePictureListener(IActivePictureListener listener);
}
+2 −0
Original line number Diff line number Diff line
@@ -298,6 +298,8 @@ public:
    static status_t removeHdrLayerInfoListener(const sp<IBinder>& displayToken,
                                               const sp<gui::IHdrLayerInfoListener>& listener);

    static status_t setActivePictureListener(const sp<gui::IActivePictureListener>& listener);

    /*
     * Sends a power boost to the composer. This function is asynchronous.
     *
Loading