Don't pass a null Context to RenderScript

We need to check that we have a Context before passing it to
RenderScript.create. getContext can return null if the fragment has been
removed.

I switched this to an early return approach to avoid the deep nesting and added tests.

It is safe to ignore the IfThisThenThat

PiperOrigin-RevId: 159633511
Change-Id: If2286a545c2e514c328dff22c48a99b9ed232e88
1 file changed
tree: 83ddc461371decdbb299a802aa8c1dbda155a13c
  1. assets/
  2. java/
  3. Android.mk
  4. AndroidManifest.xml
  5. LICENSE