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

Commit cab8437b authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[MQ] Clean up sound profile APIs" into main

parents e65e1950 48276939
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ public final class AmbientBacklightEvent implements Parcelable {
    @IntDef({AMBIENT_BACKLIGHT_EVENT_ENABLED, AMBIENT_BACKLIGHT_EVENT_DISABLED,
            AMBIENT_BACKLIGHT_EVENT_METADATA,
            AMBIENT_BACKLIGHT_EVENT_INTERRUPTED})
    public @interface AmbientBacklightEventTypes {}
    public @interface Type {}

    /**
     * Event type for ambient backlight events. The ambient backlight is enabled.
@@ -69,9 +69,9 @@ public final class AmbientBacklightEvent implements Parcelable {
    private final AmbientBacklightMetadata mMetadata;

    /**
     * Constructor of AmbientBacklightEvent.
     * Constructs AmbientBacklightEvent.
     */
    public AmbientBacklightEvent(int eventType,
    public AmbientBacklightEvent(@Type int eventType,
            @Nullable AmbientBacklightMetadata metadata) {
        mEventType = eventType;
        mMetadata = metadata;
@@ -85,6 +85,7 @@ public final class AmbientBacklightEvent implements Parcelable {
    /**
     * Gets event type.
     */
    @Type
    public int getEventType() {
        return mEventType;
    }
+20 −7
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@ import java.util.Arrays;

/**
 * Metadata of ambient backlight.
 *
 * <p>A metadata instance is sent from ambient backlight hardware in a {@link AmbientBacklightEvent}
 * with {@link AmbientBacklightEvent#AMBIENT_BACKLIGHT_EVENT_METADATA}.
 * @hide
 */
@FlaggedApi(Flags.FLAG_MEDIA_QUALITY_FW)
@@ -44,10 +47,15 @@ public final class AmbientBacklightMetadata implements Parcelable {
    private final int[] mZonesColors;

    /**
     * Constructor of AmbientBacklightMetadata.
     * Constructs AmbientBacklightMetadata.
     */
    public AmbientBacklightMetadata(@NonNull String packageName, int compressAlgorithm,
            int source, int colorFormat, int horizontalZonesNumber, int verticalZonesNumber,
    public AmbientBacklightMetadata(
            @NonNull String packageName,
            @AmbientBacklightSettings.CompressAlgorithm int compressAlgorithm,
            @AmbientBacklightSettings.Source int source,
            @PixelFormat.Format int colorFormat,
            int horizontalZonesNumber,
            int verticalZonesNumber,
            @NonNull int[] zonesColors) {
        mPackageName = packageName;
        mCompressAlgorithm = compressAlgorithm;
@@ -69,7 +77,7 @@ public final class AmbientBacklightMetadata implements Parcelable {
    }

    /**
     * Gets package name.
     * Gets package name of the metadata.
     * @hide
     */
    @NonNull
@@ -102,7 +110,9 @@ public final class AmbientBacklightMetadata implements Parcelable {
    }

    /**
     * Gets the number of lights in each horizontal zone.
     * Gets the number of horizontal color zones.
     *
     * <p>A color zone is a group of lights that always display the same color.
     */
    @IntRange(from = 0)
    public int getHorizontalZonesNumber() {
@@ -110,7 +120,9 @@ public final class AmbientBacklightMetadata implements Parcelable {
    }

    /**
     * Gets the number of lights in each vertical zone.
     * Gets the number of vertical color zones.
     *
     * <p>A color zone is a group of lights that always display the same color.
     */
    @IntRange(from = 0)
    public int getVerticalZonesNumber() {
@@ -118,10 +130,11 @@ public final class AmbientBacklightMetadata implements Parcelable {
    }

    /**
     * Gets color data of vertical color zones.
     * @hide
     */
    @NonNull
    public int[] getZonesColors() {
    public int[] getVerticalZonesColors() {
        return mZonesColors;
    }

+23 −6
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Settings for ambient backlight.
 * Settings to configure ambient backlight hardware.
 * @hide
 */
@FlaggedApi(Flags.FLAG_MEDIA_QUALITY_FW)
@@ -124,8 +124,13 @@ public final class AmbientBacklightSettings implements Parcelable {
    /**
     * Constructs AmbientBacklightSettings.
     */
    public AmbientBacklightSettings(int source, int maxFps, int colorFormat,
            int horizontalZonesNumber, int verticalZonesNumber, boolean isLetterboxOmitted,
    public AmbientBacklightSettings(
            @Source int source,
            int maxFps,
            @PixelFormat.Format int colorFormat,
            int horizontalZonesNumber,
            int verticalZonesNumber,
            boolean isLetterboxOmitted,
            int threshold) {
        mSource = source;
        mMaxFps = maxFps;
@@ -171,7 +176,9 @@ public final class AmbientBacklightSettings implements Parcelable {
    }

    /**
     * Gets the number of lights in each horizontal zone.
     * Gets the number of horizontal color zones.
     *
     * <p>A color zone is a group of lights that always display the same color.
     */
    @IntRange(from = 0)
    public int getHorizontalZonesNumber() {
@@ -179,7 +186,9 @@ public final class AmbientBacklightSettings implements Parcelable {
    }

    /**
     * Gets the number of lights in each vertical zone.
     * Gets the number of vertical color zones.
     *
     * <p>A color zone is a group of lights that always display the same color.
     */
    @IntRange(from = 0)
    public int getVerticalZonesNumber() {
@@ -187,7 +196,11 @@ public final class AmbientBacklightSettings implements Parcelable {
    }

    /**
     * Returns {@code true} if letter box is omitted; {@code false} otherwise.
     * Returns {@code true} if the black portion of the screen in letter box mode is omitted;
     * {@code false} otherwise.
     *
     * <p>Letter-box is a technique to keep the original aspect ratio when displayed on a screen
     * with different aspect ratio. Black bars are added to the top and bottom.
     * @hide
     */
    public boolean isLetterboxOmitted() {
@@ -195,6 +208,10 @@ public final class AmbientBacklightSettings implements Parcelable {
    }

    /**
     * Gets the detection threshold of the ambient light.
     *
     * <p>If the color of a color zone is changed by the difference is smaller than the threshold,
     * the change is ignored.
     * @hide
     */
    public int getThreshold() {
+3 −1
Original line number Diff line number Diff line
@@ -42,10 +42,12 @@ interface IMediaQualityManager {
    SoundProfile createSoundProfile(in SoundProfile pp);
    void updateSoundProfile(in String id, in SoundProfile pp);
    void removeSoundProfile(in String id);
    SoundProfile getSoundProfileById(in String id);
    SoundProfile getSoundProfile(in int type, in String name);
    List<SoundProfile> getSoundProfilesByPackage(in String packageName);
    List<SoundProfile> getAvailableSoundProfiles();
    List<String> getSoundProfilePackageNames();
    List<String> getSoundProfileAllowList();
    void setSoundProfileAllowList(in List<String> packages);

    void registerPictureProfileCallback(in IPictureProfileCallback cb);
    void registerSoundProfileCallback(in ISoundProfileCallback cb);
+6 −3
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@

package android.media.quality;

import android.media.quality.ParamCapability;
import android.media.quality.SoundProfile;

/**
@@ -24,7 +25,9 @@ import android.media.quality.SoundProfile;
 * @hide
 */
oneway interface ISoundProfileCallback {
    void onSoundProfileAdded(in long id, in SoundProfile p);
    void onSoundProfileUpdated(in long id, in SoundProfile p);
    void onSoundProfileRemoved(in long id, in SoundProfile p);
    void onSoundProfileAdded(in String id, in SoundProfile p);
    void onSoundProfileUpdated(in String id, in SoundProfile p);
    void onSoundProfileRemoved(in String id, in SoundProfile p);
    void onParamCapabilitiesChanged(in String id, in List<ParamCapability> caps);
    void onError(in int err);
}
Loading