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

Commit e7d6d97f authored by Terry Heo's avatar Terry Heo
Browse files

Add a system API to query hdmi system audio mode

Bug: 17383620
Change-Id: I75f11619845e5070190414a2bbe967ba85001472
parent eec5634f
Loading
Loading
Loading
Loading
+16 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ package android.media;
import android.Manifest;
import android.Manifest;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
import android.app.PendingIntent;
import android.app.PendingIntent;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothDevice;
import android.content.ComponentName;
import android.content.ComponentName;
@@ -3001,6 +3002,21 @@ public class AudioManager {
        }
        }
    }
    }


    /**
     * Returns true if Hdmi Cec system audio mode is supported.
     *
     * @hide
     */
    @SystemApi
    public boolean isHdmiSystemAudioSupported() {
        try {
            return getService().isHdmiSystemAudioSupported();
        } catch (RemoteException e) {
            Log.w(TAG, "Error querying system audio mode", e);
            return false;
        }
    }

    /**
    /**
     * Return codes for listAudioPorts(), createAudioPatch() ...
     * Return codes for listAudioPorts(), createAudioPatch() ...
     */
     */
+5 −0
Original line number Original line Diff line number Diff line
@@ -5083,6 +5083,11 @@ public class AudioService extends IAudioService.Stub {
        return device;
        return device;
    }
    }


    @Override
    public boolean isHdmiSystemAudioSupported() {
        return mHdmiSystemAudioSupported;
    }

    //==========================================================================================
    //==========================================================================================
    // Camera shutter sound policy.
    // Camera shutter sound policy.
    // config_camera_sound_forced configuration option in config.xml defines if the camera shutter
    // config_camera_sound_forced configuration option in config.xml defines if the camera shutter
+3 −1
Original line number Original line Diff line number Diff line
@@ -201,6 +201,8 @@ interface IAudioService {


    int setHdmiSystemAudioSupported(boolean on);
    int setHdmiSystemAudioSupported(boolean on);


    boolean isHdmiSystemAudioSupported();

    boolean registerAudioPolicy(in AudioPolicyConfig policyConfig, IBinder cb);
    boolean registerAudioPolicy(in AudioPolicyConfig policyConfig, IBinder cb);
    oneway void unregisterAudioPolicyAsync(in IBinder cb);
    oneway void unregisterAudioPolicyAsync(in IBinder cb);
}
}