Skip to content
Snippets Groups Projects
Commit 2f602fbf authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Prevent potential NPE at app initialization

parent c3502e93
No related branches found
No related tags found
No related merge requests found
......@@ -103,8 +103,8 @@ public class AndroidDevices {
isChromeBook = pm != null && pm.hasSystemFeature("org.chromium.arc.device_management");
hasPlayServices = pm == null || hasPlayServices(pm);
hasPiP = AndroidUtil.isOOrLater || AndroidUtil.isNougatOrLater && isAndroidTv;
isPhone = ctx == null || ((TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE))
.getPhoneType() != TelephonyManager.PHONE_TYPE_NONE;
final TelephonyManager tm = ctx != null ? ((TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE)) : null;
isPhone = tm == null || tm.getPhoneType() != TelephonyManager.PHONE_TYPE_NONE;
// hasCombBar test if device has Combined Bar : only for tablet with Honeycomb or ICS
hasCombBar = !AndroidDevices.isPhone && AndroidUtil.isHoneycombOrLater
&& !AndroidUtil.isJellyBeanMR1OrLater;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment