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

Commit 6565c0db authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

MediaSessionRecord: protect adjustVolume from SecurityException

Take into account that all methods that end up calling
  AudioService.adjustStreamVolume(...) can throw a
  SecurityException when the caller doesn't have the right
  permission to change the DnD mode.

Bug: 110525559
Test: none yet
Change-Id: I4622a07ea8be2ce03fb9732796a08f671a17b45d
parent 50621368
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -481,7 +481,7 @@ public class MediaSessionRecord implements IBinder.DeathRecipient {
                        mAudioManagerInternal.adjustStreamVolumeForUid(stream, direction, flags,
                                packageName, uid);
                    }
                } catch (IllegalArgumentException e) {
                } catch (IllegalArgumentException | SecurityException e) {
                    Log.e(TAG, "Cannot adjust volume: direction=" + direction + ", stream="
                            + stream + ", flags=" + flags + ", packageName=" + packageName
                            + ", uid=" + uid + ", useSuggested=" + useSuggested