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

Commit 94d92b4d authored by Sungsoo Lim's avatar Sungsoo Lim Committed by Automerger Merge Worker
Browse files

[DO NOT MERGE] Catch RuntimeException from DisplayManager am: 39745d82

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13566539

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iddbaad3b57389deed966782c4e63422de42ab080
parents 8f577fc4 39745d82
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -381,7 +381,12 @@ public class MediaRouter {
        }

        public Display[] getAllPresentationDisplays() {
            try {
                return mDisplayService.getDisplays(DisplayManager.DISPLAY_CATEGORY_PRESENTATION);
            } catch (RuntimeException ex) {
                Log.e(TAG, "Unable to get displays.", ex);
                return null;
            }
        }

        private void updatePresentationDisplays(int changedDisplayId) {
@@ -2085,6 +2090,9 @@ public class MediaRouter {
        private Display choosePresentationDisplay() {
            if ((mSupportedTypes & ROUTE_TYPE_LIVE_VIDEO) != 0) {
                Display[] displays = sStatic.getAllPresentationDisplays();
                if (displays == null || displays.length == 0) {
                    return null;
                }

                // Ensure that the specified display is valid for presentations.
                // This check will normally disallow the default display unless it was