Loading media/java/android/media/AudioManagerInternal.java +3 −3 Original line number Diff line number Diff line Loading @@ -29,13 +29,13 @@ 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, int pid); public abstract void adjustStreamVolumeForUid(int streamType, int direction, int flags, String callingPackage, int uid); String callingPackage, int uid, int pid); public abstract void setStreamVolumeForUid(int streamType, int direction, int flags, String callingPackage, int uid); String callingPackage, int uid, int pid); public abstract void setRingerModeDelegate(RingerModeDelegate delegate); Loading services/core/java/com/android/server/audio/AudioService.java +138 −40 File changed.Preview size limit exceeded, changes collapsed. Show changes services/core/java/com/android/server/media/MediaSessionRecord.java +7 −4 Original line number Diff line number Diff line Loading @@ -328,7 +328,7 @@ public class MediaSessionRecord implements IBinder.DeathRecipient, MediaSessionR public void run() { try { mAudioManagerInternal.setStreamVolumeForUid(stream, volumeValue, flags, opPackageName, uid); opPackageName, uid, pid); } catch (IllegalArgumentException | SecurityException e) { Log.e(TAG, "Cannot set volume: stream=" + stream + ", value=" + volumeValue + ", flags=" + flags, e); Loading Loading @@ -501,12 +501,15 @@ public class MediaSessionRecord implements IBinder.DeathRecipient, MediaSessionR // Must use opPackageName for adjusting volumes with UID. final String opPackageName; final int uid; final int pid; if (asSystemService) { opPackageName = mContext.getOpPackageName(); uid = Process.SYSTEM_UID; pid = Process.myPid(); } else { opPackageName = callingOpPackageName; uid = callingUid; pid = callingPid; } mHandler.post(new Runnable() { @Override Loading @@ -515,15 +518,15 @@ public class MediaSessionRecord implements IBinder.DeathRecipient, MediaSessionR if (useSuggested) { if (AudioSystem.isStreamActive(stream, 0)) { mAudioManagerInternal.adjustSuggestedStreamVolumeForUid(stream, direction, flags, opPackageName, uid); direction, flags, opPackageName, uid, pid); } else { mAudioManagerInternal.adjustSuggestedStreamVolumeForUid( AudioManager.USE_DEFAULT_STREAM_TYPE, direction, flags | previousFlagPlaySound, opPackageName, uid); flags | previousFlagPlaySound, opPackageName, uid, pid); } } else { mAudioManagerInternal.adjustStreamVolumeForUid(stream, direction, flags, opPackageName, uid); opPackageName, uid, pid); } } catch (IllegalArgumentException | SecurityException e) { Log.e(TAG, "Cannot adjust volume: direction=" + direction + ", stream=" Loading services/core/java/com/android/server/media/MediaSessionService.java +4 −1 Original line number Diff line number Diff line Loading @@ -2107,16 +2107,19 @@ public class MediaSessionService extends SystemService implements Monitor { public void run() { final String callingOpPackageName; final int callingUid; final int callingPid; if (asSystemService) { callingOpPackageName = mContext.getOpPackageName(); callingUid = Process.myUid(); callingPid = Process.myPid(); } else { callingOpPackageName = opPackageName; callingUid = uid; callingPid = pid; } try { mAudioManagerInternal.adjustSuggestedStreamVolumeForUid(suggestedStream, direction, flags, callingOpPackageName, callingUid); direction, flags, callingOpPackageName, callingUid, callingPid); } catch (SecurityException | IllegalArgumentException e) { Log.e(TAG, "Cannot adjust volume: direction=" + direction + ", suggestedStream=" + suggestedStream + ", flags=" + flags Loading Loading
media/java/android/media/AudioManagerInternal.java +3 −3 Original line number Diff line number Diff line Loading @@ -29,13 +29,13 @@ 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, int pid); public abstract void adjustStreamVolumeForUid(int streamType, int direction, int flags, String callingPackage, int uid); String callingPackage, int uid, int pid); public abstract void setStreamVolumeForUid(int streamType, int direction, int flags, String callingPackage, int uid); String callingPackage, int uid, int pid); public abstract void setRingerModeDelegate(RingerModeDelegate delegate); Loading
services/core/java/com/android/server/audio/AudioService.java +138 −40 File changed.Preview size limit exceeded, changes collapsed. Show changes
services/core/java/com/android/server/media/MediaSessionRecord.java +7 −4 Original line number Diff line number Diff line Loading @@ -328,7 +328,7 @@ public class MediaSessionRecord implements IBinder.DeathRecipient, MediaSessionR public void run() { try { mAudioManagerInternal.setStreamVolumeForUid(stream, volumeValue, flags, opPackageName, uid); opPackageName, uid, pid); } catch (IllegalArgumentException | SecurityException e) { Log.e(TAG, "Cannot set volume: stream=" + stream + ", value=" + volumeValue + ", flags=" + flags, e); Loading Loading @@ -501,12 +501,15 @@ public class MediaSessionRecord implements IBinder.DeathRecipient, MediaSessionR // Must use opPackageName for adjusting volumes with UID. final String opPackageName; final int uid; final int pid; if (asSystemService) { opPackageName = mContext.getOpPackageName(); uid = Process.SYSTEM_UID; pid = Process.myPid(); } else { opPackageName = callingOpPackageName; uid = callingUid; pid = callingPid; } mHandler.post(new Runnable() { @Override Loading @@ -515,15 +518,15 @@ public class MediaSessionRecord implements IBinder.DeathRecipient, MediaSessionR if (useSuggested) { if (AudioSystem.isStreamActive(stream, 0)) { mAudioManagerInternal.adjustSuggestedStreamVolumeForUid(stream, direction, flags, opPackageName, uid); direction, flags, opPackageName, uid, pid); } else { mAudioManagerInternal.adjustSuggestedStreamVolumeForUid( AudioManager.USE_DEFAULT_STREAM_TYPE, direction, flags | previousFlagPlaySound, opPackageName, uid); flags | previousFlagPlaySound, opPackageName, uid, pid); } } else { mAudioManagerInternal.adjustStreamVolumeForUid(stream, direction, flags, opPackageName, uid); opPackageName, uid, pid); } } catch (IllegalArgumentException | SecurityException e) { Log.e(TAG, "Cannot adjust volume: direction=" + direction + ", stream=" Loading
services/core/java/com/android/server/media/MediaSessionService.java +4 −1 Original line number Diff line number Diff line Loading @@ -2107,16 +2107,19 @@ public class MediaSessionService extends SystemService implements Monitor { public void run() { final String callingOpPackageName; final int callingUid; final int callingPid; if (asSystemService) { callingOpPackageName = mContext.getOpPackageName(); callingUid = Process.myUid(); callingPid = Process.myPid(); } else { callingOpPackageName = opPackageName; callingUid = uid; callingPid = pid; } try { mAudioManagerInternal.adjustSuggestedStreamVolumeForUid(suggestedStream, direction, flags, callingOpPackageName, callingUid); direction, flags, callingOpPackageName, callingUid, callingPid); } catch (SecurityException | IllegalArgumentException e) { Log.e(TAG, "Cannot adjust volume: direction=" + direction + ", suggestedStream=" + suggestedStream + ", flags=" + flags Loading