Checks if the device has a home screen.
@param context the context.
@return {@code true} if the device has a home screen.
12676
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
    public static boolean hasHomeScreenFeature(Context context) {
        return hasHomeScreenFeature(context.getPackageManager());
    }
1120518
public ScreenModel checkSecurity(ScreenModel screen, ScreenModel parentScreen)
    {
        int iErrorCode = DBConstants.NORMAL_RETURN;
        if (screen != null)
            iErrorCode = ((BaseScreen)screen).checkSecurity();
        if (iErrorCode == Constants.READ_ACCESS)
        {
            ((BaseScreen)screen).setEditing(false);
            ((BaseScreen)screen).setAppending(false);
            iErrorCode = DBConstants.NORMAL_RETURN;
        }
        if (iErrorCode == DBConstants.NORMAL_RETURN)
            return screen;    // Good, access allowed
        else
        {
            if (screen != null)
                screen.free();
            return this.getSecurityScreen(iErrorCode, (BasePanel)parentScreen);  // Create and return the login or error screen
        }
    }
165187
@TargetApi(Build.VERSION_CODES.FROYO)
    public static boolean hasGpsLocationFeature(Context context) {
        return hasGpsLocationFeature(context.getPackageManager());
    }
713634
public static boolean isSystemBarOnBottom(Context ctx) {
        WindowManager wm = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE);
        DisplayMetrics metrics = new DisplayMetrics();
        wm.getDefaultDisplay().getMetrics(metrics);
        Configuration cfg = ctx.getResources().getConfiguration();
        boolean canMove = (metrics.widthPixels != metrics.heightPixels &&
                cfg.smallestScreenWidthDp < 600);

        return (!canMove || metrics.widthPixels < metrics.heightPixels);
    }
875656
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
    public static boolean hasUsbAccessoryFeature(Context context) {
        return hasUsbAccessoryFeature(context.getPackageManager());
    }
868565
public static int getScreenWidth(Context context) {
        DisplayMetrics metrics = context.getResources().getDisplayMetrics();
        return metrics.widthPixels;
    }
1153152
function() {
        
        var onScreen = false;
        if (this.map) {
            var screenBounds = this.map.getExtent();
            onScreen = screenBounds.containsLonLat(this.lonlat);
        }    
        return onScreen;
    }
911769
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
    public static boolean hasSipFeature(Context context) {
        return hasSipFeature(context.getPackageManager());
    }
178521
public static boolean isConnected(Context context) {
        if (context == null) {
            return true;
        }
        ConnectivityManager cm = (ConnectivityManager) context
                .getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo info = cm.getActiveNetworkInfo();
        return info != null && info.isConnectedOrConnecting();
    }
1002987
public static boolean isAvailable(Context context){
        FingerprintManager fingerprintManager = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
        if(fingerprintManager!=null){
            return (fingerprintManager.isHardwareDetected() && fingerprintManager.hasEnrolledFingerprints());
        }
        return false;
    }
252258
public static boolean isOnline(Context context) {
        int res = context.checkCallingOrSelfPermission(Manifest.permission.ACCESS_NETWORK_STATE);
        if (res == PackageManager.PERMISSION_GRANTED) {
            ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
            NetworkInfo netInfo = cm.getActiveNetworkInfo();
            if (netInfo != null && netInfo.isConnectedOrConnecting()) {
                return true;
            }
            return false;
        }

        return true;
    }
1225372
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
    public static boolean hasLandscapeScreenFeature(Context context) {
        return hasLandscapeScreenFeature(context.getPackageManager());
    }
1347349
public static boolean isConnectedToWiFiOrMobileNetwork(Context context) {
    final String service = Context.CONNECTIVITY_SERVICE;
    final ConnectivityManager manager = (ConnectivityManager) context.getSystemService(service);
    final NetworkInfo networkInfo = manager.getActiveNetworkInfo();

    if (networkInfo == null) {
      return false;
    }

    final boolean isWifiNetwork = networkInfo.getType() == ConnectivityManager.TYPE_WIFI;
    final boolean isMobileNetwork = networkInfo.getType() == ConnectivityManager.TYPE_MOBILE;

    if (isWifiNetwork || isMobileNetwork) {
      return true;
    }

    return false;
  }
304368
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
    public static boolean hasDistinctMultiFakeTouchFeature(Context context) {
        return hasDistinctMultiFakeTouchFeature(context.getPackageManager());
    }
491019
@TargetApi(Build.VERSION_CODES.FROYO)
    public static boolean hasAccelerometerSensorFeature(Context context) {
        return hasAccelerometerSensorFeature(context.getPackageManager());
    }
829015
protected boolean checkEnvironment() {
        home = getHomeDir().getAbsoluteFile();
        home.mkdirs();
        LOGGER.info(getApplicationName()+" home directory: "+home);

        // check that home exists (as mkdirs could have failed silently), otherwise throw a meaningful error
        if (!home.exists()) {
            context.setAttribute(APP,new NoHomeDirError(home));
            return false;
        }

        return true;
    }
625079
public static boolean isTopApplication(Context context) {
		ComponentName activity = getTopActivity(context);
		if (activity == null) {
			return false;
		}
		return activity.getPackageName().equals(context.getApplicationInfo().packageName);
	}