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

Commit c5112786 authored by Haofan Wang's avatar Haofan Wang Committed by Android (Google) Code Review
Browse files

Merge "Add a new(Empty) media quality system service for TV setting" into main

parents 491cef3a a8e5c599
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10873,6 +10873,7 @@ package android.content {
    field public static final String MEDIA_COMMUNICATION_SERVICE = "media_communication";
    field public static final String MEDIA_METRICS_SERVICE = "media_metrics";
    field public static final String MEDIA_PROJECTION_SERVICE = "media_projection";
    field @FlaggedApi("android.media.tv.flags.media_quality_fw") public static final String MEDIA_QUALITY_SERVICE = "media_quality";
    field public static final String MEDIA_ROUTER_SERVICE = "media_router";
    field public static final String MEDIA_SESSION_SERVICE = "media_session";
    field public static final String MIDI_SERVICE = "midi";
+15 −0
Original line number Diff line number Diff line
@@ -150,6 +150,8 @@ import android.media.midi.MidiManager;
import android.media.musicrecognition.IMusicRecognitionManager;
import android.media.musicrecognition.MusicRecognitionManager;
import android.media.projection.MediaProjectionManager;
import android.media.quality.IMediaQualityManager;
import android.media.quality.MediaQualityManager;
import android.media.soundtrigger.SoundTriggerManager;
import android.media.tv.ITvInputManager;
import android.media.tv.TvInputManager;
@@ -1775,6 +1777,19 @@ public final class SystemServiceRegistry {
                        }
                    });
        }
        registerService(Context.MEDIA_QUALITY_SERVICE, MediaQualityManager.class,
                new CachedServiceFetcher<MediaQualityManager>() {
                    @Override
                    public MediaQualityManager createService(ContextImpl ctx)
                            throws ServiceNotFoundException {
                        IBinder iBinder = ServiceManager
                                .getServiceOrThrow(Context.MEDIA_QUALITY_SERVICE);
                        IMediaQualityManager service = IMediaQualityManager
                                .Stub.asInterface(iBinder);
                        return new MediaQualityManager(ctx, service);
                    }
                });

        sInitializing = true;
        try {
            // Note: the following functions need to be @SystemApis, once they become mainline
+12 −0
Original line number Diff line number Diff line
@@ -4325,6 +4325,7 @@ public abstract class Context {
           //@hide: ECM_ENHANCED_CONFIRMATION_SERVICE,
            CONTACT_KEYS_SERVICE,
            RANGING_SERVICE,
            MEDIA_QUALITY_SERVICE,
            ADVANCED_PROTECTION_SERVICE,

    })
@@ -6766,6 +6767,17 @@ public abstract class Context {
     */
    public static final String SUPERVISION_SERVICE = "supervision";

    /**
     * Use with {@link #getSystemService(String)} to retrieve a
     * {@link android.media.quality.MediaQuality} for standardize picture and audio
     * API parameters.
     *
     * @see #getSystemService(String)
     * @see android.media.quality.MediaQuality
     */
    @FlaggedApi(android.media.tv.flags.Flags.FLAG_MEDIA_QUALITY_FW)
    public static final String MEDIA_QUALITY_SERVICE = "media_quality";

    /**
     * Determine whether the given permission is allowed for a particular
     * process and user ID running in the system.
+24 −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.media.quality;

/**
 * Interface for Media Quality Manager
 * @hide
 */
interface IMediaQualityManager {
}
 No newline at end of file
+44 −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.media.quality;

import android.annotation.FlaggedApi;
import android.annotation.SystemService;
import android.content.Context;
import android.media.tv.flags.Flags;

/**
 * Expose TV setting APIs for the application to use
 * @hide
 */
@FlaggedApi(Flags.FLAG_MEDIA_QUALITY_FW)
@SystemService(Context.MEDIA_QUALITY_SERVICE)
public class MediaQualityManager {
    // TODO: unhide the APIs for api review
    private static final String TAG = "MediaQualityManager";

    private final IMediaQualityManager mService;
    private final Context mContext;

    /**
     * @hide
     */
    public MediaQualityManager(Context context, IMediaQualityManager service) {
        mContext = context;
        mService = service;
    }
}
Loading