Project: titanium
Issue TIMOB-19943: Android: Support casting hyperloop proxies to different native types
Previously we'd return/wrap any arguments and return types as the actual Java type we received, rather than the type declared by the method return/param type. this led to an issue where we'd receive types that weren't available in our hyperloop JS wrappers (either because they weren't in the type hierarchy we traversed - or more important, if they were "hidden"/native types). As an example, we'd get a DisplayListCanvas (a subclass of Canvas) in a subclass of View's onDraw method. That type isn't in the android.jar and we have no means of trying to get it's details without the android source code. the method declares the param type as simply Canvas. As a hedge against this, when we wrap arguments or return types, we hold the object and it's specific subclass on the Java side, but report as and wrap with the declared type. As a result, that means we now need some way to be able to explicitly cast down to subclasses if we know the value is a more specific subclass (say on View.getLayoutParams).
Story points: 5