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

Commit b91869d3 authored by Shibin George's avatar Shibin George Committed by android-build-merger
Browse files

Merge \\"Fix deadlock b/w ActivityManagerService and MediaSessionService\\" am: 4eea3a7f

am: 42927c4e

Change-Id: Ieb503007f420f06c599b8fc9f4703954885754b0
parents fdff97ca 42927c4e
Loading
Loading
Loading
Loading
+18 −7
Original line number Diff line number Diff line
@@ -890,6 +890,15 @@ public class MediaSessionService extends SystemService implements Monitor {
                    }
                    return;
                }

                // Execute mAudioService.adjustSuggestedStreamVolume() on
                // handler thread of MediaSessionService.
                // This will release the MediaSessionService.mLock sooner and avoid
                // a potential deadlock between MediaSessionService.mLock and
                // ActivityManagerService lock.
                mHandler.post(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            String packageName = getContext().getOpPackageName();
                            mAudioService.adjustSuggestedStreamVolume(direction, suggestedStream,
@@ -897,6 +906,8 @@ public class MediaSessionService extends SystemService implements Monitor {
                        } catch (RemoteException e) {
                            Log.e(TAG, "Error adjusting default volume.", e);
                        }
                    }
                });
            } else {
                session.adjustVolume(direction, flags, getContext().getPackageName(),
                        UserHandle.myUserId(), true);