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

Commit 39745d82 authored by Sungsoo Lim's avatar Sungsoo Lim
Browse files

[DO NOT MERGE] Catch RuntimeException from DisplayManager

Bug: 171714761
Test: build
Change-Id: I5bad08dcf49472af16df18418102407be56e67e7
parent 08771516
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -361,7 +361,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) {
@@ -2075,6 +2080,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