From ebdcc80ac26ae51ba27d9469a501a6242256aa50 Mon Sep 17 00:00:00 2001 From: Deepanshu Gupta Date: Mon, 1 Feb 2016 14:03:30 -0800 Subject: [PATCH] Remove obsolete try catch The try catch was to prevent crashing on preview releases of Android Studio. We don't support them anymore. Change-Id: I8e33cae98117c0034aea1b56903b623fcb64435e --- .../layoutlib/bridge/impl/RenderAction.java | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java index 92b39e3f1b786..6d9e872f1a797 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderAction.java @@ -382,23 +382,17 @@ public abstract class RenderAction extends FrameworkReso config.orientation = Configuration.ORIENTATION_UNDEFINED; } - try { - ScreenRound roundness = hardwareConfig.getScreenRoundness(); - if (roundness != null) { - switch (roundness) { - case ROUND: - config.screenLayout |= Configuration.SCREENLAYOUT_ROUND_YES; - break; - case NOTROUND: - config.screenLayout |= Configuration.SCREENLAYOUT_ROUND_NO; - } - } else { - config.screenLayout |= Configuration.SCREENLAYOUT_ROUND_UNDEFINED; + ScreenRound roundness = hardwareConfig.getScreenRoundness(); + if (roundness != null) { + switch (roundness) { + case ROUND: + config.screenLayout |= Configuration.SCREENLAYOUT_ROUND_YES; + break; + case NOTROUND: + config.screenLayout |= Configuration.SCREENLAYOUT_ROUND_NO; } - } catch (NoSuchMethodError ignored) { - // getScreenRoundness was added in later stages of API 15. So, it's not present on some - // preview releases of API 15. - // TODO: Remove the try catch around Oct 2015. + } else { + config.screenLayout |= Configuration.SCREENLAYOUT_ROUND_UNDEFINED; } String locale = getParams().getLocale(); if (locale != null && !locale.isEmpty()) config.locale = new Locale(locale);