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

Commit 90874337 authored by John Spurlock's avatar John Spurlock
Browse files

AudioService: Write base stream volume changes to the event log.

 - Add a new volume_changed event, reported at the stream level.
 - Only include changes to base streams (no aliases).
 - Include the caller for each change.  A caller is either:
   -  a pkg name (for external calls or known media sessions)
   -  a system server class's log tag (for internal calls,
      disambiguates "android")

Bug: 19599935
Change-Id: Ia61b68ff1e7e2907a24972790ec052bfe099e665
parent af66416e
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1498,7 +1498,7 @@ public class AudioManager {
    public void setMode(int mode) {
        IAudioService service = getService();
        try {
            service.setMode(mode, mICallBack);
            service.setMode(mode, mICallBack, mContext.getOpPackageName());
        } catch (RemoteException e) {
            Log.e(TAG, "Dead object in setMode", e);
        }
@@ -3037,7 +3037,8 @@ public class AudioManager {
    public void setWiredDeviceConnectionState(int type, int state, String address, String name) {
        IAudioService service = getService();
        try {
            service.setWiredDeviceConnectionState(type, state, address, name);
            service.setWiredDeviceConnectionState(type, state, address, name,
                    mContext.getOpPackageName());
        } catch (RemoteException e) {
            Log.e(TAG, "Dead object in setWiredDeviceConnectionState "+e);
        }
@@ -3181,7 +3182,7 @@ public class AudioManager {
     */
    public void disableSafeMediaVolume() {
        try {
            getService().disableSafeMediaVolume();
            getService().disableSafeMediaVolume(mContext.getOpPackageName());
        } catch (RemoteException e) {
            Log.w(TAG, "Error disabling safe media volume", e);
        }
+1 −2
Original line number Diff line number Diff line
@@ -27,8 +27,7 @@ import com.android.server.LocalServices;
public abstract class AudioManagerInternal {

    public abstract void adjustSuggestedStreamVolumeForUid(int streamType, int direction,
            int flags,
            String callingPackage, int uid);
            int flags, String callingPackage, int uid);

    public abstract void adjustStreamVolumeForUid(int streamType, int direction, int flags,
            String callingPackage, int uid);
+6 −4
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ import android.view.KeyEvent;
interface IAudioService {

    void adjustSuggestedStreamVolume(int direction, int suggestedStreamType, int flags,
            String callingPackage);
            String callingPackage, String caller);

    void adjustStreamVolume(int streamType, int direction, int flags, String callingPackage);

@@ -80,7 +80,7 @@ interface IAudioService {

    boolean shouldVibrate(int vibrateType);

    void setMode(int mode, IBinder cb);
    void setMode(int mode, IBinder cb, String callingPackage);

    int getMode();

@@ -181,7 +181,9 @@ interface IAudioService {
    IRingtonePlayer getRingtonePlayer();
    int getUiSoundsStreamType();

    void setWiredDeviceConnectionState(int type, int state, String address, String name);
    void setWiredDeviceConnectionState(int type, int state, String address, String name,
            String caller);

    int setBluetoothA2dpDeviceConnectionState(in BluetoothDevice device, int state, int profile);

    AudioRoutesInfo startWatchingRoutes(in IAudioRoutesObserver observer);
@@ -196,7 +198,7 @@ interface IAudioService {

    boolean isStreamAffectedByMute(int streamType);

    void disableSafeMediaVolume();
    void disableSafeMediaVolume(String callingPackage);

    int setHdmiSystemAudioSupported(boolean on);

+5 −0
Original line number Diff line number Diff line
@@ -216,3 +216,8 @@ option java_package com.android.server
# ---------------------------
2755 fstrim_start (time|2|3)
2756 fstrim_finish (time|2|3)

# ---------------------------
# AudioService.java
# ---------------------------
40000 volume_changed (stream|1), (prev_level|1), (level|1), (max_level|1), (caller|3)
Loading