OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.media.router.cast; | 5 package org.chromium.chrome.browser.media.router.cast; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.support.v7.media.MediaRouter; | 8 import android.support.v7.media.MediaRouter; |
9 | 9 |
10 import org.chromium.chrome.browser.media.router.DiscoveryDelegate; | 10 import org.chromium.chrome.browser.media.router.DiscoveryDelegate; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 } | 194 } |
195 | 195 |
196 @Nullable | 196 @Nullable |
197 private static MediaRouter getAndroidMediaRouter(Context applicationContext) { | 197 private static MediaRouter getAndroidMediaRouter(Context applicationContext) { |
198 try { | 198 try { |
199 // Pre-MR1 versions of JB do not have the complete MediaRouter APIs, | 199 // Pre-MR1 versions of JB do not have the complete MediaRouter APIs, |
200 // so getting the MediaRouter instance will throw an exception. | 200 // so getting the MediaRouter instance will throw an exception. |
201 return MediaRouter.getInstance(applicationContext); | 201 return MediaRouter.getInstance(applicationContext); |
202 } catch (NoSuchMethodError e) { | 202 } catch (NoSuchMethodError e) { |
203 return null; | 203 return null; |
204 } catch (NoClassDefFoundError e) { | |
205 // Happens with Robolectric. | |
mark a. foltz
2015/10/01 18:33:28
This comment didn't make sense to me, maybe it doe
| |
206 return null; | |
204 } | 207 } |
205 } | 208 } |
206 | 209 |
207 } | 210 } |
OLD | NEW |