Catch RuntimeException from DisplayManager

Bug: 171714761
Test: build
Change-Id: I5bad08dcf49472af16df18418102407be56e67e7
This commit is contained in:
Sungsoo Lim
2021-02-15 15:53:07 +09:00
parent 46b02d88ee
commit 1901401be2

View File

@@ -384,7 +384,12 @@ public class MediaRouter {
} }
public Display[] getAllPresentationDisplays() { public Display[] getAllPresentationDisplays() {
return mDisplayService.getDisplays(DisplayManager.DISPLAY_CATEGORY_PRESENTATION); 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) { private void updatePresentationDisplays(int changedDisplayId) {