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

Commit ab1ebb2f authored by Haofan Wang's avatar Haofan Wang
Browse files

Move get picture/sound parameters API to a callback

The getPictureParameters API should be called from the HAL to the
framework. So created
setPictureParametersCallback(IPictureParametersCallback cb) to allow the
HAL receive parameters send from the client(framework).

Test: m on cuttlefish
Bug: 375472716
Flag: android.media.tv.flags.media_quality_fw
Change-Id: Id3b2cb3028d8e02947208de7c442b4d468c61b0a
parent 297f9fc3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -49,12 +49,12 @@ interface IMediaQuality {
  void setAutoAqEnabled(boolean enable);
  android.hardware.tv.mediaquality.IPictureProfileChangedListener getPictureProfileListener();
  void setPictureProfileAdjustmentListener(android.hardware.tv.mediaquality.IPictureProfileAdjustmentListener listener);
  android.hardware.tv.mediaquality.PictureParameters getPictureParameters(long pictureProfileId);
  void sendDefaultPictureParameters(in android.hardware.tv.mediaquality.PictureParameters pictureParameters);
  android.hardware.tv.mediaquality.ISoundProfileChangedListener getSoundProfileListener();
  void setSoundProfileAdjustmentListener(android.hardware.tv.mediaquality.ISoundProfileAdjustmentListener listener);
  android.hardware.tv.mediaquality.SoundParameters getSoundParameters(long soundProfileId);
  void sendDefaultSoundParameters(in android.hardware.tv.mediaquality.SoundParameters soundParameters);
  void getParamCaps(in android.hardware.tv.mediaquality.ParameterName[] paramNames, out android.hardware.tv.mediaquality.ParamCapability[] caps);
  void getVendorParamCaps(in android.hardware.tv.mediaquality.VendorParameterIdentifier[] names, out android.hardware.tv.mediaquality.VendorParamCapability[] caps);
  void setPictureParametersCallback(android.hardware.tv.mediaquality.IPictureParametersCallback callback);
  void setSoundParametersCallback(android.hardware.tv.mediaquality.ISoundParametersCallback callback);
}
+38 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 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.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.tv.mediaquality;
@VintfStability
interface IPictureParametersCallback {
  android.hardware.tv.mediaquality.PictureParameters getPictureParameters(long pictureProfileId);
}
+38 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 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.
 */
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
//     the interface (from the latest frozen version), the build system will
//     prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.hardware.tv.mediaquality;
@VintfStability
interface ISoundParametersCallback {
  android.hardware.tv.mediaquality.SoundParameters getSoundParameters(long SoundProfileId);
}
+28 −16
Original line number Diff line number Diff line
@@ -18,8 +18,10 @@ package android.hardware.tv.mediaquality;

import android.hardware.tv.mediaquality.AmbientBacklightSettings;
import android.hardware.tv.mediaquality.IMediaQualityCallback;
import android.hardware.tv.mediaquality.IPictureParametersCallback;
import android.hardware.tv.mediaquality.IPictureProfileAdjustmentListener;
import android.hardware.tv.mediaquality.IPictureProfileChangedListener;
import android.hardware.tv.mediaquality.ISoundParametersCallback;
import android.hardware.tv.mediaquality.ISoundProfileAdjustmentListener;
import android.hardware.tv.mediaquality.ISoundProfileChangedListener;
import android.hardware.tv.mediaquality.ParamCapability;
@@ -153,14 +155,6 @@ interface IMediaQuality {
     */
    void setPictureProfileAdjustmentListener(IPictureProfileAdjustmentListener listener);

    /**
     * Get the picture parameters by PictureProfile id. Check PictureParameters for its' detail.
     *
     * @param pictureProfileId The PictureProfile id that associate with the PictureProfile.
     * @return PictureParameters with all the pre-defined parameters and vendor defined parameters.
     */
    PictureParameters getPictureParameters(long pictureProfileId);

    /**
     * Send the default picture parameters to the vendor code or HAL to apply the picture
     * parameters.
@@ -184,14 +178,6 @@ interface IMediaQuality {
     */
    void setSoundProfileAdjustmentListener(ISoundProfileAdjustmentListener listener);

    /**
     * Get the sound parameters by SoundProfile id. Check SoundParameters for its' detail.
     *
     * @param soundProfileId The SoundProfile id that associate with a SoundProfile.
     * @return SoundParameters with all the pre-defined parameters and vendor defined parameters.
     */
    SoundParameters getSoundParameters(long soundProfileId);

    /**
     * Send the default sound parameters to the vendor code or HAL to apply the sound parameters.
     *
@@ -209,4 +195,30 @@ interface IMediaQuality {
     * Gets vendor capability information of the given parameters.
     */
    void getVendorParamCaps(in VendorParameterIdentifier[] names, out VendorParamCapability[] caps);

    /**
     * Sets picture parameters callback to get the picture parameters send by the client.
     *
     * When the same client registers this callback multiple times, only the most recent
     * registration will be active. The previous callback will be overwritten.
     *
     * When different client registers this callback, it will overwrite the previous registered
     * client. Only one callback can be active.
     *
     * @param callback Callback object to pass PictureParameters.
     */
    void setPictureParametersCallback(IPictureParametersCallback callback);

    /**
     * Sets sound parameters callback to get the sound parameters send by the client.
     *
     * When the same client registers this callback multiple times, only the most recent
     * registration will be active. The previous callback will be overwritten.
     *
     * When different client registers this callback, it will overwrite the previous registered
     * client. Only one callback can be active.
     *
     * @param callback Callback object to pass SoundParameters.
     */
    void setSoundParametersCallback(ISoundParametersCallback callback);
}
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 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.hardware.tv.mediaquality;

import android.hardware.tv.mediaquality.PictureParameters;

@VintfStability
interface IPictureParametersCallback {
    /**
     * Get the picture parameters by PictureProfile id. Check PictureParameters for its' detail.
     * This is called from the HAL to media quality framework.
     *
     * @param pictureProfileId The PictureProfile id that associate with the PictureProfile.
     * @return PictureParameters with all the pre-defined parameters and vendor defined parameters.
     */
    PictureParameters getPictureParameters(long pictureProfileId);
}
Loading